|
@@ -243,3 +243,119 @@ static struct gpio_led sdp4430_gpio_leds[] = {
|
|
|
|
|
|
static struct gpio_keys_button sdp4430_gpio_keys[] = {
|
|
|
{
|
|
|
+ .desc = "Proximity Sensor",
|
|
|
+ .type = EV_SW,
|
|
|
+ .code = SW_FRONT_PROXIMITY,
|
|
|
+ .gpio = OMAP4_SFH7741_SENSOR_OUTPUT_GPIO,
|
|
|
+ .active_low = 0,
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+static struct gpio_led_platform_data sdp4430_led_data = {
|
|
|
+ .leds = sdp4430_gpio_leds,
|
|
|
+ .num_leds = ARRAY_SIZE(sdp4430_gpio_leds),
|
|
|
+};
|
|
|
+
|
|
|
+static struct led_pwm sdp4430_pwm_leds[] = {
|
|
|
+ {
|
|
|
+ .name = "omap4:green:chrg",
|
|
|
+ .pwm_id = 1,
|
|
|
+ .max_brightness = 255,
|
|
|
+ .pwm_period_ns = 7812500,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static struct led_pwm_platform_data sdp4430_pwm_data = {
|
|
|
+ .num_leds = ARRAY_SIZE(sdp4430_pwm_leds),
|
|
|
+ .leds = sdp4430_pwm_leds,
|
|
|
+};
|
|
|
+
|
|
|
+static struct platform_device sdp4430_leds_pwm = {
|
|
|
+ .name = "leds_pwm",
|
|
|
+ .id = -1,
|
|
|
+ .dev = {
|
|
|
+ .platform_data = &sdp4430_pwm_data,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static int omap_prox_activate(struct device *dev)
|
|
|
+{
|
|
|
+ gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 1);
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+static void omap_prox_deactivate(struct device *dev)
|
|
|
+{
|
|
|
+ gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 0);
|
|
|
+}
|
|
|
+
|
|
|
+static struct gpio_keys_platform_data sdp4430_gpio_keys_data = {
|
|
|
+ .buttons = sdp4430_gpio_keys,
|
|
|
+ .nbuttons = ARRAY_SIZE(sdp4430_gpio_keys),
|
|
|
+ .enable = omap_prox_activate,
|
|
|
+ .disable = omap_prox_deactivate,
|
|
|
+};
|
|
|
+
|
|
|
+static struct platform_device sdp4430_gpio_keys_device = {
|
|
|
+ .name = "gpio-keys",
|
|
|
+ .id = -1,
|
|
|
+ .dev = {
|
|
|
+ .platform_data = &sdp4430_gpio_keys_data,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static struct platform_device sdp4430_leds_gpio = {
|
|
|
+ .name = "leds-gpio",
|
|
|
+ .id = -1,
|
|
|
+ .dev = {
|
|
|
+ .platform_data = &sdp4430_led_data,
|
|
|
+ },
|
|
|
+};
|
|
|
+static struct spi_board_info sdp4430_spi_board_info[] __initdata = {
|
|
|
+ {
|
|
|
+ .modalias = "ks8851",
|
|
|
+ .bus_num = 1,
|
|
|
+ .chip_select = 0,
|
|
|
+ .max_speed_hz = 24000000,
|
|
|
+ /*
|
|
|
+ * .irq is set to gpio_to_irq(ETH_KS8851_IRQ)
|
|
|
+ * in omap_4430sdp_init
|
|
|
+ */
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static struct gpio sdp4430_eth_gpios[] __initdata = {
|
|
|
+ { ETH_KS8851_POWER_ON, GPIOF_OUT_INIT_HIGH, "eth_power" },
|
|
|
+ { ETH_KS8851_QUART, GPIOF_OUT_INIT_HIGH, "quart" },
|
|
|
+ { ETH_KS8851_IRQ, GPIOF_IN, "eth_irq" },
|
|
|
+};
|
|
|
+
|
|
|
+static int __init omap_ethernet_init(void)
|
|
|
+{
|
|
|
+ int status;
|
|
|
+
|
|
|
+ /* Request of GPIO lines */
|
|
|
+ status = gpio_request_array(sdp4430_eth_gpios,
|
|
|
+ ARRAY_SIZE(sdp4430_eth_gpios));
|
|
|
+ if (status)
|
|
|
+ pr_err("Cannot request ETH GPIOs\n");
|
|
|
+
|
|
|
+ return status;
|
|
|
+}
|
|
|
+
|
|
|
+static struct regulator_consumer_supply sdp4430_vbat_supply[] = {
|
|
|
+ REGULATOR_SUPPLY("vddvibl", "twl6040-vibra"),
|
|
|
+ REGULATOR_SUPPLY("vddvibr", "twl6040-vibra"),
|
|
|
+};
|
|
|
+
|
|
|
+static struct regulator_init_data sdp4430_vbat_data = {
|
|
|
+ .constraints = {
|
|
|
+ .always_on = 1,
|
|
|
+ },
|
|
|
+ .num_consumer_supplies = ARRAY_SIZE(sdp4430_vbat_supply),
|
|
|
+ .consumer_supplies = sdp4430_vbat_supply,
|
|
|
+};
|
|
|
+
|
|
|
+static struct fixed_voltage_config sdp4430_vbat_pdata = {
|
|
|
+ .supply_name = "VBAT",
|
|
|
+ .microvolts = 3750000,
|