/* * Copyright (C) 2008-2012 ST-Ericsson * * Author: Srinidhi KASAGAR * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ste-dma40-db8500.h" #include "devices-db8500.h" #include "board-mop500.h" #include "board-mop500-regulators.h" static struct gpio_led snowball_led_array[] = { { .name = "user_led", .default_trigger = "heartbeat", .gpio = 142, }, }; static struct gpio_led_platform_data snowball_led_data = { .leds = snowball_led_array, .num_leds = ARRAY_SIZE(snowball_led_array), }; static struct platform_device snowball_led_dev = { .name = "leds-gpio", .dev = { .platform_data = &snowball_led_data, }, }; static struct fixed_voltage_config snowball_gpio_en_3v3_data = { .supply_name = "EN-3V3", .gpio = SNOWBALL_EN_3V3_ETH_GPIO, .microvolts = 3300000, .enable_high = 1, .init_data = &gpio_en_3v3_regulator, .startup_delay = 5000, /* 1200us */ }; static struct platform_device snowball_gpio_en_3v3_regulator_dev = { .name = "reg-fixed-voltage", .id = 1, .dev = { .platform_data = &snowball_gpio_en_3v3_data, }, }; static struct ab8500_gpio_platform_data ab8500_gpio_pdata = { .gpio_base = MOP500_AB8500_PIN_GPIO(1), .irq_base = MOP500_AB8500_VIR_GPIO_IRQ_BASE, /* config_reg is the initial configuration of ab8500 pins. * The pins can be configured as GPIO or alt functions based * on value present in GpioSel1 to GpioSel6 and AlternatFunction * register. This is the array of 7 configuration settings. * One has to compile time decide these settings. Below is the * explanation of these setting * GpioSel1 = 0x00 => Pins GPIO1 to GPIO8 are not used as GPIO * GpioSel2 = 0x1E => Pins GPIO10 to GPIO13 are configured as GPIO * GpioSel3 = 0x80 => Pin GPIO24 is configured as GPIO * GpioSel4 = 0x01 => Pin GPIo25 is configured as GPIO * GpioSel5 = 0x7A => Pins GPIO34, GPIO36 to GPIO39 are conf as GPIO * GpioSel6 = 0x00 => Pins GPIO41 & GPIo42 are not configured as GPIO * AlternaFunction = 0x00 => If Pins GPIO10 to 13 are not configured * as GPIO then this register selectes the alternate fucntions */ .config_reg = {0x00, 0x1E, 0x80, 0x01, 0x7A, 0x00, 0x00}, }; /* ab8500-codec */ static struct ab8500_codec_platform_data ab8500_codec_pdata = { .amics = { .mic1_type = AMIC_TYPE_DIFFERENTIAL, .mic2_type = AMIC_TYPE_DIFFERENTIAL, .mic1a_micbias = AMIC_MICBIAS_VAMIC1, .mic1b_micbias = AMIC_MICBIAS_VAMIC1, .mic2_micbias = AMIC_MICBIAS_VAMIC2 }, .ear_cmv = EAR_CMV_0_95V }; static struct gpio_keys_button snowball_key_array[] = { { .gpio = 32, .type = EV_KEY, .code = KEY_1, .desc = "userpb", .active_low = 1, .debounce_interval = 50, .wakeup = 1, }, { .gpio = 151, .type = EV_KEY, .code = KEY_2, .desc = "extkb1", .active_low = 1, .debounce_interval = 50, .wakeup = 1, }, { .gpio = 152, .type = EV_KEY, .code = KEY_3, .desc = "extkb2", .active_low = 1, .debounce_interval = 50, .wakeup = 1, }, { .gpio = 161, .type = EV_KEY, .code = KEY_4, .desc = "extkb3", .active_low = 1, .debounce_interval = 50, .wakeup = 1, }, { .gpio = 162, .type = EV_KEY, .code = KEY_5, .desc = "extkb4", .active_low = 1, .debounce_interval = 50, .wakeup = 1, }, }; static struct gpio_keys_platform_data snowball_key_data = { .buttons = snowball_key_array, .nbuttons = ARRAY_SIZE(snowball_key_array), }; static struct platform_device snowball_key_dev = { .name = "gpio-keys", .id = -1, .dev = { .platform_data = &snowball_key_data, } };