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

TOMOYO Linux Cross Reference
Linux/include/linux/mfd/samsung/core.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ 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+ */
  2 /*
  3  * Copyright (c) 2011 Samsung Electronics Co., Ltd
  4  *              http://www.samsung.com
  5  */
  6 
  7 #ifndef __LINUX_MFD_SEC_CORE_H
  8 #define __LINUX_MFD_SEC_CORE_H
  9 
 10 /* Macros to represent minimum voltages for LDO/BUCK */
 11 #define MIN_3000_MV             3000000
 12 #define MIN_2500_MV             2500000
 13 #define MIN_2000_MV             2000000
 14 #define MIN_1800_MV             1800000
 15 #define MIN_1500_MV             1500000
 16 #define MIN_1400_MV             1400000
 17 #define MIN_1000_MV             1000000
 18 
 19 #define MIN_900_MV              900000
 20 #define MIN_850_MV              850000
 21 #define MIN_800_MV              800000
 22 #define MIN_750_MV              750000
 23 #define MIN_650_MV              650000
 24 #define MIN_600_MV              600000
 25 #define MIN_500_MV              500000
 26 
 27 /* Ramp delay in uV/us */
 28 #define RAMP_DELAY_12_MVUS      12000
 29 
 30 /* Macros to represent steps for LDO/BUCK */
 31 #define STEP_50_MV              50000
 32 #define STEP_25_MV              25000
 33 #define STEP_12_5_MV            12500
 34 #define STEP_6_25_MV            6250
 35 
 36 struct gpio_desc;
 37 
 38 enum sec_device_type {
 39         S5M8767X,
 40         S2MPA01,
 41         S2MPS11X,
 42         S2MPS13X,
 43         S2MPS14X,
 44         S2MPS15X,
 45         S2MPU02,
 46 };
 47 
 48 /**
 49  * struct sec_pmic_dev - s2m/s5m master device for sub-drivers
 50  * @dev:                Master device of the chip
 51  * @pdata:              Platform data populated with data from DTS
 52  *                      or board files
 53  * @regmap_pmic:        Regmap associated with PMIC's I2C address
 54  * @i2c:                I2C client of the main driver
 55  * @device_type:        Type of device, matches enum sec_device_type
 56  * @irq_base:           Base IRQ number for device, required for IRQs
 57  * @irq:                Generic IRQ number for device
 58  * @irq_data:           Runtime data structure for IRQ controller
 59  * @wakeup:             Whether or not this is a wakeup device
 60  */
 61 struct sec_pmic_dev {
 62         struct device *dev;
 63         struct sec_platform_data *pdata;
 64         struct regmap *regmap_pmic;
 65         struct i2c_client *i2c;
 66 
 67         unsigned long device_type;
 68         int irq;
 69         struct regmap_irq_chip_data *irq_data;
 70 };
 71 
 72 int sec_irq_init(struct sec_pmic_dev *sec_pmic);
 73 void sec_irq_exit(struct sec_pmic_dev *sec_pmic);
 74 int sec_irq_resume(struct sec_pmic_dev *sec_pmic);
 75 
 76 struct sec_platform_data {
 77         struct sec_regulator_data       *regulators;
 78         struct sec_opmode_data          *opmode;
 79         int                             num_regulators;
 80 
 81         int                             buck_gpios[3];
 82         int                             buck_ds[3];
 83         unsigned int                    buck2_voltage[8];
 84         bool                            buck2_gpiodvs;
 85         unsigned int                    buck3_voltage[8];
 86         bool                            buck3_gpiodvs;
 87         unsigned int                    buck4_voltage[8];
 88         bool                            buck4_gpiodvs;
 89 
 90         int                             buck_default_idx;
 91         int                             buck_ramp_delay;
 92 
 93         bool                            buck2_ramp_enable;
 94         bool                            buck3_ramp_enable;
 95         bool                            buck4_ramp_enable;
 96 
 97         int                             buck2_init;
 98         int                             buck3_init;
 99         int                             buck4_init;
100         /* Whether or not manually set PWRHOLD to low during shutdown. */
101         bool                            manual_poweroff;
102         /* Disable the WRSTBI (buck voltage warm reset) when probing? */
103         bool                            disable_wrstbi;
104 };
105 
106 /**
107  * sec_regulator_data - regulator data
108  * @id: regulator id
109  * @initdata: regulator init data (contraints, supplies, ...)
110  */
111 struct sec_regulator_data {
112         int                             id;
113         struct regulator_init_data      *initdata;
114         struct device_node              *reg_node;
115         struct gpio_desc                *ext_control_gpiod;
116 };
117 
118 /*
119  * sec_opmode_data - regulator operation mode data
120  * @id: regulator id
121  * @mode: regulator operation mode
122  */
123 struct sec_opmode_data {
124         int id;
125         unsigned int mode;
126 };
127 
128 /*
129  * samsung regulator operation mode
130  * SEC_OPMODE_OFF       Regulator always OFF
131  * SEC_OPMODE_ON        Regulator always ON
132  * SEC_OPMODE_LOWPOWER  Regulator is on in low-power mode
133  * SEC_OPMODE_SUSPEND   Regulator is changed by PWREN pin
134  *                      If PWREN is high, regulator is on
135  *                      If PWREN is low, regulator is off
136  */
137 
138 enum sec_opmode {
139         SEC_OPMODE_OFF,
140         SEC_OPMODE_ON,
141         SEC_OPMODE_LOWPOWER,
142         SEC_OPMODE_SUSPEND,
143 };
144 
145 #endif /*  __LINUX_MFD_SEC_CORE_H */
146 

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