~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/mfd/lm3533.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*
  3  * lm3533.h -- LM3533 interface
  4  *
  5  * Copyright (C) 2011-2012 Texas Instruments
  6  *
  7  * Author: Johan Hovold <jhovold@gmail.com>
  8  */
  9 
 10 #ifndef __LINUX_MFD_LM3533_H
 11 #define __LINUX_MFD_LM3533_H
 12 
 13 #define LM3533_ATTR_RO(_name) \
 14         DEVICE_ATTR(_name, S_IRUGO, show_##_name, NULL)
 15 #define LM3533_ATTR_RW(_name) \
 16         DEVICE_ATTR(_name, S_IRUGO | S_IWUSR , show_##_name, store_##_name)
 17 
 18 struct device;
 19 struct gpio_desc;
 20 struct regmap;
 21 
 22 struct lm3533 {
 23         struct device *dev;
 24 
 25         struct regmap *regmap;
 26 
 27         struct gpio_desc *hwen;
 28         int irq;
 29 
 30         unsigned have_als:1;
 31         unsigned have_backlights:1;
 32         unsigned have_leds:1;
 33 };
 34 
 35 struct lm3533_ctrlbank {
 36         struct lm3533 *lm3533;
 37         struct device *dev;
 38         int id;
 39 };
 40 
 41 struct lm3533_als_platform_data {
 42         unsigned pwm_mode:1;            /* PWM input mode (default analog) */
 43         u8 r_select;                    /* 1 - 127 (ignored in PWM-mode) */
 44 };
 45 
 46 struct lm3533_bl_platform_data {
 47         char *name;
 48         u16 max_current;                /* 5000 - 29800 uA (800 uA step) */
 49         u8 default_brightness;          /* 0 - 255 */
 50         u8 pwm;                         /* 0 - 0x3f */
 51 };
 52 
 53 struct lm3533_led_platform_data {
 54         char *name;
 55         const char *default_trigger;
 56         u16 max_current;                /* 5000 - 29800 uA (800 uA step) */
 57         u8 pwm;                         /* 0 - 0x3f */
 58 };
 59 
 60 enum lm3533_boost_freq {
 61         LM3533_BOOST_FREQ_500KHZ,
 62         LM3533_BOOST_FREQ_1000KHZ,
 63 };
 64 
 65 enum lm3533_boost_ovp {
 66         LM3533_BOOST_OVP_16V,
 67         LM3533_BOOST_OVP_24V,
 68         LM3533_BOOST_OVP_32V,
 69         LM3533_BOOST_OVP_40V,
 70 };
 71 
 72 struct lm3533_platform_data {
 73         enum lm3533_boost_ovp boost_ovp;
 74         enum lm3533_boost_freq boost_freq;
 75 
 76         struct lm3533_als_platform_data *als;
 77 
 78         struct lm3533_bl_platform_data *backlights;
 79         int num_backlights;
 80 
 81         struct lm3533_led_platform_data *leds;
 82         int num_leds;
 83 };
 84 
 85 extern int lm3533_ctrlbank_enable(struct lm3533_ctrlbank *cb);
 86 extern int lm3533_ctrlbank_disable(struct lm3533_ctrlbank *cb);
 87 
 88 extern int lm3533_ctrlbank_set_brightness(struct lm3533_ctrlbank *cb, u8 val);
 89 extern int lm3533_ctrlbank_get_brightness(struct lm3533_ctrlbank *cb, u8 *val);
 90 extern int lm3533_ctrlbank_set_max_current(struct lm3533_ctrlbank *cb,
 91                                                                 u16 imax);
 92 extern int lm3533_ctrlbank_set_pwm(struct lm3533_ctrlbank *cb, u8 val);
 93 extern int lm3533_ctrlbank_get_pwm(struct lm3533_ctrlbank *cb, u8 *val);
 94 
 95 extern int lm3533_read(struct lm3533 *lm3533, u8 reg, u8 *val);
 96 extern int lm3533_write(struct lm3533 *lm3533, u8 reg, u8 val);
 97 extern int lm3533_update(struct lm3533 *lm3533, u8 reg, u8 val, u8 mask);
 98 
 99 #endif  /* __LINUX_MFD_LM3533_H */
100 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php