static int __init printer_board_lateinit(void) { printk(">>>>>>start init sew-290 modem\n"); if (!gpio_is_valid(GPIO_PB(29))) printk("GPIO_PB(29) invaild.\n"); if (gpio_request(GPIO_PB(29), "modem_rst")) printk("GPIO_PB(29) request failed.\n"); else gpio_direction_output(GPIO_PB(29), 0); if (!gpio_is_valid(GPIO_PE(8))) printk("GPIO_PE(8) invaild.\n"); if(gpio_request(GPIO_PE(8), "modem_vcc")) printk("GPIO_PE(8) request failed.\n"); else gpio_direction_output(GPIO_PE(8), 1); if (!gpio_is_valid(GPIO_PD(12))) printk("GPIO_PD(12), is invaild.\n"); if(gpio_request(GPIO_PD(12), "modem_init")) printk("GPIO_PD(12) request faild.\n"); else gpio_direction_output(GPIO_PD(12), 1); INIT_DELAYED_WORK(&modem_work, init_modem); schedule_delayed_work(&modem_work, msecs_to_jiffies(5000)); return 0; }
static void gpio_setup(void) { /* GPIOE clock (for LED). */ rcc_enable_clock(RCC_GPIOE); /* Setup GPIO10 and GPIO11 (in GPIO port E) for LED use. */ gpio_config_output(GPIO_PUSHPULL, GPIO_400KHZ, GPIO_NOPUPD, GPIO_PE(10, 11)); /* LED off */ gpio_set(GPIO_PE(10, 11)); }
int gpio_set_for_slcd(void) { int ret = 0; printk("now use gpio func 2!!!!\n"); ret = gpio_request(GPIO_PC(10), "PC 10"); if (ret) { printk(KERN_ERR "failed to request RD"); return ret; } ret = gpio_request(GPIO_PC(9), "PC 9"); if (ret) { printk(KERN_ERR "failed to request PC9"); return ret; } ret = gpio_request(GPIO_PC(8), "PC 8"); if (ret) { printk(KERN_ERR "failed to request PC8"); return ret; } ret = gpio_request(GPIO_PC(7), "PC 7"); if (ret) { printk(KERN_ERR "failed to request PC7"); return ret; } ret = gpio_request(GPIO_PC(6), "PC 6"); if (ret) { printk(KERN_ERR "failed to request PC6"); return ret; } ret = gpio_request(GPIO_PC(5), "PC 5"); if (ret) { printk(KERN_ERR "failed to request PC5"); return ret; } ret = gpio_request(GPIO_PC(4), "PC 4"); if (ret) { printk(KERN_ERR "failed to request PC4"); return ret; } ret = gpio_request(GPIO_PC(3), "PC 3"); if (ret) { printk(KERN_ERR "failed to request PC3"); return ret; } ret = gpio_request(GPIO_PC(2), "PC 2"); if (ret) { printk(KERN_ERR "failed to request PC2"); return ret; } ret = gpio_request(GPIO_PC(27), "TE"); if (ret) { printk(KERN_ERR "failed to request TE"); return ret; } ret = gpio_request(GPIO_PC(26), "RS"); if (ret) { printk(KERN_ERR "failed to request RS"); return ret; } ret = gpio_request(GPIO_PC(25), "WR"); if (ret) { printk(KERN_ERR "failed to request WR"); return ret; } ret = gpio_request(GPIO_PC(21), "Cs"); if (ret) { printk(KERN_ERR "failed to request cs"); return ret; } ret = gpio_request(GPIO_PC(20), "RST"); if (ret) { printk(KERN_ERR "failed to request RST"); return ret; } ret = gpio_request(GPIO_PC(19), "SDA for SLCDC"); if (ret) { printk(KERN_ERR "failed to request BL"); return ret; } ret = gpio_request(GPIO_PC(17), "LCD_DD12 for BL"); if (ret) { printk(KERN_ERR "failed to request BL"); return ret; } ret = gpio_request(GPIO_PC(0), "LCD_DD12 for BL"); if (ret) { printk(KERN_ERR "failed to request BL"); return ret; } ret = gpio_request(GPIO_PE(0), "PWM0"); if (ret) { printk(KERN_ERR "failed to request PWM0"); return ret; } gpio_direction_output(GPIO_PC(21), 1); /*cs */ gpio_direction_output(GPIO_PC(10), 1); /*RD,pixclk */ gpio_direction_output(GPIO_PC(20), 0); /*rst */ mdelay(10); gpio_direction_output(GPIO_PC(20), 1); mdelay(5); gpio_direction_output(GPIO_PE(0), 1); /*PWM0 */ gpio_direction_output(GPIO_PC(17), 1); /*LCD_DD11 */ gpio_direction_output(GPIO_PC(21), 0); gpio_direction_input(GPIO_PC(0)); return 0; }
/* LCD device */ struct platform_device kd50g2_40nm_a2_device = { .name = "kd50g2_40nm_a2-lcd", .dev = { .platform_data = &kd50g2_40nm_a2_pdata, }, }; #endif #ifdef CONFIG_LCD_CV90_M5377_P30 #include <linux/cv90_m5377_p30.h> static struct platform_cv90_m5377_p30_data cv90_m5377_p30_pdata = { .gpio_lcd_rst = GPIO_PC(20), .gpio_lcd_cs = GPIO_PC(21), /*GPIO_PC(9) *//* chose sync mode */ .gpio_lcd_nbusy = 0, /*GPIO_PC(19) */ .gpio_lcd_bl = GPIO_PE(0), .gpio_lcd_dd11 = GPIO_PC(17), /*GPIO_PC(18) */ .gpio_lcd_rd = GPIO_PC(10), }; struct platform_device cv90_m5377_p30_device = { .name = "cv90_m5377_p30-lcd", .dev = { .platform_data = &cv90_m5377_p30_pdata, }, }; extern int gpio_set_for_slcd(void); #endif #ifdef CONFIG_LCD_KFM701A21_1A
}, }; static struct spi_board_info jz_spi0_board_info[] = { [0] = { .modalias = "spidev", .bus_num = 0, .chip_select = 0, .max_speed_hz = 120000, }, }; #endif #ifdef CONFIG_USB_DWC2 struct jzdwc_pin dwc2_id_pin = { .num = GPIO_PE(2), }; #endif #if (defined(CONFIG_USB_DWC2) || defined(CONFIG_USB_DWC_OTG)) && defined(GPIO_USB_DETE) struct jzdwc_pin dete_pin = { .num = GPIO_USB_DETE, .enable_level = HIGH_ENABLE, }; #endif #ifdef CONFIG_ANDROID_PMEM static struct android_pmem_platform_data pmem_camera_pdata = { .name = "pmem_camera", .no_allocator = 0, .cached = 1,
#include <linux/gpio.h> #include <linux/pwm_backlight.h> #include <linux/at070tn93.h> #include <mach/jzfb.h> #include <mach/fb_hdmi_modes.h> #ifdef CONFIG_LCD_AT070TN93 //#define GPIO_LCD_PWM GPIO_PE(0) #define GPIO_LCD_PWM GPIO_PE(1) static struct platform_at070tn93_data at070tn93_pdata= { .gpio_power = GPIO_PC(9), .gpio_vsync = GPIO_PC(19), .gpio_hsync = GPIO_PC(18), .gpio_reset = GPIO_PE(11), }; struct platform_device at070tn93_device = { .name = "at070tn93-lcd", .dev = { .platform_data = &at070tn93_pdata, }, }; #endif #ifdef CONFIG_LCD_AUO_A043FL01V2 struct platform_device auo_a043fl01v2_device = { .name = "auo_a043fl01v2-lcd", .dev = {
struct platform_device jz_mii_bus = { .name = "mdio-gpio", .dev.platform_data = &mdio_gpio_data, }; #endif /* CONFIG_MDIO_GPIO */ struct platform_device jz_mac_device = { .name = "jz_mac", .dev.platform_data = &jz_mii_bus, }; #endif /* CONFIG_JZ_MAC */ #ifdef CONFIG_JZ_EFUSE_V13 struct jz_efuse_platform_data jz_efuse_pdata = { /* supply 2.5V to VDDQ */ .gpio_vddq_en_n = GPIO_PE(12), }; #endif #ifdef CONFIG_CHARGER_LI_ION /* li-ion charger */ static struct li_ion_charger_platform_data jz_li_ion_charger_pdata = { .gpio_charge = GPIO_LI_ION_CHARGE, .gpio_ac = GPIO_LI_ION_AC, .gpio_active_low = GPIO_ACTIVE_LOW, }; static struct platform_device jz_li_ion_charger_device = { .name = "li-ion-charger", .dev = { .platform_data = &jz_li_ion_charger_pdata,
#endif /***********************************************************************************************/ #ifdef CONFIG_BACKLIGHT_DIGITAL_PULSE static int init_backlight(struct device *dev) { return 0; } static void exit_backlight(struct device *dev) { } struct platform_digital_pulse_backlight_data bl_data = { .digital_pulse_gpio = GPIO_PE(1), .max_brightness = 255, .dft_brightness = 120, .max_brightness_step = 16, .high_level_delay_us = 5, .low_level_delay_us = 5, .init = init_backlight, .exit = exit_backlight, }; struct platform_device digital_pulse_backlight_device = { .name = "digital-pulse-backlight", .dev = { .platform_data = &bl_data, }, };
regulator_set_voltage(lcd_regulator, 1800000,1800000); regulator_enable(lcd_regulator); } struct jzfb_config_info jzfb1_init_data = { .modes = &jzfb1_videomode, .lcd_type = LCD_TYPE_GENERIC_24_BIT, .bpp = 24, .pixclk_falling_edge = 1, .date_enable_active_low = 0, .dither_enable = 0, }; #define GPIO_LCD_DISP PCA953X_GPIO(9) #define GPIO_LCD_SPI_CLK GPIO_PB(0) struct byd_8991_data byd_8991_pdata = { .gpio_lcd_disp = GPIO_LCD_DISP, .gpio_lcd_de = 0, .gpio_lcd_vsync = 0, .gpio_lcd_hsync = 0, .gpio_spi_cs = GPIO_PA(11), .gpio_spi_clk = GPIO_LCD_SPI_CLK, .gpio_spi_mosi = GPIO_PE(3), .gpio_spi_miso = GPIO_PE(0), };
*/ #include <linux/platform_device.h> #include <linux/regulator/machine.h> #include <linux/mfd/pmu-common.h> #include <linux/i2c.h> #include <gpio.h> /** * Fixed voltage Regulators. * GPIO silulator regulators. Everyone is an independent device. */ FIXED_REGULATOR_DEF( hdmi_80_vcc5, "Vcc-5V", 5000000, GPIO_PE(15), HIGH_ENABLE, UN_AT_BOOT, 0, NULL, "vhdmi", "jz-hdmi"); FIXED_REGULATOR_DEF( hdmi_80_vbus, "OTG-Vbus", 5000000, GPIO_PB(10), LOW_ENABLE, UN_AT_BOOT, 0, NULL, "vbus", NULL); FIXED_REGULATOR_DEF( hdmi_80_vwifi, "vwifi", 3000000, GPIO_PD(8), HIGH_ENABLE, UN_AT_BOOT, 0, NULL, "vwifi", NULL); /*
*/ #include <linux/platform_device.h> #include <linux/regulator/machine.h> #include <linux/mfd/pmu-common.h> #include <linux/i2c.h> #include <gpio.h> /** * Fixed voltage Regulators. * GPIO silulator regulators. Everyone is an independent device. */ FIXED_REGULATOR_DEF( hdmi_80_vcc5, "Vcc-5V", 5000000, GPIO_PE(15), HIGH_ENABLE, UN_AT_BOOT, 0, NULL, "vhdmi", "jz-hdmi"); FIXED_REGULATOR_DEF( hdmi_80_vbus, "OTG-Vbus", 5000000, GPIO_PE(10), LOW_ENABLE, UN_AT_BOOT, 0, NULL, "vbus", NULL); FIXED_REGULATOR_DEF( hdmi_80_vwifi, "vwifi", 3000000, GPIO_PD(8), HIGH_ENABLE, UN_AT_BOOT, 0, NULL, "vwifi", NULL); /*