From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: gpio: add GPIO controller found on Waveshare DSI TOUCH panels Date: Sun, 12 Apr 2026 09:06:58 +1000 Message-ID: In-Reply-To: <20260411-waveshare-dsi-touch-v2-21-75cdbeac5156@oss.qualcomm.com> References: <20260411-waveshare-dsi-touch-v2-0-75cdbeac5156@oss.qualcomm.com> <20260411-waveshare-dsi-touch-v2-21-75cdbeac5156@oss.qualcomm.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review New I2C GPIO controller + backlight driver. Several issues: 1. **Bug -- `max_register` too low**: ```c .max_register = REG_PWM, /* 0x96 */ ``` But probe reads `REG_SIZE` (0x97), `REG_ID` (0x98), and `REG_VERSION` (0x99). Regmap will reject these reads. Should be `.max_register = REG_VERSION`. 2. **Unused `dir_lock` mutex**: `struct mutex dir_lock` is declared and initialized in probe but never acquired anywhere. Remove it. 3. **Driver name mismatch**: The i2c_driver name is `"waveshare-regulator"` but this is a GPIO+backlight driver. Should be `"waveshare-dsi-gpio"` or similar. 4. **Unnecessary `#include `**: No framebuffer APIs are used. 5. **No protection against invalid GPIO offsets**: The chip has 16 GPIO lines (NUM_GPIO=16) but only offsets 0, 1, 2, 4, 8, 9 are meaningful. Writing to undefined offsets (3, 5, 6, 7, 10-15) could set unknown bits in the hardware registers. Consider implementing `.init_valid_mask` to constrain usable offsets. 6. **Minor**: `state->gc.owner = THIS_MODULE` is unnecessary -- the GPIO framework handles this. --- Generated by Claude Code Patch Reviewer