#ifdef CONFIG_REGULATOR_ACT8931
+#ifndef CONFIG_RK_CONFIG
+
#if defined(CONFIG_MACH_RK2928_SDK)
#define ACT8931_CHGSEL_PIN RK2928_PIN0_PD0
#else
#define ACT8931_CHGSEL_PIN RK2928_PIN1_PA1
#endif
+#endif
+
#define ACT8931_CHGSEL_VALUE GPIO_HIGH /* Declined to 20% current */
extern int platform_device_register(struct platform_device *pdev);
printk("%s set dcdc3 vdd_arm=%dmV end\n", __func__, regulator_get_voltage(dcdc));
regulator_put(dcdc);
udelay(100);
-
+#ifdef CONFIG_RK_CONFIG
+ ret = port_output_init(chg_sel, 1, "chg_sel");
+#else
ret = gpio_request(ACT8931_CHGSEL_PIN, "ACT8931_CHGSEL");
if (ret != 0)
gpio_free(ACT8931_CHGSEL_PIN);
gpio_direction_output(ACT8931_CHGSEL_PIN, ACT8931_CHGSEL_VALUE);
+#endif
printk("%s,line=%d END\n", __func__,__LINE__);
#ifdef CONFIG_HAS_EARLYSUSPEND
void act8931_early_suspend(struct early_suspend *h)
{
+#if CONFIG_RK_CONFIG
+ port_output_off(chg_sel);
+#else
gpio_direction_output(ACT8931_CHGSEL_PIN, !ACT8931_CHGSEL_VALUE);
+#endif
}
void act8931_late_resume(struct early_suspend *h)
{
+#if CONFIG_RK_CONFIG
+ port_output_on(chg_sel);
+#else
gpio_direction_output(ACT8931_CHGSEL_PIN, ACT8931_CHGSEL_VALUE);
+#endif
}
#endif
#ifdef CONFIG_MFD_TPS65910
+#ifndef CONFIG_RK_CONFIG
+
#if defined(CONFIG_MACH_RK2928_SDK)
#define PMU_POWER_SLEEP RK2928_PIN0_PD0
#elif defined(CONFIG_MACH_RK2928_TB)
#define PMU_POWER_SLEEP RK2928_PIN1_PA1
#endif
+#endif
+
#define GPIO_SWPORTA_DR 0x0000
#define GPIO_SWPORTA_DDR 0x0004
struct sram_gpio_data {
printk("%s,line=%d\n", __func__,__LINE__);
#ifdef CONFIG_RK_CONFIG
if(sram_gpio_init(get_port_config(pmic_slp).gpio, &pmic_sleep) < 0){
+ printk(KERN_ERR "sram_gpio_init failed\n");
+ return -EINVAL;
+ }
+ if(port_output_init(pmic_slp, 1, "pmic_slp") < 0){
+ printk(KERN_ERR "port_output_init failed\n");
+ return -EINVAL;
+ }
#else
if(sram_gpio_init(PMU_POWER_SLEEP, &pmic_sleep) < 0){
-#endif
- printk(KERN_ERR "PMU_POWER_SLEEP is invalid gpio\n");
+ printk(KERN_ERR "sram_gpio_init failed\n");
return -EINVAL;
}
gpio_request(PMU_POWER_SLEEP, "NULL");
gpio_direction_output(PMU_POWER_SLEEP, GPIO_LOW);
+#endif
val = tps65910_reg_read(tps65910, TPS65910_DEVCTRL2);
if (val<0) {
return 0;
}
-int rk30_battery_adc_is_dc_charging( ){
- return act8931_charge_det ;
+int rk30_battery_adc_is_dc_charging(void)
+{
+ return act8931_charge_det;
}
-int rk30_battery_adc_charging_ok( ){
- return act8931_charge_ok ;
+int rk30_battery_adc_charging_ok(void)
+{
+ return act8931_charge_ok;
}
#endif
/**************** gsensor ****************/
// kxtik
+#if defined (CONFIG_GS_KXTIK)
static int kxtik_init_platform_hw(void)
{
return 0;
.flags = 0,
.platform_data = &kxtik_data,
};
+#endif
#if defined (CONFIG_GS_MMA8452)
static int mma8452_init_platform_hw(void)
{
return ret;
port = get_port_config(gs_irq);
//kxtik
- kxtik_info.irq = port.gpio;
- kxtik_info.addr = gs_addr;
- for(i = 0; i < 9; i++)
- kxtik_data.orientation[i] = gs_orig[i];
- i2c_register_board_info(gs_i2c, &kxtik_info, 1);
+#if defined (CONFIG_GS_KXTIK)
+ if(gs_type == GS_TYPE_KXTIK){
+ kxtik_info.irq = port.gpio;
+ kxtik_info.addr = gs_addr;
+ for(i = 0; i < 9; i++)
+ kxtik_data.orientation[i] = gs_orig[i];
+ i2c_register_board_info(gs_i2c, &kxtik_info, 1);
+ }
+#endif
//mma7660
#if defined (CONFIG_GS_MMA7660)
if(gs_type == GS_TYPE_MMA7660){
#define __MACH_CONFIG_H
#include <mach/board.h>
-#define RK2926_TB_DEFAULT_CONFIG
+//#define RK2926_TB_DEFAULT_CONFIG
//#define RK2928_TB_DEFAULT_CONFIG
-//#define RK2926_SDK_DEFAULT_CONFIG
+#define RK2926_SDK_DEFAULT_CONFIG
//#define RK2928_SDK_DEFAULT_CONFIG
+enum {
+ GS_TYPE_NONE = 0,
+ GS_TYPE_MMA8452,
+ GS_TYPE_MMA7660,
+ GS_TYPE_KXTIK,
+ GS_TYPE_MAX,
+};
enum {
WIFI_NONE = 0,
WIFI_USB_NONE = 1<<4,
202, 102, \
1, 0 }
/* gsensor */
-enum {
- GS_TYPE_NONE = 0,
- GS_TYPE_MMA8452,
- GS_TYPE_MMA7660,
- GS_TYPE_MAX,
-};
enum {
DEF_GS_TYPE = GS_TYPE_MMA8452,
202, 102, \
1, 0 }
/* gsensor */
-enum {
- GS_TYPE_NONE = 0,
- GS_TYPE_MMA8452,
- GS_TYPE_MMA7660,
- GS_TYPE_MAX,
-};
-
enum {
DEF_GS_TYPE = GS_TYPE_MMA8452,
DEF_GS_I2C = 0,
DEF_BL_PWM = 0,
DEF_BL_REF = 0,
DEF_BL_MIN = 80,
- DEF_BL_EN = 0x000001b0,
+ DEF_BL_EN = -1,
};
/* lcd */
enum {
154, 85, \
1, 0 }
/* gsensor */
-enum {
- GS_TYPE_NONE = 0,
- GS_TYPE_MMA8452,
- GS_TYPE_MMA7660,
- GS_TYPE_MAX,
-};
-
enum {
DEF_GS_TYPE = GS_TYPE_MMA7660,
DEF_GS_I2C = 1,
DEF_BAT_LOW = -1,
DEF_CHG_OK = -1,
DEF_CHG_SET = -1,
- DEF_CHG_SEL = -1,
+ DEF_CHG_SEL = 0x000001a1,
};
/* global */
enum {
DEF_PWR_ON = 0x000001a2,
};
+/**************************** rk2928 sdk ******************************/
+#elif defined(RK2928_SDK_DEFAULT_CONFIG)
+/* keyboard */
+enum{
+ DEF_KEY_ADC = 1,
+ DEF_PLAY_KEY = 0x000100d1,
+ DEF_VOLDN_KEY = 512 | (1<<31),
+ DEF_VOLUP_KEY = 1 | (1<<31),
+ DEF_MENU_KEY = 0 | (1<<31),
+ DEF_ESC_KEY = 0 | (1<<31),
+ DEF_HOME_KEY = 0 | (1<<31),
+ DEF_CAM_KEY = 0 | (1<<31),
+};
+/* backlight */
+enum{
+ DEF_BL_PWM = 0,
+ DEF_BL_REF = 0,
+ DEF_BL_MIN = 80,
+ DEF_BL_EN = 0x000003c5,
+};
+/* lcd */
+enum {
+ DEF_LCD_CABC = -1,
+ DEF_LCD_EN = 0x000103b3,
+ DEF_LCD_STD = -1,
+};
+
+#define DEF_LCD_PARAM {SCREEN_RGB, OUT_P666, \
+ 33000000, 15000000, \
+ 30, 10, 800, 210, \
+ 13, 10, 480, 22, \
+ 154, 85, \
+ 1, 0 }
+/* gsensor */
+enum {
+ DEF_GS_TYPE = GS_TYPE_MMA7660,
+ DEF_GS_I2C = 1,
+ DEF_GS_ADDR = 0x4c,
+ DEF_GS_IRQ = 0x008003d1,
+ DEF_GS_PWR = -1,
+};
+#define DEF_GS_ORIG {-1, 0, 0, 0, 0, 1, 0, -1, 0}
+/* pwm regulator */
+enum {
+ DEF_REG_PWM = 2,
+};
+/* pmic */
+enum {
+ DEF_PMIC_TYPE = PMIC_TYPE_ACT8931,
+ DEF_PMIC_SLP = 0x000000d0,
+ DEF_PMIC_IRQ = 0x000003c6,
+ DEF_PMIC_I2C = 0,
+ DEF_PMIC_ADDR = 0x5b,
+};
+/* ion */
+enum {
+ DEF_ION_SIZE = 80 * 1024 * 1024,
+};
+/* codec */
+enum {
+ DEF_SPK_CTL = 0x000003d4,
+ DEF_HP_DET = -1,
+};
+/* sdmmc */
+enum {
+ DEF_SD_DET = 0x000101c1,
+};
+/* wifi */
+enum {
+ DEF_WIFI_RST = -1,
+ DEF_WIFI_PWR = -1,
+ DEF_WIFI_TYPE = WIFI_NONE,
+};
+/* rtc */
+enum {
+ DEF_RTC_I2C = 0,
+ DEF_RTC_ADDR = 0x51,
+ DEF_RTC_IRQ = 0x008001a5,
+};
+/* charge */
+enum {
+ DEF_CHG_ADC = 0,
+ DEF_DC_DET = 0x000101b4,
+ DEF_BAT_LOW = -1,
+ DEF_CHG_OK = 0x000001a0,
+ DEF_CHG_SET = -1,
+ DEF_CHG_SEL = 0x000000d0,
+};
+
+/* global */
+enum {
+ DEF_PWR_ON = 0x000001a1,
+};
+
/**************************** other ******************************/
#else
/* keyboard */
0, 0, \
0, 0 }
/* gsensor */
-enum {
- GS_TYPE_NONE = 0,
- GS_TYPE_MMA8452,
- GS_TYPE_MMA7660,
- GS_TYPE_MAX,
-};
-
enum {
DEF_GS_TYPE = GS_TYPE_NONE,
DEF_GS_I2C = -1,
#elif defined(RK2928_TB_DEFAULT_CONFIG)
DEF_IRQ = 0x008003c7,
DEF_RST = 0X000003c3,
+#else
+ DEF_IRQ = -1,
+ DEF_RST = -1,
#endif
DEF_I2C = 2,
DEF_ADDR = 0x04,
#ifdef CONFIG_RK_CONFIG
enum {
-#ifdef RK2926_SDK_DEFAULT_CONFIG
+#if defined(RK2926_SDK_DEFAULT_CONFIG)
DEF_EN = 1,
#else
DEF_EN = 0,
uint8_t touch_protocol_type;
uint8_t pixel_length;
int suspend_state;
+ int irq;
};
static unsigned char initkey_code[] =
UpgradeMsg("IOCTL_SMT_ENABLE_IRQ\n");
if(!sitronix_ts_irq_on){
sitronix_ts_irq_on = 1;
- enable_irq(sitronix_ts_gpts->client->irq);
+ enable_irq(sitronix_ts_gpts->irq);
#ifdef SITRONIX_MONITOR_THREAD
atomic_set(&iMonitorThreadPostpone,1);
SitronixMonitorThread = kthread_run(sitronix_ts_monitor_thread,"Sitronix","Monitorthread");
UpgradeMsg("IOCTL_SMT_DISABLE_IRQ\n");
if(sitronix_ts_irq_on){
sitronix_ts_irq_on = 0;
- disable_irq_nosync(sitronix_ts_gpts->client->irq);
+ disable_irq_nosync(sitronix_ts_gpts->irq);
#ifdef SITRONIX_MONITOR_THREAD
if(SitronixMonitorThread){
kthread_stop(SitronixMonitorThread);
#ifdef SITRONIX_INT_POLLING_MODE
if (ts->use_irq){
sitronix_ts_irq_on = 1;
- enable_irq(ts->client->irq);
+ enable_irq(ts->irq);
}
#endif // SITRONIX_INT_POLLING_MODE
}
#if defined(SITRONIX_LEVEL_TRIGGERED)
if (ts->use_irq){
sitronix_ts_irq_on = 1;
- enable_irq(ts->client->irq);
+ enable_irq(ts->irq);
}
#endif // defined(SITRONIX_LEVEL_TRIGGERED)
if ((2 <= i2cErrorCount)){
// printk("lr:%s\n", __FUNCTION__);
#if defined(SITRONIX_LEVEL_TRIGGERED) || defined(SITRONIX_INT_POLLING_MODE)
sitronix_ts_irq_on = 0;
- disable_irq_nosync(ts->client->irq);
+ disable_irq_nosync(ts->irq);
#endif // defined(SITRONIX_LEVEL_TRIGGERED) || defined(SITRONIX_INT_POLLING_MODE)
#ifdef SITRONIX_MONITOR_THREAD
atomic_set(&iMonitorThreadPostpone,1);
INIT_DELAYED_WORK(&ts->work, sitronix_ts_work_func);
#endif // SITRONIX_INT_POLLING_MODE
ts->client = client;
+ if(client->irq != INVALID_GPIO)
+ ts->irq = gpio_to_irq(client->irq);
i2c_set_clientdata(client, ts);
pdata = client->dev.platform_data;
#if 0
}
ts->suspend_state = 0;
- if (client->irq){
+ if (ts->irq){
#ifdef CONFIG_RK_CONFIG
- ret = request_irq(client->irq, sitronix_ts_irq_handler, irq_cfg.irq.irq_flags | IRQF_DISABLED, client->name, ts);
+ ret = request_irq(ts->irq, sitronix_ts_irq_handler, irq_cfg.irq.irq_flags | IRQF_DISABLED, client->name, ts);
#else
#ifdef SITRONIX_LEVEL_TRIGGERED
- ret = request_irq(client->irq, sitronix_ts_irq_handler, IRQF_TRIGGER_LOW | IRQF_DISABLED, client->name, ts);
+ ret = request_irq(ts->irq, sitronix_ts_irq_handler, IRQF_TRIGGER_LOW | IRQF_DISABLED, client->name, ts);
#else
- ret = request_irq(client->irq, sitronix_ts_irq_handler, IRQF_TRIGGER_FALLING | IRQF_DISABLED, client->name, ts);
+ ret = request_irq(ts->irq, sitronix_ts_irq_handler, IRQF_TRIGGER_FALLING | IRQF_DISABLED, client->name, ts);
#endif // SITRONIX_LEVEL_TRIGGERED
#endif // CONFIG_RK_CONFIG
if (ret == 0){
}
#endif // SITRONIX_MONITOR_THREAD
if (ts->use_irq)
- free_irq(client->irq, ts);
+ free_irq(ts->irq, ts);
else
hrtimer_cancel(&ts->timer);
input_unregister_device(ts->input_dev);
#endif // SITRONIX_MONITOR_THREAD
if(ts->use_irq){
sitronix_ts_irq_on = 0;
- disable_irq_nosync(ts->client->irq);
+ disable_irq_nosync(ts->irq);
}
ts->suspend_state = 1;
ret = sitronix_ts_set_powerdown_bit(ts, 1);
#ifdef SITRONIX_WAKE_UP_TOUCH_BY_INT
- gpio_direction_output(irq_to_gpio(client->irq), 1);
+ gpio_direction_output(client->irq, 1);
#endif // SITRONIX_WAKE_UP_TOUCH_BY_INT
DbgMsg("%s return\n", __FUNCTION__);
DbgMsg("%s\n", __FUNCTION__);
#ifdef SITRONIX_WAKE_UP_TOUCH_BY_INT
- gpio = irq_to_gpio(client->irq);
+ gpio = client->irq;
gpio_set_value(gpio, 0);
gpio_direction_input(gpio);
#else
ts->suspend_state = 0;
if(ts->use_irq){
sitronix_ts_irq_on = 1;
- enable_irq(ts->client->irq);
+ enable_irq(ts->irq);
}
#ifdef SITRONIX_MONITOR_THREAD
atomic_set(&iMonitorThreadPostpone,1);