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

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

Version: ~ [ linux-5.13-rc5 ] ~ [ linux-5.12.9 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.42 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.124 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.193 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.235 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.271 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.271 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ 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.5 ] ~ [ 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 regmap;
 20 
 21 struct lm3533 {
 22         struct device *dev;
 23 
 24         struct regmap *regmap;
 25 
 26         int gpio_hwen;
 27         int irq;
 28 
 29         unsigned have_als:1;
 30         unsigned have_backlights:1;
 31         unsigned have_leds:1;
 32 };
 33 
 34 struct lm3533_ctrlbank {
 35         struct lm3533 *lm3533;
 36         struct device *dev;
 37         int id;
 38 };
 39 
 40 struct lm3533_als_platform_data {
 41         unsigned pwm_mode:1;            /* PWM input mode (default analog) */
 42         u8 r_select;                    /* 1 - 127 (ignored in PWM-mode) */
 43 };
 44 
 45 struct lm3533_bl_platform_data {
 46         char *name;
 47         u16 max_current;                /* 5000 - 29800 uA (800 uA step) */
 48         u8 default_brightness;          /* 0 - 255 */
 49         u8 pwm;                         /* 0 - 0x3f */
 50 };
 51 
 52 struct lm3533_led_platform_data {
 53         char *name;
 54         const char *default_trigger;
 55         u16 max_current;                /* 5000 - 29800 uA (800 uA step) */
 56         u8 pwm;                         /* 0 - 0x3f */
 57 };
 58 
 59 enum lm3533_boost_freq {
 60         LM3533_BOOST_FREQ_500KHZ,
 61         LM3533_BOOST_FREQ_1000KHZ,
 62 };
 63 
 64 enum lm3533_boost_ovp {
 65         LM3533_BOOST_OVP_16V,
 66         LM3533_BOOST_OVP_24V,
 67         LM3533_BOOST_OVP_32V,
 68         LM3533_BOOST_OVP_40V,
 69 };
 70 
 71 struct lm3533_platform_data {
 72         int gpio_hwen;
 73 
 74         enum lm3533_boost_ovp boost_ovp;
 75         enum lm3533_boost_freq boost_freq;
 76 
 77         struct lm3533_als_platform_data *als;
 78 
 79         struct lm3533_bl_platform_data *backlights;
 80         int num_backlights;
 81 
 82         struct lm3533_led_platform_data *leds;
 83         int num_leds;
 84 };
 85 
 86 extern int lm3533_ctrlbank_enable(struct lm3533_ctrlbank *cb);
 87 extern int lm3533_ctrlbank_disable(struct lm3533_ctrlbank *cb);
 88 
 89 extern int lm3533_ctrlbank_set_brightness(struct lm3533_ctrlbank *cb, u8 val);
 90 extern int lm3533_ctrlbank_get_brightness(struct lm3533_ctrlbank *cb, u8 *val);
 91 extern int lm3533_ctrlbank_set_max_current(struct lm3533_ctrlbank *cb,
 92                                                                 u16 imax);
 93 extern int lm3533_ctrlbank_set_pwm(struct lm3533_ctrlbank *cb, u8 val);
 94 extern int lm3533_ctrlbank_get_pwm(struct lm3533_ctrlbank *cb, u8 *val);
 95 
 96 extern int lm3533_read(struct lm3533 *lm3533, u8 reg, u8 *val);
 97 extern int lm3533_write(struct lm3533 *lm3533, u8 reg, u8 val);
 98 extern int lm3533_update(struct lm3533 *lm3533, u8 reg, u8 val, u8 mask);
 99 
100 #endif  /* __LINUX_MFD_LM3533_H */
101 

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp