Re: [RESEND PATCH 3/4] omap: igep0020: add support for IGEP3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011/5/12 Mike Rapoport <mike@xxxxxxxxxxxxxx>:
> Add IGEP3 machine support to board-igep0020
>
> Signed-off-by: Mike Rapoport <mike@xxxxxxxxxxxxxx>
> ---
> Âarch/arm/mach-omap2/board-igep0020.c | Â103 ++++++++++++++++++++++++++--------
> Â1 files changed, 80 insertions(+), 23 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
> index ea7cbc6..0d6d583 100644
> --- a/arch/arm/mach-omap2/board-igep0020.c
> +++ b/arch/arm/mach-omap2/board-igep0020.c
> @@ -55,6 +55,11 @@
> Â#define IGEP2_RC_GPIO_WIFI_NRESET Â139
> Â#define IGEP2_RC_GPIO_BT_NRESET Â Â137
>
> +#define IGEP3_GPIO_LED0_GREEN Â54
> +#define IGEP3_GPIO_LED0_RED Â Â53
> +#define IGEP3_GPIO_LED1_RED Â Â16
> +#define IGEP3_GPIO_USBH_NRESET Â183
> +
> Â/*
> Â* IGEP2 Hardware Revision Table
> Â*
> @@ -69,6 +74,7 @@
>
> Â#define IGEP2_BOARD_HWREV_B Â Â0
> Â#define IGEP2_BOARD_HWREV_C Â Â1
> +#define IGEP3_BOARD_HWREV Â Â Â2
>
> Âstatic u8 hwrev;
>
> @@ -76,6 +82,11 @@ static void __init igep2_get_revision(void)
> Â{
> Â Â Â Âu8 ret;
>
> + Â Â Â if (machine_is_igep0030()) {
> + Â Â Â Â Â Â Â hwrev = IGEP3_BOARD_HWREV;
> + Â Â Â Â Â Â Â return;
> + Â Â Â }
> +
> Â Â Â Âomap_mux_init_gpio(IGEP2_GPIO_LED1_RED, OMAP_PIN_INPUT);
>
> Â Â Â Âif (gpio_request_one(IGEP2_GPIO_LED1_RED, GPIOF_IN, "GPIO_HW0_REV")) {
> @@ -332,24 +343,40 @@ static struct platform_device igep_led_device = {
>
> Âstatic void __init igep_leds_init(void)
> Â{
> - Â Â Â igep_gpio_leds[0].gpio = IGEP2_GPIO_LED0_RED;
> - Â Â Â igep_gpio_leds[1].gpio = IGEP2_GPIO_LED0_GREEN;
> - Â Â Â igep_gpio_leds[2].gpio = IGEP2_GPIO_LED1_RED;
> + Â Â Â if (machine_is_igep0020()) {
> + Â Â Â Â Â Â Â igep_gpio_leds[0].gpio = IGEP2_GPIO_LED0_RED;
> + Â Â Â Â Â Â Â igep_gpio_leds[1].gpio = IGEP2_GPIO_LED0_GREEN;
> + Â Â Â Â Â Â Â igep_gpio_leds[2].gpio = IGEP2_GPIO_LED1_RED;
> + Â Â Â } else {
> + Â Â Â Â Â Â Â igep_gpio_leds[0].gpio = IGEP3_GPIO_LED0_RED;
> + Â Â Â Â Â Â Â igep_gpio_leds[1].gpio = IGEP3_GPIO_LED0_GREEN;
> + Â Â Â Â Â Â Â igep_gpio_leds[2].gpio = IGEP3_GPIO_LED1_RED;
> + Â Â Â }
>
> Â Â Â Âplatform_device_register(&igep_led_device);
> Â}
>
> Â#else
> Âstatic struct gpio igep_gpio_leds[] __initdata = {
> - Â Â Â { IGEP2_GPIO_LED0_RED, Â GPIOF_OUT_INIT_LOW, "gpio-led:red:d0" Â },
> - Â Â Â { IGEP2_GPIO_LED0_GREEN, GPIOF_OUT_INIT_LOW, "gpio-led:green:d0" },
> - Â Â Â { IGEP2_GPIO_LED1_RED, Â GPIOF_OUT_INIT_LOW, "gpio-led:red:d1" Â },
> + Â Â Â { -EINVAL, Â Â ÂGPIOF_OUT_INIT_LOW, "gpio-led:red:d0" Â },
> + Â Â Â { -EINVAL, Â Â ÂGPIOF_OUT_INIT_LOW, "gpio-led:green:d0" },
> + Â Â Â { -EINVAL, Â Â ÂGPIOF_OUT_INIT_LOW, "gpio-led:red:d1" Â },
> Â};
>
> Âstatic inline void igep_leds_init(void)
> Â{
> Â Â Â Âint i;
>
> + Â Â Â if (machine_is_igep0020()) {
> + Â Â Â Â Â Â Â igep_gpio_leds[0].gpio = IGEP2_GPIO_LED0_RED;
> + Â Â Â Â Â Â Â igep_gpio_leds[1].gpio = IGEP2_GPIO_LED0_GREEN;
> + Â Â Â Â Â Â Â igep_gpio_leds[2].gpio = IGEP2_GPIO_LED1_RED;
> + Â Â Â } else {
> + Â Â Â Â Â Â Â igep_gpio_leds[0].gpio = IGEP3_GPIO_LED0_RED;
> + Â Â Â Â Â Â Â igep_gpio_leds[1].gpio = IGEP3_GPIO_LED0_GREEN;
> + Â Â Â Â Â Â Â igep_gpio_leds[2].gpio = IGEP3_GPIO_LED1_RED;
> + Â Â Â }
> +
> Â Â Â Âif (gpio_request_array(igep_gpio_leds, ARRAY_SIZE(igep_gpio_leds))) {
> Â Â Â Â Â Â Â Âpr_warning("IGEP v2: Could not obtain leds gpios\n");
> Â Â Â Â Â Â Â Âreturn;
> @@ -386,6 +413,9 @@ static int igep_twl_gpio_setup(struct device *dev,
> Â Â Â Âigep_gpio_leds[3].gpio = gpio + TWL4030_GPIO_MAX + 1;
> Â#endif
>
> + Â Â Â if (machine_is_igep0030())
> + Â Â Â Â Â Â Â return 0;
> +
> Â Â Â Â/*
> Â Â Â Â * REVISIT: need ehci-omap hooks for external VBUS
> Â Â Â Â * power switch and overcurrent detect
> @@ -548,18 +578,20 @@ static void __init igep_i2c_init(void)
> Â{
> Â Â Â Âint ret;
>
> - Â Â Â /*
> - Â Â Â Â* Bus 3 is attached to the DVI port where devices like the pico DLP
> - Â Â Â Â* projector don't work reliably with 400kHz
> - Â Â Â Â*/
> - Â Â Â ret = omap_register_i2c_bus(3, 100, igep2_i2c3_boardinfo,
> - Â Â Â Â Â Â Â ARRAY_SIZE(igep2_i2c3_boardinfo));
> - Â Â Â if (ret)
> - Â Â Â Â Â Â Â pr_warning("IGEP2: Could not register I2C3 bus (%d)\n", ret);
> -
> -    igep_twldata.codec   Â= &igep2_codec_data;
> -    igep_twldata.keypad   = &igep2_keypad_pdata;
> - Â Â Â igep_twldata.vpll2 Â Â Â= &igep2_vpll2;
> + Â Â Â if (machine_is_igep0020()) {
> + Â Â Â Â Â Â Â /*
> + Â Â Â Â Â Â Â Â* Bus 3 is attached to the DVI port where devices like the
> + Â Â Â Â Â Â Â Â* pico DLP projector don't work reliably with 400kHz
> + Â Â Â Â Â Â Â Â*/
> + Â Â Â Â Â Â Â ret = omap_register_i2c_bus(3, 100, igep2_i2c3_boardinfo,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ARRAY_SIZE(igep2_i2c3_boardinfo));
> + Â Â Â Â Â Â Â if (ret)
> + Â Â Â Â Â Â Â Â Â Â Â pr_warning("IGEP2: Could not register I2C3 bus (%d)\n", ret);
> +
> +        igep_twldata.codec   Â= &igep2_codec_data;
> +        igep_twldata.keypad   = &igep2_keypad_pdata;
> + Â Â Â Â Â Â Â igep_twldata.vpll2 Â Â Â= &igep2_vpll2;
> + Â Â Â }
>
> Â Â Â Âomap3_pmic_init("twl4030", &igep_twldata);
> Â}
> @@ -575,6 +607,17 @@ static const struct usbhs_omap_board_data igep2_usbhs_bdata __initconst = {
> Â Â Â Â.reset_gpio_port[2] = -EINVAL,
> Â};
>
> +static const struct usbhs_omap_board_data igep3_usbhs_bdata __initconst = {
> + Â Â Â .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
> + Â Â Â .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
> + Â Â Â .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
> +
> + Â Â Â .phy_reset = true,
> + Â Â Â .reset_gpio_port[0] = -EINVAL,
> + Â Â Â .reset_gpio_port[1] = IGEP3_GPIO_USBH_NRESET,
> + Â Â Â .reset_gpio_port[2] = -EINVAL,
> +};
> +
> Â#ifdef CONFIG_OMAP_MUX
> Âstatic struct omap_board_mux board_mux[] __initdata = {
> Â Â Â Â{ .reg_offset = OMAP_MUX_TERMINATOR },
> @@ -597,7 +640,7 @@ static void __init igep_wlan_bt_init(void)
> Â Â Â Â Â Â Â Âigep_wlan_bt_gpios[0].gpio = IGEP2_RB_GPIO_WIFI_NPD;
> Â Â Â Â Â Â Â Âigep_wlan_bt_gpios[1].gpio = IGEP2_RB_GPIO_WIFI_NRESET;
> Â Â Â Â Â Â Â Âigep_wlan_bt_gpios[2].gpio = IGEP2_RB_GPIO_BT_NRESET;
> - Â Â Â } else if (hwrev == IGEP2_BOARD_HWREV_C) {
> + Â Â Â } else if (hwrev == IGEP2_BOARD_HWREV_C || machine_is_igep0030()) {
> Â Â Â Â Â Â Â Âigep_wlan_bt_gpios[0].gpio = IGEP2_RC_GPIO_WIFI_NPD;
> Â Â Â Â Â Â Â Âigep_wlan_bt_gpios[1].gpio = IGEP2_RC_GPIO_WIFI_NRESET;
> Â Â Â Â Â Â Â Âigep_wlan_bt_gpios[2].gpio = IGEP2_RC_GPIO_BT_NRESET;
> @@ -645,10 +688,14 @@ static void __init igep_init(void)
> Â Â Â Â */
> Â Â Â Âigep_wlan_bt_init();
>
> - Â Â Â omap_display_init(&igep2_dss_data);
> - Â Â Â igep2_display_init();
> - Â Â Â igep2_init_smsc911x();
> - Â Â Â usbhs_init(&igep2_usbhs_bdata);
> + Â Â Â if (machine_is_igep0020()) {
> + Â Â Â Â Â Â Â omap_display_init(&igep2_dss_data);
> + Â Â Â Â Â Â Â igep2_display_init();
> + Â Â Â Â Â Â Â igep2_init_smsc911x();
> + Â Â Â Â Â Â Â usbhs_init(&igep2_usbhs_bdata);
> + Â Â Â } else {
> + Â Â Â Â Â Â Â usbhs_init(&igep3_usbhs_bdata);
> + Â Â Â }
> Â}
>
> ÂMACHINE_START(IGEP0020, "IGEP v2 board")
> @@ -660,3 +707,13 @@ MACHINE_START(IGEP0020, "IGEP v2 board")
>    Â.init_machine  = igep_init,
>    Â.timer     Â= &omap_timer,
> ÂMACHINE_END
> +
> +MACHINE_START(IGEP0030, "IGEP OMAP3 module")
> +    .boot_params  Â= 0x80000100,
> +    .reserve    Â= omap_reserve,
> +    .map_io     = omap3_map_io,
> +    .init_early   = igep_init_early,
> +    .init_irq    = omap_init_irq,
> +    .init_machine  = igep_init,
> +    .timer     Â= &omap_timer,
> +MACHINE_END
> --
> 1.7.3.1
>
>
Acked-by: Enric Balletbo i Serra <eballetbo@xxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux