From 0fb9e212097a65764d37cdca6ca34b6c5d478ed3 Mon Sep 17 00:00:00 2001 From: Robby Cai Date: Fri, 1 Apr 2011 17:08:28 +0800 Subject: ENGR00141425-1 MX50: Restruct PMIC framework to accept new PMIC Ripley - make MC13892 and MC34708 can co-exist, only one attached at run-time. - make the change as least as possible. - expect no functional impact (only SPI interface verified). Signed-off-by: Robby Cai (cherry picked from commit fb123eee8b22774f491c0123cf4b6fb2befdd3e6) --- include/linux/mfd/mc13892/core.h | 27 ++++++++++++++++++--------- include/linux/pmic_adc.h | 31 ++++++++++++++++++++++--------- include/linux/pmic_external.h | 30 +++++++++++++++++++++--------- 3 files changed, 61 insertions(+), 27 deletions(-) (limited to 'include') diff --git a/include/linux/mfd/mc13892/core.h b/include/linux/mfd/mc13892/core.h index 3924e2e3bce9..d4a141c4b4f3 100644 --- a/include/linux/mfd/mc13892/core.h +++ b/include/linux/mfd/mc13892/core.h @@ -1,14 +1,19 @@ /* - * Copyright 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. - */ - -/* - * The code contained herein is licensed under the GNU General Public - * License. You may obtain a copy of the GNU General Public License - * Version 2 or later at the following locations: + * Copyright 2009-2011 Freescale Semiconductor, Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * 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. * - * http://www.opensource.org/licenses/gpl-license.html - * http://www.gnu.org/copyleft/gpl.html + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __LINUX_MFD_MC13892_CORE_H_ @@ -17,6 +22,7 @@ #include #include #include +#include #define MC13892_SW1 0 #define MC13892_SW2 1 @@ -74,4 +80,7 @@ struct mc13892 { int mc13892_register_regulator(struct mc13892 *mc13892, int reg, struct regulator_init_data *initdata); +void *mc13892_alloc_data(struct device *dev); +int mc13892_init_registers(void); +void mc13892_get_revision(pmic_version_t *ver); #endif diff --git a/include/linux/pmic_adc.h b/include/linux/pmic_adc.h index a0c659989ab2..86d272fdafc0 100644 --- a/include/linux/pmic_adc.h +++ b/include/linux/pmic_adc.h @@ -1,14 +1,19 @@ /* - * Copyright 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved. - */ - -/* - * The code contained herein is licensed under the GNU Lesser General - * Public License. You may obtain a copy of the GNU Lesser General - * Public License Version 2.1 or later at the following locations: + * Copyright 2004-2011 Freescale Semiconductor, Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * http://www.opensource.org/licenses/lgpl-license.html - * http://www.gnu.org/copyleft/lgpl.html + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __ASM_ARCH_MXC_PMIC_ADC_H__ @@ -289,6 +294,12 @@ typedef struct { t_comparator_cb callback; } t_adc_comp_param; +struct pmic_adc_api { + int (*is_pmic_adc_ready)(void); + PMIC_STATUS (*pmic_adc_convert)(t_channel, unsigned short *); + PMIC_STATUS (*pmic_adc_get_touch_sample)(t_touch_screen *, int); +}; + /* EXPORTED FUNCTIONS */ #ifdef __KERNEL__ @@ -451,5 +462,7 @@ PMIC_STATUS pmic_adc_remove_ts(void); int is_pmic_adc_ready(void); +void register_adc_apis(struct pmic_adc_api *papi); + #endif /* _KERNEL */ #endif /* __ASM_ARCH_MXC_PMIC_ADC_H__ */ diff --git a/include/linux/pmic_external.h b/include/linux/pmic_external.h index 23aa37e1bfa2..0ea60e5abab2 100644 --- a/include/linux/pmic_external.h +++ b/include/linux/pmic_external.h @@ -1,15 +1,21 @@ /* - * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved. - */ - -/* - * The code contained herein is licensed under the GNU General Public - * License. You may obtain a copy of the GNU General Public License - * Version 2 or later at the following locations: + * Copyright 2008-2011 Freescale Semiconductor, Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * http://www.opensource.org/licenses/gpl-license.html - * http://www.gnu.org/copyleft/gpl.html + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #ifndef __ASM_ARCH_MXC_PMIC_EXTERNAL_H__ #define __ASM_ARCH_MXC_PMIC_EXTERNAL_H__ @@ -35,6 +41,7 @@ #include #include +#include /*! * This is the enumeration of versions of PMIC @@ -423,6 +430,11 @@ PMIC_STATUS pmic_get_sensors(t_sensor_bits *sensor_bits); void pmic_event_callback(type_event event); void pmic_event_list_init(void); +unsigned int pmic_get_active_events(unsigned int *active_events); +int pmic_event_mask(type_event event); +int pmic_event_unmask(type_event event); +int pmic_spi_setup(struct spi_device *spi); + #endif /*CONFIG_MXC_PMIC*/ #endif /* __KERNEL__ */ /* CONFIG_MXC_PMIC_MC13783 || CONFIG_MXC_PMIC_MC9SDZ60 */ -- cgit v1.2.3