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

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

Version: ~ [ linux-5.4-rc7 ] ~ [ linux-5.3.11 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.84 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.154 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.201 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.201 ] ~ [ 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.77 ] ~ [ 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 #define NUM_IRQ_REGS    4
 18 
 19 enum sec_device_type {
 20         S5M8751X,
 21         S5M8763X,
 22         S5M8767X,
 23         S2MPS11X,
 24 };
 25 
 26 /**
 27  * struct sec_pmic_dev - s5m87xx master device for sub-drivers
 28  * @dev: master device of the chip (can be used to access platform data)
 29  * @i2c: i2c client private data for regulator
 30  * @rtc: i2c client private data for rtc
 31  * @iolock: mutex for serializing io access
 32  * @irqlock: mutex for buslock
 33  * @irq_base: base IRQ number for sec-pmic, required for IRQs
 34  * @irq: generic IRQ number for s5m87xx
 35  * @ono: power onoff IRQ number for s5m87xx
 36  * @irq_masks_cur: currently active value
 37  * @irq_masks_cache: cached hardware value
 38  * @type: indicate which s5m87xx "variant" is used
 39  */
 40 struct sec_pmic_dev {
 41         struct device *dev;
 42         struct regmap *regmap;
 43         struct i2c_client *i2c;
 44         struct i2c_client *rtc;
 45         struct mutex iolock;
 46         struct mutex irqlock;
 47 
 48         int device_type;
 49         int irq_base;
 50         int irq;
 51         struct regmap_irq_chip_data *irq_data;
 52 
 53         int ono;
 54         u8 irq_masks_cur[NUM_IRQ_REGS];
 55         u8 irq_masks_cache[NUM_IRQ_REGS];
 56         int type;
 57         bool wakeup;
 58 };
 59 
 60 int sec_irq_init(struct sec_pmic_dev *sec_pmic);
 61 void sec_irq_exit(struct sec_pmic_dev *sec_pmic);
 62 int sec_irq_resume(struct sec_pmic_dev *sec_pmic);
 63 
 64 extern int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest);
 65 extern int sec_bulk_read(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf);
 66 extern int sec_reg_write(struct sec_pmic_dev *sec_pmic, u8 reg, u8 value);
 67 extern int sec_bulk_write(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf);
 68 extern int sec_reg_update(struct sec_pmic_dev *sec_pmic, u8 reg, u8 val, u8 mask);
 69 
 70 struct sec_platform_data {
 71         struct sec_regulator_data       *regulators;
 72         struct sec_opmode_data          *opmode;
 73         int                             device_type;
 74         int                             num_regulators;
 75 
 76         int                             irq_base;
 77         int                             (*cfg_pmic_irq)(void);
 78 
 79         int                             ono;
 80         bool                            wakeup;
 81         bool                            buck_voltage_lock;
 82 
 83         int                             buck_gpios[3];
 84         int                             buck_ds[3];
 85         int                             buck2_voltage[8];
 86         bool                            buck2_gpiodvs;
 87         int                             buck3_voltage[8];
 88         bool                            buck3_gpiodvs;
 89         int                             buck4_voltage[8];
 90         bool                            buck4_gpiodvs;
 91 
 92         int                             buck_set1;
 93         int                             buck_set2;
 94         int                             buck_set3;
 95         int                             buck2_enable;
 96         int                             buck3_enable;
 97         int                             buck4_enable;
 98         int                             buck_default_idx;
 99         int                             buck2_default_idx;
100         int                             buck3_default_idx;
101         int                             buck4_default_idx;
102 
103         int                             buck_ramp_delay;
104 
105         int                             buck2_ramp_delay;
106         int                             buck34_ramp_delay;
107         int                             buck5_ramp_delay;
108         int                             buck16_ramp_delay;
109         int                             buck7810_ramp_delay;
110         int                             buck9_ramp_delay;
111 
112         bool                            buck2_ramp_enable;
113         bool                            buck3_ramp_enable;
114         bool                            buck4_ramp_enable;
115         bool                            buck6_ramp_enable;
116 
117         int                             buck2_init;
118         int                             buck3_init;
119         int                             buck4_init;
120 };
121 
122 /**
123  * sec_regulator_data - regulator data
124  * @id: regulator id
125  * @initdata: regulator init data (contraints, supplies, ...)
126  */
127 struct sec_regulator_data {
128         int                             id;
129         struct regulator_init_data      *initdata;
130 };
131 
132 /*
133  * sec_opmode_data - regulator operation mode data
134  * @id: regulator id
135  * @mode: regulator operation mode
136  */
137 struct sec_opmode_data {
138         int id;
139         int mode;
140 };
141 
142 /*
143  * samsung regulator operation mode
144  * SEC_OPMODE_OFF       Regulator always OFF
145  * SEC_OPMODE_ON        Regulator always ON
146  * SEC_OPMODE_LOWPOWER  Regulator is on in low-power mode
147  * SEC_OPMODE_SUSPEND   Regulator is changed by PWREN pin
148  *                      If PWREN is high, regulator is on
149  *                      If PWREN is low, regulator is off
150  */
151 
152 enum sec_opmode {
153         SEC_OPMODE_OFF,
154         SEC_OPMODE_ON,
155         SEC_OPMODE_LOWPOWER,
156         SEC_OPMODE_SUSPEND,
157 };
158 
159 #endif /*  __LINUX_MFD_SEC_CORE_H */
160 

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