Skip to content

Commit 0559730

Browse files
ukleinekUwe Kleine-König
authored andcommitted
pwm: Drop unused function pwm_apply_args()
The function pwm_apply_args() was introduced with the concept of atomic PWM configuration and needed for drivers not using this concept yet. Now all drivers are converted accordingly and so no callers are left which allows to remove this function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Link: https://patch.msgid.link/20250922094327.1143944-2-u.kleine-koenig@baylibre.com Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
1 parent 5f7ff90 commit 0559730

1 file changed

Lines changed: 0 additions & 33 deletions

File tree

include/linux/pwm.h

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -611,39 +611,6 @@ devm_fwnode_pwm_get(struct device *dev, struct fwnode_handle *fwnode,
611611
}
612612
#endif
613613

614-
static inline void pwm_apply_args(struct pwm_device *pwm)
615-
{
616-
struct pwm_state state = { };
617-
618-
/*
619-
* PWM users calling pwm_apply_args() expect to have a fresh config
620-
* where the polarity and period are set according to pwm_args info.
621-
* The problem is, polarity can only be changed when the PWM is
622-
* disabled.
623-
*
624-
* PWM drivers supporting hardware readout may declare the PWM device
625-
* as enabled, and prevent polarity setting, which changes from the
626-
* existing behavior, where all PWM devices are declared as disabled
627-
* at startup (even if they are actually enabled), thus authorizing
628-
* polarity setting.
629-
*
630-
* To fulfill this requirement, we apply a new state which disables
631-
* the PWM device and set the reference period and polarity config.
632-
*
633-
* Note that PWM users requiring a smooth handover between the
634-
* bootloader and the kernel (like critical regulators controlled by
635-
* PWM devices) will have to switch to the atomic API and avoid calling
636-
* pwm_apply_args().
637-
*/
638-
639-
state.enabled = false;
640-
state.polarity = pwm->args.polarity;
641-
state.period = pwm->args.period;
642-
state.usage_power = false;
643-
644-
pwm_apply_might_sleep(pwm, &state);
645-
}
646-
647614
struct pwm_lookup {
648615
struct list_head list;
649616
const char *provider;

0 commit comments

Comments
 (0)