* author: hhb@rock-chips.com
*****************************************************************************************/
#if defined(CONFIG_TOUCHSCREEN_XPT2046_NORMAL_SPI) || defined(CONFIG_TOUCHSCREEN_XPT2046_TSLIB_SPI)
-#define XPT2046_GPIO_INT RK30_PIN6_PB7
+#define XPT2046_GPIO_INT RK30_PIN4_PC2
#define DEBOUNCE_REPTIME 3
.debounce_rep = DEBOUNCE_REPTIME,
.debounce_tol = 20,
.gpio_pendown = XPT2046_GPIO_INT,
- .pendown_iomux_name = GPIO6B7_TESTCLOCKOUT_NAME,
- .pendown_iomux_mode = GPIO6B_GPIO6B7,
+ .pendown_iomux_name = GPIO4C2_SMCDATA2_TRACEDATA2_NAME,
+ .pendown_iomux_mode = GPIO4C_GPIO4C2,
.touch_virtualkey_length = 60,
.penirq_recheck_delay_usecs = 1,
#if defined(CONFIG_TOUCHSCREEN_480X800)
.debounce_rep = DEBOUNCE_REPTIME,
.debounce_tol = 20,
.gpio_pendown = XPT2046_GPIO_INT,
- .pendown_iomux_name = GPIO6B7_TESTCLOCKOUT_NAME,
- .pendown_iomux_mode = GPIO6B_GPIO6B7,
+ .pendown_iomux_name = GPIO4C2_SMCDATA2_TRACEDATA2_NAME,
+ .pendown_iomux_mode = GPIO4C_GPIO4C2,
.touch_virtualkey_length = 60,
.penirq_recheck_delay_usecs = 1,
{
.modalias = "xpt2046_ts",
.chip_select = 1,// 2,
- .max_speed_hz = 1 * 1000 * 1000,/* (max sample rate @ 3V) * (cmd + data + overhead) */
+ .max_speed_hz = 1 * 1000 * 800,/* (max sample rate @ 3V) * (cmd + data + overhead) */
.bus_num = 0,
.irq = XPT2046_GPIO_INT,
.platform_data = &xpt2046_info,
#endif
+/*MMA8452 gsensor*/
+#if defined (CONFIG_GS_MMA8452)
+#define MMA8452_INT_PIN RK30_PIN4_PC0
+static int mma8452_init_platform_hw(void)
+{
+ rk30_mux_api_set(GPIO4C0_SMCDATA0_TRACEDATA0_NAME, GPIO4C_GPIO4C0);
+
+ if(gpio_request(MMA8452_INT_PIN,NULL) != 0){
+ gpio_free(MMA8452_INT_PIN);
+ printk("mma8452_init_platform_hw gpio_request error\n");
+ return -EIO;
+ }
+ gpio_pull_updown(MMA8452_INT_PIN, 1);
+ return 0;
+}
+
+
+static struct mma8452_platform_data mma8452_info = {
+ .model= 8452,
+ .swap_xy = 0,
+ .swap_xyz = 1,
+ .init_platform_hw= mma8452_init_platform_hw,
+ .orientation = { -1, 0, 0, 0, 0, 1, 0, -1, 0},
+};
+#endif
static struct platform_device *devices[] __initdata = {
// i2c
#ifdef CONFIG_I2C0_RK30
static struct i2c_board_info __initdata i2c0_info[] = {
+#if defined (CONFIG_GS_MMA8452)
+ {
+ .type = "gs_mma8452",
+ .addr = 0x1c,
+ .flags = 0,
+ .irq = MMA8452_INT_PIN,
+ .platform_data = &mma8452_info,
+ },
+#endif
+
};
#endif
#ifdef CONFIG_HAS_EARLYSUSPEND
static struct early_suspend mma8452_early_suspend;
#endif
-static int revision = -1;
+//static int revision = -1;
static const char* vendor = "Freescale Semiconductor";
return ret;
}
+#if 0
static int mma8452_start_test(struct i2c_client *client)
{
int ret = 0;
return ret;
}
+#endif
static int mma8452_start_dev(struct i2c_client *client, char rate)
{
#else
static int mma8452_suspend(struct i2c_client *client, pm_message_t mesg)
{
- int ret;
+ int ret = 0;
+ //struct mma8452_data *mma8452 = (struct mma8452_data *)i2c_get_clientdata(client);
mmaprintkd("Gsensor mma7760 enter 2 level suspend mma8452->status %d\n",mma8452->status);
- struct mma8452_data *mma8452 = (struct mma8452_data *)i2c_get_clientdata(client);
// if(mma8452->status == MMA8452_OPEN)
// {
// mma8452->status = MMA8452_SUSPEND;
}
static int mma8452_resume(struct i2c_client *client)
{
- int ret;
- struct mma8452_data *mma8452 = (struct mma8452_data *)i2c_get_clientdata(client);
+ int ret = 0;
+ //struct mma8452_data *mma8452 = (struct mma8452_data *)i2c_get_clientdata(client);
mmaprintkd("Gsensor mma7760 2 level resume!! mma8452->status %d\n",mma8452->status);
// if((mma8452->status == MMA8452_SUSPEND) && (mma8452->status != MMA8452_OPEN))
//if (mma8452->status == MMA8452_OPEN)
goto exit_input_register_device_failed;
}
- mma8452_device.parent = &client->dev;
+ mma8452_device.parent = &client->dev;
err = misc_register(&mma8452_device);
if (err < 0) {
mmaprintk(KERN_ERR
}
#ifdef CONFIG_HAS_EARLYSUSPEND
- mma8452_early_suspend.suspend = mma8452_suspend;
- mma8452_early_suspend.resume = mma8452_resume;
- mma8452_early_suspend.level = 0x2;
- register_early_suspend(&mma8452_early_suspend);
+ mma8452_early_suspend.suspend = mma8452_suspend;
+ mma8452_early_suspend.resume = mma8452_resume;
+ mma8452_early_suspend.level = 0x2;
+ register_early_suspend(&mma8452_early_suspend);
#endif
printk(KERN_INFO "mma8452 probe ok\n");
return 0;
exit_gsensor_sysfs_init_failed:
- misc_deregister(&mma8452_device);
+ misc_deregister(&mma8452_device);
exit_misc_device_register_mma8452_device_failed:
- input_unregister_device(mma8452->input_dev);
+ input_unregister_device(mma8452->input_dev);
exit_input_register_device_failed:
input_free_device(mma8452->input_dev);
exit_input_allocate_device_failed: