|
@@ -460,3 +460,167 @@ static struct platform_device z2_pxa_keys = {
|
|
|
|
|
|
static void __init z2_keys_init(void)
|
|
|
{
|
|
|
+ platform_device_register(&z2_pxa_keys);
|
|
|
+}
|
|
|
+#else
|
|
|
+static inline void z2_keys_init(void) {}
|
|
|
+#endif
|
|
|
+
|
|
|
+/******************************************************************************
|
|
|
+ * Battery
|
|
|
+ ******************************************************************************/
|
|
|
+#if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE)
|
|
|
+static struct z2_battery_info batt_chip_info = {
|
|
|
+ .batt_I2C_bus = 0,
|
|
|
+ .batt_I2C_addr = 0x55,
|
|
|
+ .batt_I2C_reg = 2,
|
|
|
+ .charge_gpio = GPIO0_ZIPITZ2_AC_DETECT,
|
|
|
+ .min_voltage = 3475000,
|
|
|
+ .max_voltage = 4190000,
|
|
|
+ .batt_div = 59,
|
|
|
+ .batt_mult = 1000000,
|
|
|
+ .batt_tech = POWER_SUPPLY_TECHNOLOGY_LION,
|
|
|
+ .batt_name = "Z2",
|
|
|
+};
|
|
|
+
|
|
|
+static struct i2c_board_info __initdata z2_i2c_board_info[] = {
|
|
|
+ {
|
|
|
+ I2C_BOARD_INFO("aer915", 0x55),
|
|
|
+ .platform_data = &batt_chip_info,
|
|
|
+ }, {
|
|
|
+ I2C_BOARD_INFO("wm8750", 0x1b),
|
|
|
+ },
|
|
|
+
|
|
|
+};
|
|
|
+
|
|
|
+static void __init z2_i2c_init(void)
|
|
|
+{
|
|
|
+ pxa_set_i2c_info(NULL);
|
|
|
+ i2c_register_board_info(0, ARRAY_AND_SIZE(z2_i2c_board_info));
|
|
|
+}
|
|
|
+#else
|
|
|
+static inline void z2_i2c_init(void) {}
|
|
|
+#endif
|
|
|
+
|
|
|
+/******************************************************************************
|
|
|
+ * SSP Devices - WiFi and LCD control
|
|
|
+ ******************************************************************************/
|
|
|
+#if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
|
|
|
+/* WiFi */
|
|
|
+static int z2_lbs_spi_setup(struct spi_device *spi)
|
|
|
+{
|
|
|
+ int ret = 0;
|
|
|
+
|
|
|
+ ret = gpio_request(GPIO14_ZIPITZ2_WIFI_POWER, "WiFi Power");
|
|
|
+ if (ret)
|
|
|
+ goto err;
|
|
|
+
|
|
|
+ ret = gpio_direction_output(GPIO14_ZIPITZ2_WIFI_POWER, 1);
|
|
|
+ if (ret)
|
|
|
+ goto err2;
|
|
|
+
|
|
|
+ /* Wait until card is powered on */
|
|
|
+ mdelay(180);
|
|
|
+
|
|
|
+ spi->bits_per_word = 16;
|
|
|
+ spi->mode = SPI_MODE_2,
|
|
|
+
|
|
|
+ spi_setup(spi);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+
|
|
|
+err2:
|
|
|
+ gpio_free(GPIO14_ZIPITZ2_WIFI_POWER);
|
|
|
+err:
|
|
|
+ return ret;
|
|
|
+};
|
|
|
+
|
|
|
+static int z2_lbs_spi_teardown(struct spi_device *spi)
|
|
|
+{
|
|
|
+ gpio_set_value(GPIO14_ZIPITZ2_WIFI_POWER, 0);
|
|
|
+ gpio_free(GPIO14_ZIPITZ2_WIFI_POWER);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+};
|
|
|
+
|
|
|
+static struct pxa2xx_spi_chip z2_lbs_chip_info = {
|
|
|
+ .rx_threshold = 8,
|
|
|
+ .tx_threshold = 8,
|
|
|
+ .timeout = 1000,
|
|
|
+ .gpio_cs = GPIO24_ZIPITZ2_WIFI_CS,
|
|
|
+};
|
|
|
+
|
|
|
+static struct libertas_spi_platform_data z2_lbs_pdata = {
|
|
|
+ .use_dummy_writes = 1,
|
|
|
+ .setup = z2_lbs_spi_setup,
|
|
|
+ .teardown = z2_lbs_spi_teardown,
|
|
|
+};
|
|
|
+
|
|
|
+/* LCD */
|
|
|
+static struct pxa2xx_spi_chip lms283_chip_info = {
|
|
|
+ .rx_threshold = 1,
|
|
|
+ .tx_threshold = 1,
|
|
|
+ .timeout = 64,
|
|
|
+ .gpio_cs = GPIO88_ZIPITZ2_LCD_CS,
|
|
|
+};
|
|
|
+
|
|
|
+static const struct lms283gf05_pdata lms283_pdata = {
|
|
|
+ .reset_gpio = GPIO19_ZIPITZ2_LCD_RESET,
|
|
|
+};
|
|
|
+
|
|
|
+static struct spi_board_info spi_board_info[] __initdata = {
|
|
|
+{
|
|
|
+ .modalias = "libertas_spi",
|
|
|
+ .platform_data = &z2_lbs_pdata,
|
|
|
+ .controller_data = &z2_lbs_chip_info,
|
|
|
+ .irq = PXA_GPIO_TO_IRQ(GPIO36_ZIPITZ2_WIFI_IRQ),
|
|
|
+ .max_speed_hz = 13000000,
|
|
|
+ .bus_num = 1,
|
|
|
+ .chip_select = 0,
|
|
|
+},
|
|
|
+{
|
|
|
+ .modalias = "lms283gf05",
|
|
|
+ .controller_data = &lms283_chip_info,
|
|
|
+ .platform_data = &lms283_pdata,
|
|
|
+ .max_speed_hz = 400000,
|
|
|
+ .bus_num = 2,
|
|
|
+ .chip_select = 0,
|
|
|
+},
|
|
|
+};
|
|
|
+
|
|
|
+static struct pxa2xx_spi_master pxa_ssp1_master_info = {
|
|
|
+ .clock_enable = CKEN_SSP,
|
|
|
+ .num_chipselect = 1,
|
|
|
+ .enable_dma = 1,
|
|
|
+};
|
|
|
+
|
|
|
+static struct pxa2xx_spi_master pxa_ssp2_master_info = {
|
|
|
+ .clock_enable = CKEN_SSP2,
|
|
|
+ .num_chipselect = 1,
|
|
|
+};
|
|
|
+
|
|
|
+static void __init z2_spi_init(void)
|
|
|
+{
|
|
|
+ pxa2xx_set_spi_info(1, &pxa_ssp1_master_info);
|
|
|
+ pxa2xx_set_spi_info(2, &pxa_ssp2_master_info);
|
|
|
+ spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
|
|
|
+}
|
|
|
+#else
|
|
|
+static inline void z2_spi_init(void) {}
|
|
|
+#endif
|
|
|
+
|
|
|
+/******************************************************************************
|
|
|
+ * Core power regulator
|
|
|
+ ******************************************************************************/
|
|
|
+#if defined(CONFIG_REGULATOR_TPS65023) || \
|
|
|
+ defined(CONFIG_REGULATOR_TPS65023_MODULE)
|
|
|
+static struct regulator_consumer_supply z2_tps65021_consumers[] = {
|
|
|
+ REGULATOR_SUPPLY("vcc_core", NULL),
|
|
|
+};
|
|
|
+
|
|
|
+static struct regulator_init_data z2_tps65021_info[] = {
|
|
|
+ {
|
|
|
+ .constraints = {
|
|
|
+ .name = "vcc_core range",
|
|
|
+ .min_uV = 800000,
|
|
|
+ .max_uV = 1600000,
|