summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorXinyu Chen <b03824@freescale.com>2012-02-10 15:58:02 +0800
committerXinyu Chen <b03824@freescale.com>2012-02-10 16:49:46 +0800
commit744ea7c82fb1e4d47528baf09fd6b635f5e862c3 (patch)
tree8dfab61f4f5bc19146ba5f6f2ee73d9ed74a73e6 /arch
parent5dc82fc25041cedfe1a656ec2e8589e5adfed542 (diff)
ENGR00174229-1 mx6q sabresd: add sensors devices
Add 3-axis accelerometer (mma8451) device. Add Digital Magnetometer (mag3110) device. Add Ambient Light sensor (isl29023) device. Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-mx6/board-mx6q_sabresd.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/arch/arm/mach-mx6/board-mx6q_sabresd.c b/arch/arm/mach-mx6/board-mx6q_sabresd.c
index 1121feacc72b..1948600f0e13 100644
--- a/arch/arm/mach-mx6/board-mx6q_sabresd.c
+++ b/arch/arm/mach-mx6/board-mx6q_sabresd.c
@@ -91,9 +91,14 @@
#define MX6Q_SABRESD_MIPICSI_RST IMX_GPIO_NR(1, 20)
#define MX6Q_SABRESD_MIPICSI_PWN IMX_GPIO_NR(1, 19)
#define MX6Q_SABRESD_AUX_5V_EN IMX_GPIO_NR(6, 10)
+#define MX6Q_SABRESD_SENSOR_EN IMX_GPIO_NR(2, 31)
+#define MX6Q_SABRESD_eCOMPASS_INT IMX_GPIO_NR(3, 16)
+#define MX6Q_SABRESD_ALS_INT IMX_GPIO_NR(3, 9)
void __init early_console_setup(unsigned long base, struct clk *clk);
static struct clk *sata_clk;
+static int mma8451_position = 3;
+static int mag3110_position;
extern char *gp_reg_id;
@@ -123,7 +128,6 @@ static iomux_v3_cfg_t mx6q_sabresd_pads[] = {
/* ECSPI1 */
MX6Q_PAD_EIM_D17__ECSPI1_MISO,
MX6Q_PAD_EIM_D18__ECSPI1_MOSI,
- MX6Q_PAD_EIM_D16__ECSPI1_SCLK,
MX6Q_PAD_EIM_D19__GPIO_3_19, /*SS1*/
/* ENET */
@@ -188,6 +192,9 @@ static iomux_v3_cfg_t mx6q_sabresd_pads[] = {
MX6Q_PAD_GPIO_4__GPIO_1_4, /* Volume Up */
MX6Q_PAD_GPIO_5__GPIO_1_5, /* Volume Down */
+ /* eCompass int */
+ MX6Q_PAD_EIM_D16__GPIO_3_16,
+
/* GPIO5 */
MX6Q_PAD_EIM_WAIT__GPIO_5_0, /* J12 - Boot Mode Select */
MX6Q_PAD_EIM_A24__GPIO_5_4, /* J12 - Boot Mode Select */
@@ -568,6 +575,10 @@ static struct imxi2c_platform_data mx6q_sabresd_i2c_data = {
.bitrate = 100000,
};
+static struct fsl_mxc_lightsensor_platform_data ls_data = {
+ .rext = 499, /* calibration: 499K->700K */
+};
+
static struct i2c_board_info mxc_i2c0_board_info[] __initdata = {
{
I2C_BOARD_INFO("sgtl5000", 0x0a),
@@ -576,6 +587,10 @@ static struct i2c_board_info mxc_i2c0_board_info[] __initdata = {
I2C_BOARD_INFO("ov5642", 0x3c),
.platform_data = (void *)&camera_data,
},
+ {
+ I2C_BOARD_INFO("mma8451", 0x1c),
+ .platform_data = (void *)&mma8451_position,
+ },
};
static struct i2c_board_info mxc_i2c1_board_info[] __initdata = {
@@ -597,6 +612,16 @@ static struct i2c_board_info mxc_i2c2_board_info[] __initdata = {
I2C_BOARD_INFO("egalax_ts", 0x4),
.irq = gpio_to_irq(MX6Q_SABRESD_CAP_TCH_INT1),
},
+ {
+ I2C_BOARD_INFO("mag3110", 0x0e),
+ .irq = gpio_to_irq(MX6Q_SABRESD_eCOMPASS_INT),
+ .platform_data = (void *)&mag3110_position,
+ },
+ {
+ I2C_BOARD_INFO("isl29023", 0x44),
+ .irq = gpio_to_irq(MX6Q_SABRESD_ALS_INT),
+ .platform_data = &ls_data,
+ },
};
static void imx6q_sabresd_usbotg_vbus(bool on)
@@ -1083,15 +1108,28 @@ static void __init mx6_sabresd_board_init(void)
imx6q_add_dvfs_core(&sabresd_dvfscore_data);
mx6_cpu_regulator_init();
+ /* enable sensor 3v3 and 1v8 */
+ gpio_request(MX6Q_SABRESD_SENSOR_EN, "sensor-en");
+ gpio_direction_output(MX6Q_SABRESD_SENSOR_EN, 1);
+
+ /* enable ecompass intr */
+ gpio_request(MX6Q_SABRESD_eCOMPASS_INT, "ecompass-int");
+ gpio_direction_input(MX6Q_SABRESD_eCOMPASS_INT);
+ /* enable light sensor intr */
+ gpio_request(MX6Q_SABRESD_ALS_INT, "als-int");
+ gpio_direction_input(MX6Q_SABRESD_ALS_INT);
+
imx6q_add_hdmi_soc();
imx6q_add_hdmi_soc_dai();
+ /*
ret = gpio_request_array(mx6q_sabresd_flexcan_gpios,
ARRAY_SIZE(mx6q_sabresd_flexcan_gpios));
if (ret)
pr_err("failed to request flexcan1-gpios: %d\n", ret);
else
imx6q_add_flexcan0(&mx6q_sabresd_flexcan0_pdata);
+ */
clko2 = clk_get(NULL, "clko2_clk");
if (IS_ERR(clko2))