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

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

Version: ~ [ linux-5.6 ] ~ [ linux-5.5.13 ] ~ [ linux-5.4.28 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.113 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.174 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.217 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.217 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.82 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ 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  * core.h
  3  *
  4  * copyright (c) 2011 Samsung Electronics Co., Ltd
  5  *              http://www.samsung.com
  6  *
  7  *  This program is free software; you can redistribute  it and/or modify it
  8  *  under  the terms of  the GNU General  Public License as published by the
  9  *  Free Software Foundation;  either version 2 of the  License, or (at your
 10  *  option) any later version.
 11  *
 12  */
 13 
 14 #ifndef __LINUX_MFD_SEC_CORE_H
 15 #define __LINUX_MFD_SEC_CORE_H
 16 
 17 enum sec_device_type {
 18         S5M8751X,
 19         S5M8763X,
 20         S5M8767X,
 21         S2MPS11X,
 22 };
 23 
 24 /**
 25  * struct sec_pmic_dev - s5m87xx master device for sub-drivers
 26  * @dev: master device of the chip (can be used to access platform data)
 27  * @pdata: pointer to private data used to pass platform data to child
 28  * @i2c: i2c client private data for regulator
 29  * @rtc: i2c client private data for rtc
 30  * @iolock: mutex for serializing io access
 31  * @irqlock: mutex for buslock
 32  * @irq_base: base IRQ number for sec-pmic, required for IRQs
 33  * @irq: generic IRQ number for s5m87xx
 34  * @ono: power onoff IRQ number for s5m87xx
 35  * @irq_masks_cur: currently active value
 36  * @irq_masks_cache: cached hardware value
 37  * @type: indicate which s5m87xx "variant" is used
 38  */
 39 struct sec_pmic_dev {
 40         struct device *dev;
 41         struct sec_platform_data *pdata;
 42         struct regmap *regmap;
 43         struct i2c_client *i2c;
 44         struct i2c_client *rtc;
 45 
 46         int device_type;
 47         int irq_base;
 48         int irq;
 49         struct regmap_irq_chip_data *irq_data;
 50 
 51         int ono;
 52         int type;
 53         bool wakeup;
 54 };
 55 
 56 int sec_irq_init(struct sec_pmic_dev *sec_pmic);
 57 void sec_irq_exit(struct sec_pmic_dev *sec_pmic);
 58 int sec_irq_resume(struct sec_pmic_dev *sec_pmic);
 59 
 60 extern int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest);
 61 extern int sec_bulk_read(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf);
 62 extern int sec_reg_write(struct sec_pmic_dev *sec_pmic, u8 reg, u8 value);
 63 extern int sec_bulk_write(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf);
 64 extern int sec_reg_update(struct sec_pmic_dev *sec_pmic, u8 reg, u8 val, u8 mask);
 65 
 66 struct sec_platform_data {
 67         struct sec_regulator_data       *regulators;
 68         struct sec_opmode_data          *opmode;
 69         int                             device_type;
 70         int                             num_regulators;
 71 
 72         int                             irq_base;
 73         int                             (*cfg_pmic_irq)(void);
 74 
 75         int                             ono;
 76         bool                            wakeup;
 77         bool                            buck_voltage_lock;
 78 
 79         int                             buck_gpios[3];
 80         int                             buck_ds[3];
 81         unsigned int                    buck2_voltage[8];
 82         bool                            buck2_gpiodvs;
 83         unsigned int                    buck3_voltage[8];
 84         bool                            buck3_gpiodvs;
 85         unsigned int                    buck4_voltage[8];
 86         bool                            buck4_gpiodvs;
 87 
 88         int                             buck_set1;
 89         int                             buck_set2;
 90         int                             buck_set3;
 91         int                             buck2_enable;
 92         int                             buck3_enable;
 93         int                             buck4_enable;
 94         int                             buck_default_idx;
 95         int                             buck2_default_idx;
 96         int                             buck3_default_idx;
 97         int                             buck4_default_idx;
 98 
 99         int                             buck_ramp_delay;
100 
101         int                             buck2_ramp_delay;
102         int                             buck34_ramp_delay;
103         int                             buck5_ramp_delay;
104         int                             buck16_ramp_delay;
105         int                             buck7810_ramp_delay;
106         int                             buck9_ramp_delay;
107 
108         bool                            buck2_ramp_enable;
109         bool                            buck3_ramp_enable;
110         bool                            buck4_ramp_enable;
111         bool                            buck6_ramp_enable;
112 
113         int                             buck2_init;
114         int                             buck3_init;
115         int                             buck4_init;
116 };
117 
118 /**
119  * sec_regulator_data - regulator data
120  * @id: regulator id
121  * @initdata: regulator init data (contraints, supplies, ...)
122  */
123 struct sec_regulator_data {
124         int                             id;
125         struct regulator_init_data      *initdata;
126         struct device_node *reg_node;
127 };
128 
129 /*
130  * sec_opmode_data - regulator operation mode data
131  * @id: regulator id
132  * @mode: regulator operation mode
133  */
134 struct sec_opmode_data {
135         int id;
136         unsigned int mode;
137 };
138 
139 /*
140  * samsung regulator operation mode
141  * SEC_OPMODE_OFF       Regulator always OFF
142  * SEC_OPMODE_ON        Regulator always ON
143  * SEC_OPMODE_LOWPOWER  Regulator is on in low-power mode
144  * SEC_OPMODE_SUSPEND   Regulator is changed by PWREN pin
145  *                      If PWREN is high, regulator is on
146  *                      If PWREN is low, regulator is off
147  */
148 
149 enum sec_opmode {
150         SEC_OPMODE_OFF,
151         SEC_OPMODE_ON,
152         SEC_OPMODE_LOWPOWER,
153         SEC_OPMODE_SUSPEND,
154 };
155 
156 #endif /*  __LINUX_MFD_SEC_CORE_H */
157 

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