summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-11-09 13:47:52 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2023-11-09 13:47:52 -0800
commitf3bfe643304143ce2727adc893cfa134ba27f968 (patch)
treecd7838ddbce4d28ff277a3eba310e99e05fa8983 /include/linux
parent4bbdb725a36b0d235f3b832bd0c1e885f0442d9f (diff)
parent40592064a1a536adcced4ffea435c392eb9e7192 (diff)
Merge tag 'pwm/for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm
Pull pwm updates from Thierry Reding: "This contains a few fixes and a bunch of cleanups, a lot of which is in preparation for Uwe's character device support that may be ready in time for the next merge window" * tag 'pwm/for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (37 commits) pwm: samsung: Document new member .channel in struct samsung_pwm_chip pwm: bcm2835: Add support for suspend/resume pwm: brcmstb: Checked clk_prepare_enable() return value pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume pwm: pxa: Explicitly include correct DT includes pwm: cros-ec: Simplify using devm_pwmchip_add() and dev_err_probe() pwm: samsung: Consistently use the same name for driver data pwm: vt8500: Simplify using devm functions pwm: sprd: Simplify using devm_pwmchip_add() and dev_err_probe() pwm: sprd: Provide a helper to cast a chip to driver data pwm: spear: Simplify using devm functions pwm: mtk-disp: Simplify using devm_pwmchip_add() pwm: imx-tpm: Simplify using devm functions pwm: brcmstb: Simplify using devm functions pwm: bcm2835: Simplify using devm functions pwm: bcm-iproc: Simplify using devm functions pwm: Adapt sysfs API documentation to reality pwm: dwc: add PWM bit unset in get_state call pwm: dwc: make timer clock configurable pwm: dwc: split pci out of core driver ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pwm.h24
1 files changed, 6 insertions, 18 deletions
diff --git a/include/linux/pwm.h b/include/linux/pwm.h
index d2f9f690a9c1..e3b437587b32 100644
--- a/include/linux/pwm.h
+++ b/include/linux/pwm.h
@@ -71,7 +71,6 @@ struct pwm_state {
* @hwpwm: per-chip relative index of the PWM device
* @pwm: global index of the PWM device
* @chip: PWM chip providing this PWM device
- * @chip_data: chip-private data associated with the PWM device
* @args: PWM arguments
* @state: last applied state
* @last: last implemented state (for PWM_DEBUG)
@@ -82,7 +81,6 @@ struct pwm_device {
unsigned int hwpwm;
unsigned int pwm;
struct pwm_chip *chip;
- void *chip_data;
struct pwm_args args;
struct pwm_state state;
@@ -267,7 +265,6 @@ struct pwm_capture {
* @get_state: get the current PWM state. This function is only
* called once per PWM device when the PWM chip is
* registered.
- * @owner: helps prevent removal of modules exporting active PWMs
*/
struct pwm_ops {
int (*request)(struct pwm_chip *chip, struct pwm_device *pwm);
@@ -278,13 +275,13 @@ struct pwm_ops {
const struct pwm_state *state);
int (*get_state)(struct pwm_chip *chip, struct pwm_device *pwm,
struct pwm_state *state);
- struct module *owner;
};
/**
* struct pwm_chip - abstract a PWM controller
* @dev: device providing the PWMs
* @ops: callbacks for this PWM controller
+ * @owner: module providing this chip
* @base: number of first PWM controlled by this chip
* @npwm: number of PWMs controlled by this chip
* @of_xlate: request a PWM device given a device tree PWM specifier
@@ -295,6 +292,7 @@ struct pwm_ops {
struct pwm_chip {
struct device *dev;
const struct pwm_ops *ops;
+ struct module *owner;
int base;
unsigned int npwm;
@@ -383,13 +381,13 @@ static inline void pwm_disable(struct pwm_device *pwm)
/* PWM provider APIs */
int pwm_capture(struct pwm_device *pwm, struct pwm_capture *result,
unsigned long timeout);
-int pwm_set_chip_data(struct pwm_device *pwm, void *data);
-void *pwm_get_chip_data(struct pwm_device *pwm);
-int pwmchip_add(struct pwm_chip *chip);
+int __pwmchip_add(struct pwm_chip *chip, struct module *owner);
+#define pwmchip_add(chip) __pwmchip_add(chip, THIS_MODULE)
void pwmchip_remove(struct pwm_chip *chip);
-int devm_pwmchip_add(struct device *dev, struct pwm_chip *chip);
+int __devm_pwmchip_add(struct device *dev, struct pwm_chip *chip, struct module *owner);
+#define devm_pwmchip_add(dev, chip) __devm_pwmchip_add(dev, chip, THIS_MODULE)
struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip,
unsigned int index,
@@ -445,16 +443,6 @@ static inline int pwm_capture(struct pwm_device *pwm,
return -EINVAL;
}
-static inline int pwm_set_chip_data(struct pwm_device *pwm, void *data)
-{
- return -EINVAL;
-}
-
-static inline void *pwm_get_chip_data(struct pwm_device *pwm)
-{
- return NULL;
-}
-
static inline int pwmchip_add(struct pwm_chip *chip)
{
return -EINVAL;