diff options
Diffstat (limited to 'include/linux/mfd')
-rw-r--r-- | include/linux/mfd/ezx-pcap.h | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | include/linux/mfd/max8998-private.h | 141 | ||||
-rwxr-xr-x[-rw-r--r--] | include/linux/mfd/max8998.h | 34 | ||||
-rwxr-xr-x | include/linux/mfd/wm8994/wm8994_pdata.h | 24 |
4 files changed, 200 insertions, 0 deletions
diff --git a/include/linux/mfd/ezx-pcap.h b/include/linux/mfd/ezx-pcap.h index 40c37216..32a1b5c 100644 --- a/include/linux/mfd/ezx-pcap.h +++ b/include/linux/mfd/ezx-pcap.h @@ -16,6 +16,7 @@ struct pcap_subdev { struct pcap_platform_data { unsigned int irq_base; unsigned int config; + int gpio; void (*init) (void *); /* board specific init */ int num_subdevs; struct pcap_subdev *subdevs; diff --git a/include/linux/mfd/max8998-private.h b/include/linux/mfd/max8998-private.h index effa5d3..1877d15 100644..100755 --- a/include/linux/mfd/max8998-private.h +++ b/include/linux/mfd/max8998-private.h @@ -132,6 +132,147 @@ enum { #define MAX8998_ENRAMP (1 << 4) +/* IRQ1 */ +#define MAX8998_SHIFT_PWRONR 7 +#define MAX8998_SHIFT_PWRONF 6 +#define MAX8998_SHIFT_JIGR 5 +#define MAX8998_SHIFT_JIGF 4 +#define MAX8998_SHIFT_DCINR 3 +#define MAX8998_SHIFT_DCINF 2 + +#define MAX8998_MASK_PWRONR (0x1 << MAX8998_SHIFT_PWRONR) +#define MAX8998_MASK_PWRONF (0x1 << MAX8998_SHIFT_PWRONF) +#define MAX8998_MASK_JIGR (0x1 << MAX8998_SHIFT_JIGR) +#define MAX8998_MASK_JIGF (0x1 << MAX8998_SHIFT_JIGF) +#define MAX8998_MASK_DCINR (0x1 << MAX8998_SHIFT_DCINR) +#define MAX8998_MASK_DCINF (0x1 << MAX8998_SHIFT_DCINF) + +/* STATUS1 */ +#define MAX8998_SHIFT_ENDKEY 7 +#define MAX8998_SHIFT_JIGON 6 +#define MAX8998_SHIFT_ALARM0 5 +#define MAX8998_SHIFT_ALARM1 4 +#define MAX8998_SHIFT_SMPL 3 +#define MAX8998_SHIFT_WTSR 2 +#define MAX8998_SHIFT_LOWBAT2 1 +#define MAX8998_SHIFT_LOWBAT1 0 + +#define MAX8998_MASK_ENDKEY (0x1 << MAX8998_SHIFT_ENDKEY) +#define MAX8998_MASK_JIGON (0x1 << MAX8998_SHIFT_JIGON) +#define MAX8998_MASK_ALARM0 (0x1 << MAX8998_SHIFT_ALARM0) +#define MAX8998_MASK_ALARM1 (0x1 << MAX8998_SHIFT_ALARM1) +#define MAX8998_MASK_SMPL (0x1 << MAX8998_SHIFT_SMPL) +#define MAX8998_MASK_WTSR (0x1 << MAX8998_SHIFT_WTSR) +#define MAX8998_MASK_LOWBAT2 (0x1 << MAX8998_SHIFT_LOWBAT2) +#define MAX8998_MASK_LOWBAT1 (0x1 << MAX8998_SHIFT_LOWBAT1) + +/* STATUS2 */ +#define MAX8998_SHIFT_CHGDONE 6 +#define MAX8998_SHIFT_VDCIN 5 +#define MAX8998_SHIFT_DETBAT 4 +#define MAX8998_SHIFT_CHGON 3 +#define MAX8998_SHIFT_FCHG 2 +#define MAX8998_SHIFT_PQL 1 + +#define MAX8998_MASK_CHGDONE (0x1 << MAX8998_SHIFT_CHGDONE) +#define MAX8998_MASK_VDCIN (0x1 << MAX8998_SHIFT_VDCIN) +#define MAX8998_MASK_DETBAT (0x1 << MAX8998_SHIFT_DETBAT) +#define MAX8998_MASK_CHGON (0x1 << MAX8998_SHIFT_CHGON) +#define MAX8998_MASK_FCHG (0x1 << MAX8998_SHIFT_FCHG) +#define MAX8998_MASK_PQL (0x1 << MAX8998_SHIFT_PQL) + +/* CHGR1 */ +#define MAX8998_SHIFT_TOPOFF 5 +#define MAX8998_SHIFT_RSTR 3 +#define MAX8998_SHIFT_ICHG 0 + +#define MAX8998_MASK_TOPOFF (0x7 << MAX8998_SHIFT_TOPOFF) +#define MAX8998_MASK_RSTR (0x3 << MAX8998_SHIFT_RSTR) +#define MAX8998_MASK_ICHG (0x7 << MAX8998_SHIFT_ICHG) + +/* CHGR2 */ +#define MAX8998_SHIFT_ESAFEOUT 6 +#define MAX8998_SHIFT_FT 4 +#define MAX8998_SHIFT_BATTSL 3 +#define MAX8998_SHIFT_TMP 1 +#define MAX8998_SHIFT_CHGEN 0 + +#define MAX8998_MASK_ESAFEOUT (0x3 << MAX8998_SHIFT_ESAFEOUT) +#define MAX8998_MASK_FT (0x3 << MAX8998_SHIFT_FT) +#define MAX8998_MASK_BATTSL (0x1 << MAX8998_SHIFT_BATTSL) +#define MAX8998_MASK_TMP (0x3 << MAX8998_SHIFT_TMP) +#define MAX8998_MASK_CHGEN (0x1 << MAX8998_SHIFT_CHGEN) + +/* ONOFF1 */ +#define MAX8998_SHIFT_EN1 7 +#define MAX8998_SHIFT_EN2 6 +#define MAX8998_SHIFT_EN3 5 +#define MAX8998_SHIFT_EN4 4 +#define MAX8998_SHIFT_ELDO2 3 +#define MAX8998_SHIFT_ELDO3 2 +#define MAX8998_SHIFT_ELDO4 1 +#define MAX8998_SHIFT_ELDO5 0 + +#define MAX8998_MASK_EN1 (0x1 << MAX8998_SHIFT_EN1) +#define MAX8998_MASK_EN2 (0x1 << MAX8998_SHIFT_EN2) +#define MAX8998_MASK_EN3 (0x1 << MAX8998_SHIFT_EN3) +#define MAX8998_MASK_EN4 (0x1 << MAX8998_SHIFT_EN4) +#define MAX8998_MASK_ELDO2 (0x1 << MAX8998_SHIFT_ELDO2) +#define MAX8998_MASK_ELDO3 (0x1 << MAX8998_SHIFT_ELDO3) +#define MAX8998_MASK_ELDO4 (0x1 << MAX8998_SHIFT_ELDO4) +#define MAX8998_MASK_ELDO5 (0x1 << MAX8998_SHIFT_ELDO5) + +/* ONOFF2 */ +#define MAX8998_SHIFT_ELDO6 7 +#define MAX8998_SHIFT_ELDO7 6 +#define MAX8998_SHIFT_ELDO8 5 +#define MAX8998_SHIFT_ELDO9 4 +#define MAX8998_SHIFT_ELDO10 3 +#define MAX8998_SHIFT_ELDO11 2 +#define MAX8998_SHIFT_ELDO12 1 +#define MAX8998_SHIFT_ELDO13 0 + +#define MAX8998_MASK_ELDO6 (0x1 << MAX8998_SHIFT_ELDO6) +#define MAX8998_MASK_ELDO7 (0x1 << MAX8998_SHIFT_ELDO7) +#define MAX8998_MASK_ELDO8 (0x1 << MAX8998_SHIFT_ELDO8) +#define MAX8998_MASK_ELDO9 (0x1 << MAX8998_SHIFT_ELDO9) +#define MAX8998_MASK_ELDO10 (0x1 << MAX8998_SHIFT_ELDO10) +#define MAX8998_MASK_ELDO11 (0x1 << MAX8998_SHIFT_ELDO11) +#define MAX8998_MASK_ELDO12 (0x1 << MAX8998_SHIFT_ELDO12) +#define MAX8998_MASK_ELDO13 (0x1 << MAX8998_SHIFT_ELDO13) + +/* ONOFF3 */ +#define MAX8998_SHIFT_ELDO14 7 +#define MAX8998_SHIFT_ELDO15 6 +#define MAX8998_SHIFT_ELDO16 5 +#define MAX8998_SHIFT_ELDO17 4 +#define MAX8998_SHIFT_EPWRHOLD 3 +#define MAX8998_SHIFT_ENBATTMON 2 +#define MAX8998_SHIFT_ELBCNFG2 1 +#define MAX8998_SHIFT_ELBCNFG1 0 + +#define MAX8998_MASK_ELDO14 (0x1 << MAX8998_SHIFT_ELDO14) +#define MAX8998_MASK_ELDO15 (0x1 << MAX8998_SHIFT_ELDO15) +#define MAX8998_MASK_ELDO16 (0x1 << MAX8998_SHIFT_ELDO16) +#define MAX8998_MASK_ELDO17 (0x1 << MAX8998_SHIFT_ELDO17) +#define MAX8998_MASK_EPWRHOLD (0x1 << MAX8998_SHIFT_EPWRHOLD) +#define MAX8998_MASK_ENBATTMON (0x1 << MAX8998_SHIFT_ENBATTMON) +#define MAX8998_MASK_ELBCNFG2 (0x1 << MAX8998_SHIFT_ELBCNFG2) +#define MAX8998_MASK_ELBCNFG1 (0x1 << MAX8998_SHIFT_ELBCNFG1) + +/* ONOFF4 */ +#define MAX8998_SHIFT_EN32KHZAP 7 +#define MAX8998_SHIFT_EN32KHZCP 6 +#define MAX8998_SHIFT_ENVICHG 5 +#define MAX8998_SHIFT_ENRAMP 4 +#define MAX8998_SHIFT_RAMP 0 + +#define MAX8998_MASK_EN32KHZAP (0x1 << MAX8998_SHIFT_EN32KHZAP) +#define MAX8998_MASK_EN32KHZCP (0x1 << MAX8998_SHIFT_EN32KHZCP) +#define MAX8998_MASK_ENVICHG (0x1 << MAX8998_SHIFT_ENVICHG) +#define MAX8998_MASK_ENRAMP (0x1 << MAX8998_SHIFT_ENRAMP) +#define MAX8998_MASK_RAMP (0xF << MAX8998_SHIFT_RAMP) + /** * struct max8998_dev - max8998 master device for sub-drivers * @dev: master device of the chip (can be used to access platform data) diff --git a/include/linux/mfd/max8998.h b/include/linux/mfd/max8998.h index 61daa16..67db8b6 100644..100755 --- a/include/linux/mfd/max8998.h +++ b/include/linux/mfd/max8998.h @@ -64,6 +64,39 @@ struct max8998_regulator_data { struct regulator_init_data *initdata; }; +enum cable_type_t { + CABLE_TYPE_NONE = 0, + CABLE_TYPE_USB, + CABLE_TYPE_AC, +}; + +/** + * max8998_adc_table_data + * @adc_value : max8998 adc value + * @temperature : temperature(C) * 10 + */ +struct max8998_adc_table_data { + int adc_value; + int temperature; +}; +struct max8998_charger_callbacks { + void (*set_cable)(struct max8998_charger_callbacks *ptr, + enum cable_type_t status); +}; + +/** + * max8998_charger_data - charger data + * @id: charger id + * @initdata: charger init data (contraints, supplies, ...) + * @adc_table: adc_table must be ascending adc value order + */ +struct max8998_charger_data { + struct power_supply *psy_fuelgauge; + void (*register_callbacks)(struct max8998_charger_callbacks *ptr); + struct max8998_adc_table_data *adc_table; + int adc_array_size; +}; + /** * struct max8998_board - packages regulator init data * @regulators: array of defined regulators @@ -107,6 +140,7 @@ struct max8998_platform_data { int buck2_default_idx; bool wakeup; bool rtc_delay; + struct max8998_charger_data *charger; }; #endif /* __LINUX_MFD_MAX8998_H */ diff --git a/include/linux/mfd/wm8994/wm8994_pdata.h b/include/linux/mfd/wm8994/wm8994_pdata.h new file mode 100755 index 0000000..d79a7cc --- /dev/null +++ b/include/linux/mfd/wm8994/wm8994_pdata.h @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 Samsung Electronics, Inc. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef __S5PC110_WM8994_H +#define __S5PC110_WM8994_H + +struct wm8994_platform_data { + int ldo; + int ear_sel; + void (*set_mic_bias)(bool on); +}; + +#endif |