Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

pwm: pca9685: Use new GPIO line value setter callbacks

struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20250408-gpiochip-set-rv-pwm-v1-1-61e5c3358a74@linaro.org
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>

authored by

Bartosz Golaszewski and committed by
Uwe Kleine-König
29f1d5ca 96d20cfd

+5 -3
+5 -3
drivers/pwm/pwm-pca9685.c
··· 263 263 return pca9685_pwm_get_duty(chip, offset) != 0; 264 264 } 265 265 266 - static void pca9685_pwm_gpio_set(struct gpio_chip *gpio, unsigned int offset, 267 - int value) 266 + static int pca9685_pwm_gpio_set(struct gpio_chip *gpio, unsigned int offset, 267 + int value) 268 268 { 269 269 struct pwm_chip *chip = gpiochip_get_data(gpio); 270 270 271 271 pca9685_pwm_set_duty(chip, offset, value ? PCA9685_COUNTER_RANGE : 0); 272 + 273 + return 0; 272 274 } 273 275 274 276 static void pca9685_pwm_gpio_free(struct gpio_chip *gpio, unsigned int offset) ··· 323 321 pca->gpio.direction_input = pca9685_pwm_gpio_direction_input; 324 322 pca->gpio.direction_output = pca9685_pwm_gpio_direction_output; 325 323 pca->gpio.get = pca9685_pwm_gpio_get; 326 - pca->gpio.set = pca9685_pwm_gpio_set; 324 + pca->gpio.set_rv = pca9685_pwm_gpio_set; 327 325 pca->gpio.base = -1; 328 326 pca->gpio.ngpio = PCA9685_MAXCHAN; 329 327 pca->gpio.can_sleep = true;