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

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

Version: ~ [ linux-5.14-rc3 ] ~ [ linux-5.13.5 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.53 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.135 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.198 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.240 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.276 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.276 ] ~ [ 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 /*
  2  * Copyright (C) 2011 ST-Ericsson SA
  3  * Written on behalf of Linaro for ST-Ericsson
  4  *
  5  * Author: Linus Walleij <linus.walleij@linaro.org>
  6  *
  7  * License terms: GNU General Public License (GPL) version 2
  8  */
  9 #ifndef MFD_TPS6105X_H
 10 #define MFD_TPS6105X_H
 11 
 12 #include <linux/i2c.h>
 13 #include <linux/regmap.h>
 14 #include <linux/regulator/machine.h>
 15 
 16 /*
 17  * Register definitions to all subdrivers
 18  */
 19 #define TPS6105X_REG_0                  0x00
 20 #define TPS6105X_REG0_MODE_SHIFT        6
 21 #define TPS6105X_REG0_MODE_MASK         (0x03<<6)
 22 /* These defines for both reg0 and reg1 */
 23 #define TPS6105X_REG0_MODE_SHUTDOWN     0x00
 24 #define TPS6105X_REG0_MODE_TORCH        0x01
 25 #define TPS6105X_REG0_MODE_TORCH_FLASH  0x02
 26 #define TPS6105X_REG0_MODE_VOLTAGE      0x03
 27 #define TPS6105X_REG0_VOLTAGE_SHIFT     4
 28 #define TPS6105X_REG0_VOLTAGE_MASK      (3<<4)
 29 #define TPS6105X_REG0_VOLTAGE_450       0
 30 #define TPS6105X_REG0_VOLTAGE_500       1
 31 #define TPS6105X_REG0_VOLTAGE_525       2
 32 #define TPS6105X_REG0_VOLTAGE_500_2     3
 33 #define TPS6105X_REG0_DIMMING_SHIFT     3
 34 #define TPS6105X_REG0_TORCHC_SHIFT      0
 35 #define TPS6105X_REG0_TORCHC_MASK       (7<<0)
 36 #define TPS6105X_REG0_TORCHC_0          0x00
 37 #define TPS6105X_REG0_TORCHC_50         0x01
 38 #define TPS6105X_REG0_TORCHC_75         0x02
 39 #define TPS6105X_REG0_TORCHC_100        0x03
 40 #define TPS6105X_REG0_TORCHC_150        0x04
 41 #define TPS6105X_REG0_TORCHC_200        0x05
 42 #define TPS6105X_REG0_TORCHC_250_400    0x06
 43 #define TPS6105X_REG0_TORCHC_250_500    0x07
 44 #define TPS6105X_REG_1                  0x01
 45 #define TPS6105X_REG1_MODE_SHIFT        6
 46 #define TPS6105X_REG1_MODE_MASK         (0x03<<6)
 47 #define TPS6105X_REG1_MODE_SHUTDOWN     0x00
 48 #define TPS6105X_REG1_MODE_TORCH        0x01
 49 #define TPS6105X_REG1_MODE_TORCH_FLASH  0x02
 50 #define TPS6105X_REG1_MODE_VOLTAGE      0x03
 51 #define TPS6105X_REG_2                  0x02
 52 #define TPS6105X_REG_3                  0x03
 53 
 54 /**
 55  * enum tps6105x_mode - desired mode for the TPS6105x
 56  * @TPS6105X_MODE_SHUTDOWN: this instance is inactive, not used for anything
 57  * @TPS61905X_MODE_TORCH: this instance is used as a LED, usually a while
 58  *      LED, for example as backlight or flashlight. If this is set, the
 59  *      TPS6105X will register to the LED framework
 60  * @TPS6105X_MODE_TORCH_FLASH: this instance is used as a flashgun, usually
 61  *      in a camera
 62  * @TPS6105X_MODE_VOLTAGE: this instance is used as a voltage regulator and
 63  *      will register to the regulator framework
 64  */
 65 enum tps6105x_mode {
 66         TPS6105X_MODE_SHUTDOWN,
 67         TPS6105X_MODE_TORCH,
 68         TPS6105X_MODE_TORCH_FLASH,
 69         TPS6105X_MODE_VOLTAGE,
 70 };
 71 
 72 /**
 73  * struct tps6105x_platform_data - TPS61905x platform data
 74  * @mode: what mode this instance shall be operated in,
 75  *      this is not selectable at runtime
 76  * @regulator_data: initialization data for the voltage
 77  *      regulator if used as a voltage source
 78  */
 79 struct tps6105x_platform_data {
 80         enum tps6105x_mode mode;
 81         struct regulator_init_data *regulator_data;
 82 };
 83 
 84 /**
 85  * struct tps6105x - state holder for the TPS6105x drivers
 86  * @i2c_client: corresponding I2C client
 87  * @regulator: regulator device if used in voltage mode
 88  * @regmap: used for i2c communcation on accessing registers
 89  */
 90 struct tps6105x {
 91         struct tps6105x_platform_data *pdata;
 92         struct i2c_client       *client;
 93         struct regulator_dev    *regulator;
 94         struct regmap           *regmap;
 95 };
 96 
 97 #endif
 98 

~ [ 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