int misc_init_r(void) { #if 0 /* TO DO */ uint8_t mac[6] = { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc }; /* set MAC address */ eth_setenv_enetaddr("ethaddr", mac); #endif #ifdef CONFIG_BOOT_ANDROID boot_mode_select(); #endif #if defined(CONFIG_CMD_BATTERYDET) && defined(CONFIG_BATTERY_INIT_GPIO) battery_init_gpio(); #endif #ifdef CONFIG_TESTARGS if(gpio_get_value(GPIO_PA(3)) == 0) //HOME key is PA03, press HOME key for more than 2 seconds to enter rootfs for factory test { int second = 2; while(second > 0 && gpio_get_value(GPIO_PA(3)) == 0) { mdelay(1000); second --; } if(second == 0) setenv("bootargs", CONFIG_TESTARGS); } #endif return 0; }
static void dac_setup(void) { /* Enable DAC clock. */ rcc_enable_clock(RCC_DAC); /* Enable GPIOA clock. */ rcc_enable_clock(RCC_GPIOA); /* Setup PA4 and PA5 for DAC use. */ gpio_config_analog(GPIO_PA(4, 5)); /* Enable DAC channel1 and channel2. */ dac_enable(DAC_DUAL); /* Wait tWAKEUP. */ delay_us(DAC_T_WAKEUP); }
.mtd_partition = jz_mtd_partition1, .num_partition_info = ARRAY_SIZE(jz_mtd_partition1), #endif #ifdef CONFIG_SPI_QUAD .quad_mode = &flash_quad_mode[2], #endif } }; struct spi_board_info jz_spi0_board_info[] = { [0] ={ .modalias = "jz_spi_norflash", .platform_data = &spi_nor_pdata[0], .controller_data = (void *)GPIO_PA(27), /* cs for spi gpio */ .max_speed_hz = 12000000, .bus_num = 0, .chip_select = 0, }, // [0] ={ // .modalias = "jz_nor", // .platform_data = &spi_nor_pdata, // .controller_data = (void *)GPIO_PA(27), /* cs for spi gpio */ // .max_speed_hz = 12000000, // .bus_num = 0, // .chip_select = 0, // }, }; int jz_spi0_devs_size = ARRAY_SIZE(jz_spi0_board_info);
.size = 8 * 1024 * 1024, }, [2] = { .name = "root", .offset = MTDPART_OFS_APPEND, .size = MTDPART_SIZ_FULL, }, }; struct xburst_nand_chip_platform_data nand_chip_data = { .options = NAND_NO_SUBPAGE_WRITE, .bbt_options = NAND_BBT_USE_FLASH, .ecc_strength = 24, .ecc_size = 1024, .ecc_mode = NAND_ECC_HW_OOB_FIRST, .rb_gpio = GPIO_PA(20), .wp_gpio = -1, .tALS = 10, .tALH = 5, .tRP = 25, .tWP = 15, .tRHW = 100, .tWHR = 60, .tWHR2 = 200, .tRR = 20, .tWB = 100, .tADL = 100, .tCWAW = 0, .tCS = 25, .tCLH = 5, .tWH = 10,
#include <sensor-common.h> #include <apical-isp/apical_math.h> #include <linux/proc_fs.h> #include <soc/gpio.h> #define PS5250_CHIP_ID_H (0x52) #define PS5250_CHIP_ID_L (0x50) #define PS5250_REG_END 0xff #define PS5250_REG_DELAY 0xfe #define PS5250_BANK_REG 0xef #define PS5250_SUPPORT_PCLK (76000000) #define SENSOR_OUTPUT_MAX_FPS 30 #define SENSOR_OUTPUT_MIN_FPS 5 static int reset_gpio = GPIO_PA(18); module_param(reset_gpio, int, S_IRUGO); MODULE_PARM_DESC(reset_gpio, "Reset GPIO NUM"); static int pwdn_gpio = -1; module_param(pwdn_gpio, int, S_IRUGO); MODULE_PARM_DESC(pwdn_gpio, "Power down GPIO NUM"); static int sensor_gpio_func = DVP_PA_LOW_10BIT; module_param(sensor_gpio_func, int, S_IRUGO); MODULE_PARM_DESC(sensor_gpio_func, "Sensor GPIO function"); struct regval_list { unsigned char reg_num; unsigned char value; };
static struct regulator_info zpad80_pmu_regulators[] = { {"OUT1", &zpad80_vcore_init_data}, {"OUT3", &zpad80_vccio_init_data}, {"OUT6", &zpad80_vwifi_init_data}, {"OUT7", &zpad80_vtsc_init_data}, {"OUT8", &zpad80_vlcd_init_data}, {"VBUS", &zpad80_vbus_init_data}, }; static struct charger_board_info charger_board_info = { .gpio = GPIO_PB(2), .enable_level = LOW_ENABLE, }; static struct pmu_platform_data zpad80_pmu_pdata = { .gpio = GPIO_PA(28), .num_regulators = ARRAY_SIZE(zpad80_pmu_regulators), .regulators = zpad80_pmu_regulators, .charger_board_info = &charger_board_info, }; #define PMU_I2C_BUSNUM 0 struct i2c_board_info zpad80_pmu_board_info = { I2C_BOARD_INFO("act8600", 0x5a), .platform_data = &zpad80_pmu_pdata, }; static int __init zpad80_pmu_dev_init(void) { struct i2c_adapter *adap;
* * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <plat/inc/spi.h> #include <util.h> static const struct StmSpiBoardCfg mStmSpiBoardCfgs[] = { [0] = { .gpioMiso = GPIO_PA(6), .gpioMosi = GPIO_PA(7), .gpioSclk = GPIO_PA(5), .gpioNss = GPIO_PA(4), .gpioFunc = GPIO_AF_SPI1, .gpioSpeed = GPIO_SPEED_MEDIUM, .irqNss = EXTI4_IRQn, .dmaRx = SPI1_DMA_RX_CFG_B, .dmaTx = SPI1_DMA_TX_CFG_B, .sleepDev = -1, }, [1] = {
.ac_chg_current = 1000, .usb_chg_current = 400, .sleep_current = 30, }; static struct jz_adc_platform_data adc_platform_data; #endif /* ac charger */ static char *npm801_ac_supplied_to[] = { "battery", }; static struct ac_charger_platform_data npm801_ac_charger_pdata = { .name = "ac", .type = POWER_SUPPLY_TYPE_MAINS, .gpio_ac = GPIO_PA(16), .gpio_ac_active_low = 0, .gpio_charging = GPIO_PB(3), .gpio_charging_active_low = 1, .supplied_to = npm801_ac_supplied_to, .num_supplicants = ARRAY_SIZE(npm801_ac_supplied_to), }; static struct platform_device npm801_ac_charger_device = { .name = "ac-charger", .dev = { .platform_data = &npm801_ac_charger_pdata, }, }; #ifdef CONFIG_SPI_JZ4780
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), };
#ifdef CONFIG_SENSORS_EM7180 #include <linux/i2c/em7180.h> #endif #ifdef CONFIG_MISC_BMA250E #include <linux/i2c/bma250e.h> #endif /* efuse */ #ifdef CONFIG_JZ_EFUSE_V12 static struct jz_efuse_platform_data jz_efuse_pdata = { /** * if only used for read, AVDEFUSE need not power on, * PA16 not been used by any devices **/ .gpio_vddq_en_n = GPIO_PA(16), }; #endif #ifdef CONFIG_KEYBOARD_GPIO static struct gpio_keys_button board_buttons[] = { #ifdef GPIO_FUNCTION { .gpio = GPIO_FUNCTION, .code = KEY_POWER, .desc = "end call key", .active_low = ACTIVE_LOW_FUNCTION, .wakeup = 1, } #endif };
.battery_max_cpt = 3500, .ac_chg_current = 1000, .usb_chg_current = 400, .sleep_current = 30, }; static struct jz_adc_platform_data adc_platform_data; #endif /* ac charger */ static char *t700d_ac_supplied_to[] = { "li_ion_charge", }; static struct gpio_charger_platform_data t700d_ac_charger_pdata = { .name = "ac", .type = POWER_SUPPLY_TYPE_MAINS, .gpio = GPIO_PA(16), .gpio_active_low = 0, .supplied_to = t700d_ac_supplied_to, .num_supplicants = ARRAY_SIZE(t700d_ac_supplied_to), }; static struct platform_device t700d_ac_charger_device = { .name = "gpio-charger", .dev = { .platform_data = &t700d_ac_charger_pdata, }, }; /* li-ion charger */ static struct li_ion_charger_platform_data t700d_li_ion_charger_pdata = { .gpio = GPIO_PB(3),