Merge branch 'omap/boards' into late/cleanup
authorOlof Johansson <olof@lixom.net>
Fri, 19 Apr 2013 18:37:28 +0000 (11:37 -0700)
committerOlof Johansson <olof@lixom.net>
Fri, 19 Apr 2013 18:37:28 +0000 (11:37 -0700)
* omap/boards:
  ARM: OMAP: board-4430sdp: Provide regulator to pwm-backlight
  ARM: OMAP: zoom: Use pwm stack for lcd and keyboard backlight
  ARM: OMAP2+: omap2plus_defconfig: Add support for BMP085 pressure sensor
  omap2+: Remove useless Makefile line
  omap2+: Remove useless Makefile line
  ARM: OMAP: RX-51: add missing regulator supply definitions for lis3lv02d
  ARM: OMAP1: fix omap_udc registration

arch/arm/configs/omap2plus_defconfig
arch/arm/mach-omap1/include/mach/usb.h
arch/arm/mach-omap1/usb.c
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/board-4430sdp.c
arch/arm/mach-omap2/board-rx51-peripherals.c
arch/arm/mach-omap2/board-zoom-display.c
arch/arm/mach-omap2/board-zoom-peripherals.c

index bd07864f14a00b0fd9608139cb607ae9f021a154..33903ca0d8798fa6c2449b7d357397c6285c3288 100644 (file)
@@ -93,6 +93,7 @@ CONFIG_BLK_DEV_RAM_SIZE=16384
 CONFIG_SENSORS_LIS3LV02D=m
 CONFIG_SENSORS_TSL2550=m
 CONFIG_SENSORS_LIS3_I2C=m
+CONFIG_BMP085_I2C=m
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_SCSI_MULTI_LUN=y
index 753cd5ce694992b30c91fcf2fa083513b0b29d1c..45e5ac707cbb799326fbd748ec04a1cb0ffde3ca 100644 (file)
@@ -2,7 +2,7 @@
  * FIXME correct answer depends on hmc_mode,
  * as does (on omap1) any nonzero value for config->otg port number
  */
-#ifdef CONFIG_USB_GADGET_OMAP
+#if IS_ENABLED(CONFIG_USB_OMAP)
 #define        is_usb0_device(config)  1
 #else
 #define        is_usb0_device(config)  0
index 1a1db5971cd9e6e412b7c8151040f6c907c2868f..4118db50d5e863ce3ec6d58c353a1fac20af2032 100644 (file)
@@ -123,7 +123,7 @@ omap_otg_init(struct omap_usb_config *config)
        syscon = omap_readl(OTG_SYSCON_1);
        syscon |= HST_IDLE_EN|DEV_IDLE_EN|OTG_IDLE_EN;
 
-#ifdef CONFIG_USB_GADGET_OMAP
+#if IS_ENABLED(CONFIG_USB_OMAP)
        if (config->otg || config->register_dev) {
                struct platform_device *udc_device = config->udc_device;
                int status;
@@ -169,7 +169,7 @@ omap_otg_init(struct omap_usb_config *config)
 void omap_otg_init(struct omap_usb_config *config) {}
 #endif
 
-#ifdef CONFIG_USB_GADGET_OMAP
+#if IS_ENABLED(CONFIG_USB_OMAP)
 
 static struct resource udc_resources[] = {
        /* order is significant! */
@@ -600,7 +600,7 @@ static void __init omap_1510_usb_init(struct omap_usb_config *config)
        while (!(omap_readw(ULPD_DPLL_CTRL) & DPLL_LOCK))
                cpu_relax();
 
-#ifdef CONFIG_USB_GADGET_OMAP
+#if IS_ENABLED(CONFIG_USB_OMAP)
        if (config->register_dev) {
                int status;
 
index b068b7fe99ef3239c98938de5cc0eab820bc371d..62bb352c2d37fd80b2793aa3d8d744ff9eec1195 100644 (file)
@@ -229,7 +229,6 @@ obj-$(CONFIG_MACH_DEVKIT8000)       += board-devkit8000.o
 obj-$(CONFIG_MACH_OMAP_LDP)            += board-ldp.o
 obj-$(CONFIG_MACH_OMAP3530_LV_SOM)      += board-omap3logic.o
 obj-$(CONFIG_MACH_OMAP3_TORPEDO)        += board-omap3logic.o
-obj-$(CONFIG_MACH_ENCORE)              += board-omap3encore.o
 obj-$(CONFIG_MACH_OVERO)               += board-overo.o
 obj-$(CONFIG_MACH_OMAP3EVM)            += board-omap3evm.o
 obj-$(CONFIG_MACH_OMAP3_PANDORA)       += board-omap3pandora.o
@@ -255,8 +254,6 @@ obj-$(CONFIG_MACH_TOUCHBOOK)                += board-omap3touchbook.o
 obj-$(CONFIG_MACH_OMAP_4430SDP)                += board-4430sdp.o
 obj-$(CONFIG_MACH_OMAP4_PANDA)         += board-omap4panda.o
 
-obj-$(CONFIG_MACH_PCM049)              += board-omap4pcm049.o
-
 obj-$(CONFIG_MACH_OMAP3517EVM)         += board-am3517evm.o
 
 obj-$(CONFIG_MACH_CRANEBOARD)          += board-am3517crane.o
index 35f3ad0cb7c708b0903f125f6b8646fc90e72c7a..00d72902ef4fe0bfddaf71bdb929b5f1245523a7 100644 (file)
@@ -291,6 +291,10 @@ static struct platform_device sdp4430_leds_pwm = {
        },
 };
 
+/* Dummy regulator for pwm-backlight driver */
+static struct regulator_consumer_supply backlight_supply =
+       REGULATOR_SUPPLY("enable", "pwm-backlight");
+
 static struct platform_pwm_backlight_data sdp4430_backlight_data = {
        .max_brightness = 127,
        .dft_brightness = 127,
@@ -718,6 +722,8 @@ static void __init omap_4430sdp_init(void)
 
        omap4_i2c_init();
        omap_sfh7741prox_init();
+       regulator_register_always_on(0, "backlight-enable",
+                                    &backlight_supply, 1, 0);
        platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
        omap_serial_init();
        omap_sdrc_init(NULL, NULL);
index 3a077df6b8dfff24d7ccb09478f4ffce291e9b42..1a884670a6c4fe1c40d2d668129502f0bd636fce 100644 (file)
@@ -547,12 +547,16 @@ static struct regulator_consumer_supply rx51_vio_supplies[] = {
        REGULATOR_SUPPLY("DVDD", "2-0019"),
        /* Si4713 IO supply */
        REGULATOR_SUPPLY("vio", "2-0063"),
+       /* lis3lv02d */
+       REGULATOR_SUPPLY("Vdd_IO", "3-001d"),
 };
 
 static struct regulator_consumer_supply rx51_vaux1_consumers[] = {
        REGULATOR_SUPPLY("vdds_sdi", "omapdss"),
        /* Si4713 supply */
        REGULATOR_SUPPLY("vdd", "2-0063"),
+       /* lis3lv02d */
+       REGULATOR_SUPPLY("Vdd", "3-001d"),
 };
 
 static struct regulator_init_data rx51_vaux1 = {
index 8cef477d6b006ac81e890e68c9965abecb2d8a97..9a7174faac510a456492359a818c4438cdcfed3b 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
-#include <linux/i2c/twl.h>
 #include <linux/spi/spi.h>
 #include <linux/platform_data/spi-omap2-mcspi.h>
 #include <video/omapdss.h>
@@ -49,59 +48,6 @@ static void zoom_panel_disable_lcd(struct omap_dss_device *dssdev)
 {
 }
 
-/* Register offsets in TWL4030_MODULE_INTBR */
-#define TWL_INTBR_PMBR1        0xD
-#define TWL_INTBR_GPBR1        0xC
-
-/* Register offsets in TWL_MODULE_PWM */
-#define TWL_LED_PWMON  0x3
-#define TWL_LED_PWMOFF 0x4
-
-static int zoom_set_bl_intensity(struct omap_dss_device *dssdev, int level)
-{
-#ifdef CONFIG_TWL4030_CORE
-       unsigned char c;
-       u8 mux_pwm, enb_pwm;
-
-       if (level > 100)
-               return -1;
-
-       twl_i2c_read_u8(TWL4030_MODULE_INTBR, &mux_pwm, TWL_INTBR_PMBR1);
-       twl_i2c_read_u8(TWL4030_MODULE_INTBR, &enb_pwm, TWL_INTBR_GPBR1);
-
-       if (level == 0) {
-               /* disable pwm1 output and clock */
-               enb_pwm = enb_pwm & 0xF5;
-               /* change pwm1 pin to gpio pin */
-               mux_pwm = mux_pwm & 0xCF;
-               twl_i2c_write_u8(TWL4030_MODULE_INTBR,
-                                       enb_pwm, TWL_INTBR_GPBR1);
-               twl_i2c_write_u8(TWL4030_MODULE_INTBR,
-                                       mux_pwm, TWL_INTBR_PMBR1);
-               return 0;
-       }
-
-       if (!((enb_pwm & 0xA) && (mux_pwm & 0x30))) {
-               /* change gpio pin to pwm1 pin */
-               mux_pwm = mux_pwm | 0x30;
-               /* enable pwm1 output and clock*/
-               enb_pwm = enb_pwm | 0x0A;
-               twl_i2c_write_u8(TWL4030_MODULE_INTBR,
-                                       mux_pwm, TWL_INTBR_PMBR1);
-               twl_i2c_write_u8(TWL4030_MODULE_INTBR,
-                                       enb_pwm, TWL_INTBR_GPBR1);
-       }
-
-       c = ((50 * (100 - level)) / 100) + 1;
-       twl_i2c_write_u8(TWL_MODULE_PWM, 0x7F, TWL_LED_PWMOFF);
-       twl_i2c_write_u8(TWL_MODULE_PWM, c, TWL_LED_PWMON);
-#else
-       pr_warn("Backlight not enabled\n");
-#endif
-
-       return 0;
-}
-
 static struct omap_dss_device zoom_lcd_device = {
        .name                   = "lcd",
        .driver_name            = "NEC_8048_panel",
@@ -109,8 +55,6 @@ static struct omap_dss_device zoom_lcd_device = {
        .phy.dpi.data_lines     = 24,
        .platform_enable        = zoom_panel_enable_lcd,
        .platform_disable       = zoom_panel_disable_lcd,
-       .max_backlight_level    = 100,
-       .set_backlight          = zoom_set_bl_intensity,
 };
 
 static struct omap_dss_device *zoom_dss_devices[] = {
index cdc0c1021863cbbf79a0083549fee4c51bafd365..a90375d5b2b6ea26af9168fdfd697556334d3e72 100644 (file)
@@ -22,6 +22,9 @@
 #include <linux/platform_data/gpio-omap.h>
 #include <linux/platform_data/omap-twl4030.h>
 #include <linux/usb/phy.h>
+#include <linux/pwm.h>
+#include <linux/leds_pwm.h>
+#include <linux/pwm_backlight.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -193,6 +196,53 @@ static struct platform_device omap_vwlan_device = {
        },
 };
 
+static struct pwm_lookup zoom_pwm_lookup[] = {
+       PWM_LOOKUP("twl-pwm", 0, "leds_pwm", "zoom::keypad"),
+       PWM_LOOKUP("twl-pwm", 1, "pwm-backlight", "backlight"),
+};
+
+static struct led_pwm zoom_pwm_leds[] = {
+       {
+               .name           = "zoom::keypad",
+               .max_brightness = 127,
+               .pwm_period_ns  = 7812500,
+       },
+};
+
+static struct led_pwm_platform_data zoom_pwm_data = {
+       .num_leds       = ARRAY_SIZE(zoom_pwm_leds),
+       .leds           = zoom_pwm_leds,
+};
+
+static struct platform_device zoom_leds_pwm = {
+       .name   = "leds_pwm",
+       .id     = -1,
+       .dev    = {
+               .platform_data = &zoom_pwm_data,
+       },
+};
+
+static struct platform_pwm_backlight_data zoom_backlight_data = {
+       .pwm_id = 1,
+       .max_brightness = 127,
+       .dft_brightness = 127,
+       .pwm_period_ns = 7812500,
+};
+
+static struct platform_device zoom_backlight_pwm = {
+       .name   = "pwm-backlight",
+       .id     = -1,
+       .dev    = {
+               .platform_data = &zoom_backlight_data,
+       },
+};
+
+static struct platform_device *zoom_devices[] __initdata = {
+       &omap_vwlan_device,
+       &zoom_leds_pwm,
+       &zoom_backlight_pwm,
+};
+
 static struct wl12xx_platform_data omap_zoom_wlan_data __initdata = {
        .board_ref_clock = WL12XX_REFCLOCK_26, /* 26 MHz */
 };
@@ -301,7 +351,8 @@ void __init zoom_peripherals_init(void)
 
        omap_hsmmc_init(mmc);
        omap_i2c_init();
-       platform_device_register(&omap_vwlan_device);
+       pwm_add_table(zoom_pwm_lookup, ARRAY_SIZE(zoom_pwm_lookup));
+       platform_add_devices(zoom_devices, ARRAY_SIZE(zoom_devices));
        usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
        usb_musb_init(NULL);
        enable_board_wakeup_source();