static int sdp2430_panel_enable(struct lcd_panel *panel) { u8 ded_val, ded_reg; u8 grp_val, grp_reg; if (machine_is_omap_3430sdp()) { ded_reg = TWL4030_VAUX3_DEDICATED; ded_val = ENABLE_VAUX3_DEDICATED; grp_reg = TWL4030_VAUX3_DEV_GRP; grp_val = ENABLE_VAUX3_DEV_GRP; } else { ded_reg = TWL4030_VAUX2_DEDICATED; ded_val = ENABLE_VAUX2_DEDICATED; grp_reg = TWL4030_VAUX2_DEV_GRP; grp_val = ENABLE_VAUX2_DEV_GRP; } omap_set_gpio_dataout(enable_gpio, 1); omap_set_gpio_dataout(backlight_gpio, 1); if (0 != t2_out(PM_RECEIVER, ded_val, ded_reg)) return -EIO; if (0 != t2_out(PM_RECEIVER, grp_val, grp_reg)) return -EIO; return 0; }
static int sdp2430_panel_enable(struct lcd_panel *panel) { u8 ded_val, ded_reg; u8 grp_val, grp_reg; if (machine_is_omap_3430sdp()) { ded_reg = TWL4030_VAUX3_DEDICATED; ded_val = ENABLE_VAUX3_DEDICATED; grp_reg = TWL4030_VAUX3_DEV_GRP; grp_val = ENABLE_VAUX3_DEV_GRP; if (omap_rev() > OMAP3430_REV_ES1_0) { t2_out(PM_RECEIVER, ENABLE_VPLL2_DEDICATED, TWL4030_VPLL2_DEDICATED); t2_out(PM_RECEIVER, ENABLE_VPLL2_DEV_GRP, TWL4030_VPLL2_DEV_GRP); } } else { ded_reg = TWL4030_VAUX2_DEDICATED; ded_val = ENABLE_VAUX2_DEDICATED; grp_reg = TWL4030_VAUX2_DEV_GRP; grp_val = ENABLE_VAUX2_DEV_GRP; } gpio_set_value(enable_gpio, 1); gpio_set_value(backlight_gpio, 1); if (0 != t2_out(PM_RECEIVER, ded_val, ded_reg)) return -EIO; if (0 != t2_out(PM_RECEIVER, grp_val, grp_reg)) return -EIO; return 0; }
static int __init sdp3430_soc_init(void) { int ret; if (!machine_is_omap_3430sdp()) { pr_debug("Not SDP3430!\n"); return -ENODEV; } printk(KERN_INFO "SDP3430 SoC init\n"); sdp3430_snd_device = platform_device_alloc("soc-audio", -1); if (!sdp3430_snd_device) { printk(KERN_ERR "Platform device allocation failed\n"); return -ENOMEM; } platform_set_drvdata(sdp3430_snd_device, &sdp3430_snd_devdata); sdp3430_snd_devdata.dev = &sdp3430_snd_device->dev; *(unsigned int *)sdp3430_dai.cpu_dai->private_data = 1; /* McBSP2 */ ret = platform_device_add(sdp3430_snd_device); if (ret) goto err1; return 0; err1: printk(KERN_ERR "Unable to add platform device\n"); platform_device_put(sdp3430_snd_device); return ret; }
static int __init config_wakeup12_sequence(u8 address) { int err = 0; /* Set SLEEP to ACTIVE SEQ address for P1 and P2 */ err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, address, R_SEQ_ADD_SA12); /* P1/P2/P3 LVL_WAKEUP should be on LEVEL */ err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, LVL_WAKEUP, R_P1_SW_EVENTS); err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, LVL_WAKEUP, R_P2_SW_EVENTS); if (machine_is_omap_3430sdp() || machine_is_omap_ldp()) { u8 data; /* Disabling AC charger effect on sleep-active transitions */ err |= twl4030_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &data, R_CFG_P1_TRANSITION); data &= ~(1<<1); err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, data , R_CFG_P1_TRANSITION); } if (err) printk(KERN_ERR "TWL4030 wakeup sequence for P1 and P2" \ "config error\n"); return err; }
static int __init twl4030_config_wakeup12_sequence(u8 address) { int err = 0; u8 data; /* Set SLEEP to ACTIVE SEQ address for P1 and P2 */ err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, address, R_SEQ_ADD_S2A12); if (err) goto out; /* P1/P2 LVL_WAKEUP should be on LEVEL */ err = twl_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &data, R_P1_SW_EVENTS); if (err) goto out; data |= LVL_WAKEUP; err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, data, R_P1_SW_EVENTS); if (err) goto out; err = twl_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &data, R_P2_SW_EVENTS); if (err) goto out; data |= LVL_WAKEUP; err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, data, R_P2_SW_EVENTS); if (err) goto out; if (machine_is_omap_3430sdp() || machine_is_nowplus() ) { /* Disabling AC charger effect on sleep-active transitions */ err = twl_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &data, R_CFG_P1_TRANSITION); if (err) goto out; data &= ~(1<<1); err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, data , R_CFG_P1_TRANSITION); if (err) goto out; } out: if (err) pr_err("TWL4030 wakeup sequence for P1 and P2" \ "config error\n"); return err; }
static int __devinit twl4030_config_wakeup12_sequence(u8 address) { int err = 0; u8 data; err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, address, R_SEQ_ADD_S2A12); if (err) goto out; err = twl_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &data, R_P1_SW_EVENTS); if (err) goto out; data |= LVL_WAKEUP; err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, data, R_P1_SW_EVENTS); if (err) goto out; err = twl_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &data, R_P2_SW_EVENTS); if (err) goto out; data |= LVL_WAKEUP; err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, data, R_P2_SW_EVENTS); if (err) goto out; if (machine_is_omap_3430sdp() || machine_is_omap_ldp()) { err = twl_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &data, R_CFG_P1_TRANSITION); if (err) goto out; data &= ~(1<<1); err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, data , R_CFG_P1_TRANSITION); if (err) goto out; } out: if (err) pr_err("TWL4030 wakeup sequence for P1 and P2" \ "config error\n"); return err; }
static int sdp2430_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev) { if (machine_is_omap_3430sdp()) { enable_gpio = SDP3430_LCD_PANEL_ENABLE_GPIO; backlight_gpio = SDP3430_LCD_PANEL_BACKLIGHT_GPIO; } else { enable_gpio = SDP2430_LCD_PANEL_ENABLE_GPIO; backlight_gpio = SDP2430_LCD_PANEL_BACKLIGHT_GPIO; } omap_request_gpio(enable_gpio); /* LCD panel */ omap_request_gpio(backlight_gpio); /* LCD backlight */ omap_set_gpio_direction(enable_gpio, 0); /* output */ omap_set_gpio_direction(backlight_gpio, 0); /* output */ return 0; }
static int __init sdp3430_soc_init(void) { int ret; u8 pin_mux; if (!machine_is_omap_3430sdp()) { pr_debug("Not SDP3430!\n"); return -ENODEV; } printk(KERN_INFO "SDP3430 SoC init\n"); sdp3430_snd_device = platform_device_alloc("soc-audio", -1); if (!sdp3430_snd_device) { printk(KERN_ERR "Platform device allocation failed\n"); return -ENOMEM; } platform_set_drvdata(sdp3430_snd_device, &sdp3430_snd_devdata); sdp3430_snd_devdata.dev = &sdp3430_snd_device->dev; *(unsigned int *)sdp3430_dai[0].cpu_dai->private_data = 1; /* McBSP2 */ *(unsigned int *)sdp3430_dai[1].cpu_dai->private_data = 2; /* McBSP3 */ /* Set TWL4030 GPIO6 as EXTMUTE signal */ twl_i2c_read_u8(TWL4030_MODULE_INTBR, &pin_mux, TWL4030_INTBR_PMBR1); pin_mux &= ~TWL4030_GPIO6_PWM0_MUTE(0x03); pin_mux |= TWL4030_GPIO6_PWM0_MUTE(0x02); twl_i2c_write_u8(TWL4030_MODULE_INTBR, pin_mux, TWL4030_INTBR_PMBR1); ret = platform_device_add(sdp3430_snd_device); if (ret) goto err1; return 0; err1: printk(KERN_ERR "Unable to add platform device\n"); platform_device_put(sdp3430_snd_device); return ret; }
static int __init sdp3430_soc_init(void) { int ret; u8 pin_mux; if (!machine_is_omap_3430sdp()) return -ENODEV; #ifdef CONFIG_DEBUG_PRINTK printk(KERN_INFO "SDP3430 SoC init\n"); #else ; #endif sdp3430_snd_device = platform_device_alloc("soc-audio", -1); if (!sdp3430_snd_device) { printk(KERN_ERR "Platform device allocation failed\n"); return -ENOMEM; } platform_set_drvdata(sdp3430_snd_device, &snd_soc_sdp3430); /* Set TWL4030 GPIO6 as EXTMUTE signal */ twl_i2c_read_u8(TWL4030_MODULE_INTBR, &pin_mux, TWL4030_INTBR_PMBR1); pin_mux &= ~TWL4030_GPIO6_PWM0_MUTE(0x03); pin_mux |= TWL4030_GPIO6_PWM0_MUTE(0x02); twl_i2c_write_u8(TWL4030_MODULE_INTBR, pin_mux, TWL4030_INTBR_PMBR1); ret = platform_device_add(sdp3430_snd_device); if (ret) goto err1; return 0; err1: printk(KERN_ERR "Unable to add platform device\n"); platform_device_put(sdp3430_snd_device); return ret; }
static int __init sdp3430_soc_init(void) { int ret; u8 pin_mux; printk(KERN_EMERG " %s : %s : %i \n", __FILE__, __FUNCTION__, __LINE__); #if 0 if (!machine_is_omap_3430sdp()) { pr_debug("Not SDP3430!\n"); return -ENODEV; } #endif printk(KERN_INFO "SDP3430 SoC init\n"); sdp3430_snd_device = platform_device_alloc("soc-audio", -1); if (!sdp3430_snd_device) { printk(KERN_ERR "Platform device allocation failed\n"); return -ENOMEM; } platform_set_drvdata(sdp3430_snd_device, &snd_soc_sdp3430); ret = platform_device_add(sdp3430_snd_device); if (ret) goto err1; else printk(KERN_EMERG "platform_device_add success\n"); return 0; err1: printk(KERN_EMERG " %s : %s : %i UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU\n", __FILE__, __FUNCTION__, __LINE__); printk(KERN_ERR "Unable to add platform device\n"); platform_device_put(sdp3430_snd_device); return ret; }