summaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-lp55xx-common.h
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2024-06-26 18:00:09 +0200
committerLee Jones <lee@kernel.org>2024-06-26 18:08:30 +0200
commitdb30c2891bfc74acb8823edee5f39cbc36bd9a4d (patch)
treedc5c978901b4d70f55f2703ca574ba4ea159dc06 /drivers/leds/leds-lp55xx-common.h
parentleds: leds-lp55xx: Generalize stop_all_engine OP (diff)
downloadlinux-db30c2891bfc74acb8823edee5f39cbc36bd9a4d.tar.xz
linux-db30c2891bfc74acb8823edee5f39cbc36bd9a4d.zip
leds: leds-lp55xx: Generalize probe/remove functions
Now that stop_all_engine is generalized, probe and remove function are the same across every lp55xx based LED driver and can be generalized. To permit to use a common probe, make use of the OF match_data and i2c driver_data value to store the device_config struct specific for the LED. Also drop the now unused exported symbol in lp55xx-common and make them static. Update any lp55xx based LED driver to use the new generic probe/remove. Suggested-by: Lee Jones <lee@kernel.org> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Link: https://lore.kernel.org/r/20240626160027.19703-5-ansuelsmth@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/leds/leds-lp55xx-common.h')
-rw-r--r--drivers/leds/leds-lp55xx-common.h21
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/leds/leds-lp55xx-common.h b/drivers/leds/leds-lp55xx-common.h
index c7c8a77ddb1a..26a724acac16 100644
--- a/drivers/leds/leds-lp55xx-common.h
+++ b/drivers/leds/leds-lp55xx-common.h
@@ -164,7 +164,7 @@ struct lp55xx_chip {
struct lp55xx_platform_data *pdata;
struct mutex lock; /* lock for user-space interface */
int num_leds;
- struct lp55xx_device_config *cfg;
+ const struct lp55xx_device_config *cfg;
enum lp55xx_engine_index engine_idx;
struct lp55xx_engine engines[LP55XX_ENGINE_MAX];
const struct firmware *fw;
@@ -203,21 +203,8 @@ extern bool lp55xx_is_extclk_used(struct lp55xx_chip *chip);
/* common chip functions */
extern void lp55xx_stop_all_engine(struct lp55xx_chip *chip);
-/* common device init/deinit functions */
-extern int lp55xx_init_device(struct lp55xx_chip *chip);
-extern void lp55xx_deinit_device(struct lp55xx_chip *chip);
-
-/* common LED class device functions */
-extern int lp55xx_register_leds(struct lp55xx_led *led,
- struct lp55xx_chip *chip);
-
-/* common device attributes functions */
-extern int lp55xx_register_sysfs(struct lp55xx_chip *chip);
-extern void lp55xx_unregister_sysfs(struct lp55xx_chip *chip);
-
-/* common device tree population function */
-extern struct lp55xx_platform_data
-*lp55xx_of_populate_pdata(struct device *dev, struct device_node *np,
- struct lp55xx_chip *chip);
+/* common probe/remove function */
+extern int lp55xx_probe(struct i2c_client *client);
+extern void lp55xx_remove(struct i2c_client *client);
#endif /* _LEDS_LP55XX_COMMON_H */