summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorZhou Jingyu <b02241@freescale.com>2009-04-15 10:59:07 +0800
committerZhou Jingyu <b02241@freescale.com>2009-04-17 10:03:29 +0800
commit6ca381c0a414e9b352216b4ed149b1a2dc8a1243 (patch)
tree86cc33d7f8f0dd052649d51a2ff97e09ba2d7997 /include
parent3217b4533e3e5c5bcd51ffda7396c9fec8f19c43 (diff)
ENGR00110363 MX35: MCU-PMIC driver porting to 2.6.28
MX35: MCU-PMIC driver porting to 2.6.28 Signed-off-by: Zhou Jingyu <Jingyu.Zhou@freescale.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mfd/mc9s08dz60/core.h59
-rw-r--r--include/linux/mfd/mc9s08dz60/pmic.h82
2 files changed, 141 insertions, 0 deletions
diff --git a/include/linux/mfd/mc9s08dz60/core.h b/include/linux/mfd/mc9s08dz60/core.h
new file mode 100644
index 000000000000..ecc1806c0f90
--- /dev/null
+++ b/include/linux/mfd/mc9s08dz60/core.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2009 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:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#ifndef __LINUX_MFD_MC13892_CORE_H_
+#define __LINUX_MFD_MC13892_CORE_H_
+
+#include <linux/kernel.h>
+#include <linux/mutex.h>
+#include <linux/workqueue.h>
+
+#define MC9S08DZ60_LCD 0
+#define MC9S08DZ60_WIFI 1
+#define MC9S08DZ60_HDD 2
+#define MC9S08DZ60_GPS 3
+#define MC9S08DZ60_SPKR 4
+#define MC9S08DZ60_REG_NUM 5
+
+struct mc9s08dz60;
+struct regulator_init_data;
+
+struct mc9s08dz60_platform_data {
+ int (*init)(struct mc9s08dz60 *);
+};
+
+struct mc9s08dz60_pmic {
+ /* regulator devices */
+ struct platform_device *pdev[MC9S08DZ60_REG_NUM];
+};
+
+struct mc9s08dz60 {
+ int rev; /* chip revision */
+
+ struct device *dev;
+
+ /* device IO */
+ union {
+ struct i2c_client *i2c_client;
+ struct spi_device *spi_device;
+ };
+ u16 *reg_cache;
+
+ /* Client devices */
+ struct mc9s08dz60_pmic pmic;
+};
+
+int mc9s08dz60_register_regulator(struct mc9s08dz60 *mc9s08dz60, int reg,
+ struct regulator_init_data *initdata);
+
+#endif
diff --git a/include/linux/mfd/mc9s08dz60/pmic.h b/include/linux/mfd/mc9s08dz60/pmic.h
new file mode 100644
index 000000000000..c1218ad7ebc0
--- /dev/null
+++ b/include/linux/mfd/mc9s08dz60/pmic.h
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2009 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:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+
+#ifndef __LINUX_MCU_PMIC_H_
+#define __LINUX_MCU_PMIC_H_
+
+enum {
+
+ /*reg names for mcu */
+ REG_MCU_VERSION = 0,
+ REG_MCU_SECS,
+ REG_MCU_MINS,
+ REG_MCU_HRS,
+ REG_MCU_DAY,
+ REG_MCU_DATE,
+ REG_MCU_MONTH,
+ REG_MCU_YEAR,
+ REG_MCU_ALARM_SECS,
+ REG_MCU_ALARM_MINS,
+ REG_MCU_ALARM_HRS,
+ REG_MCU_TS_CONTROL,
+ REG_MCU_X_LOW,
+ REG_MCU_Y_LOW,
+ REG_MCU_XY_HIGH,
+ REG_MCU_X_LEFT_LOW,
+ REG_MCU_X_LEFT_HIGH,
+ REG_MCU_X_RIGHT,
+ REG_MCU_Y_TOP_LOW,
+ REG_MCU_Y_TOP_HIGH,
+ REG_MCU_Y_BOTTOM,
+ REG_MCU_RESET_1,
+ REG_MCU_RESET_2,
+ REG_MCU_POWER_CTL,
+ REG_MCU_DELAY_CONFIG,
+ REG_MCU_GPIO_1,
+ REG_MCU_GPIO_2,
+ REG_MCU_KPD_1,
+ REG_MCU_KPD_2,
+ REG_MCU_KPD_CONTROL,
+ REG_MCU_INT_ENABLE_1,
+ REG_MCU_INT_ENABLE_2,
+ REG_MCU_INT_FLAG_1,
+ REG_MCU_INT_FLAG_2,
+ REG_MCU_DES_FLAG,
+};
+
+enum {
+
+ MCU_GPIO_REG_RESET_1,
+ MCU_GPIO_REG_RESET_2,
+ MCU_GPIO_REG_POWER_CONTROL,
+ MCU_GPIO_REG_GPIO_CONTROL_1,
+ MCU_GPIO_REG_GPIO_CONTROL_2,
+};
+
+int pmic_gpio_set_bit_val(int reg, unsigned int bit,
+ unsigned int val);
+
+int pmic_gpio_get_bit_val(int reg, unsigned int bit,
+ unsigned int *val);
+
+int pmic_gpio_get_designation_bit_val(unsigned int bit,
+ unsigned int *val);
+
+
+int mcu_pmic_read_reg(int reg, unsigned int *reg_value,
+ unsigned int reg_mask);
+
+int mcu_pmic_write_reg(int reg, unsigned int reg_value,
+ unsigned int reg_mask);
+#endif