Commit ff57270de9c42ddb63736bb95912a24ad315e664
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
Merge branch 'omap/boards' into late/cleanup
* 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
Showing 8 changed files Side-by-side Diff
arch/arm/configs/omap2plus_defconfig
arch/arm/mach-omap1/include/mach/usb.h
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | * FIXME correct answer depends on hmc_mode, |
3 | 3 | * as does (on omap1) any nonzero value for config->otg port number |
4 | 4 | */ |
5 | -#ifdef CONFIG_USB_GADGET_OMAP | |
5 | +#if IS_ENABLED(CONFIG_USB_OMAP) | |
6 | 6 | #define is_usb0_device(config) 1 |
7 | 7 | #else |
8 | 8 | #define is_usb0_device(config) 0 |
arch/arm/mach-omap1/usb.c
... | ... | @@ -123,7 +123,7 @@ |
123 | 123 | syscon = omap_readl(OTG_SYSCON_1); |
124 | 124 | syscon |= HST_IDLE_EN|DEV_IDLE_EN|OTG_IDLE_EN; |
125 | 125 | |
126 | -#ifdef CONFIG_USB_GADGET_OMAP | |
126 | +#if IS_ENABLED(CONFIG_USB_OMAP) | |
127 | 127 | if (config->otg || config->register_dev) { |
128 | 128 | struct platform_device *udc_device = config->udc_device; |
129 | 129 | int status; |
... | ... | @@ -169,7 +169,7 @@ |
169 | 169 | void omap_otg_init(struct omap_usb_config *config) {} |
170 | 170 | #endif |
171 | 171 | |
172 | -#ifdef CONFIG_USB_GADGET_OMAP | |
172 | +#if IS_ENABLED(CONFIG_USB_OMAP) | |
173 | 173 | |
174 | 174 | static struct resource udc_resources[] = { |
175 | 175 | /* order is significant! */ |
... | ... | @@ -600,7 +600,7 @@ |
600 | 600 | while (!(omap_readw(ULPD_DPLL_CTRL) & DPLL_LOCK)) |
601 | 601 | cpu_relax(); |
602 | 602 | |
603 | -#ifdef CONFIG_USB_GADGET_OMAP | |
603 | +#if IS_ENABLED(CONFIG_USB_OMAP) | |
604 | 604 | if (config->register_dev) { |
605 | 605 | int status; |
606 | 606 |
arch/arm/mach-omap2/Makefile
... | ... | @@ -229,7 +229,6 @@ |
229 | 229 | obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o |
230 | 230 | obj-$(CONFIG_MACH_OMAP3530_LV_SOM) += board-omap3logic.o |
231 | 231 | obj-$(CONFIG_MACH_OMAP3_TORPEDO) += board-omap3logic.o |
232 | -obj-$(CONFIG_MACH_ENCORE) += board-omap3encore.o | |
233 | 232 | obj-$(CONFIG_MACH_OVERO) += board-overo.o |
234 | 233 | obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o |
235 | 234 | obj-$(CONFIG_MACH_OMAP3_PANDORA) += board-omap3pandora.o |
... | ... | @@ -254,8 +253,6 @@ |
254 | 253 | obj-$(CONFIG_MACH_TOUCHBOOK) += board-omap3touchbook.o |
255 | 254 | obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o |
256 | 255 | obj-$(CONFIG_MACH_OMAP4_PANDA) += board-omap4panda.o |
257 | - | |
258 | -obj-$(CONFIG_MACH_PCM049) += board-omap4pcm049.o | |
259 | 256 | |
260 | 257 | obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o |
261 | 258 |
arch/arm/mach-omap2/board-4430sdp.c
... | ... | @@ -291,6 +291,10 @@ |
291 | 291 | }, |
292 | 292 | }; |
293 | 293 | |
294 | +/* Dummy regulator for pwm-backlight driver */ | |
295 | +static struct regulator_consumer_supply backlight_supply = | |
296 | + REGULATOR_SUPPLY("enable", "pwm-backlight"); | |
297 | + | |
294 | 298 | static struct platform_pwm_backlight_data sdp4430_backlight_data = { |
295 | 299 | .max_brightness = 127, |
296 | 300 | .dft_brightness = 127, |
... | ... | @@ -718,6 +722,8 @@ |
718 | 722 | |
719 | 723 | omap4_i2c_init(); |
720 | 724 | omap_sfh7741prox_init(); |
725 | + regulator_register_always_on(0, "backlight-enable", | |
726 | + &backlight_supply, 1, 0); | |
721 | 727 | platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); |
722 | 728 | omap_serial_init(); |
723 | 729 | omap_sdrc_init(NULL, NULL); |
arch/arm/mach-omap2/board-rx51-peripherals.c
... | ... | @@ -547,12 +547,16 @@ |
547 | 547 | REGULATOR_SUPPLY("DVDD", "2-0019"), |
548 | 548 | /* Si4713 IO supply */ |
549 | 549 | REGULATOR_SUPPLY("vio", "2-0063"), |
550 | + /* lis3lv02d */ | |
551 | + REGULATOR_SUPPLY("Vdd_IO", "3-001d"), | |
550 | 552 | }; |
551 | 553 | |
552 | 554 | static struct regulator_consumer_supply rx51_vaux1_consumers[] = { |
553 | 555 | REGULATOR_SUPPLY("vdds_sdi", "omapdss"), |
554 | 556 | /* Si4713 supply */ |
555 | 557 | REGULATOR_SUPPLY("vdd", "2-0063"), |
558 | + /* lis3lv02d */ | |
559 | + REGULATOR_SUPPLY("Vdd", "3-001d"), | |
556 | 560 | }; |
557 | 561 | |
558 | 562 | static struct regulator_init_data rx51_vaux1 = { |
arch/arm/mach-omap2/board-zoom-display.c
... | ... | @@ -12,7 +12,6 @@ |
12 | 12 | #include <linux/init.h> |
13 | 13 | #include <linux/platform_device.h> |
14 | 14 | #include <linux/gpio.h> |
15 | -#include <linux/i2c/twl.h> | |
16 | 15 | #include <linux/spi/spi.h> |
17 | 16 | #include <linux/platform_data/spi-omap2-mcspi.h> |
18 | 17 | #include <video/omapdss.h> |
... | ... | @@ -49,59 +48,6 @@ |
49 | 48 | { |
50 | 49 | } |
51 | 50 | |
52 | -/* Register offsets in TWL4030_MODULE_INTBR */ | |
53 | -#define TWL_INTBR_PMBR1 0xD | |
54 | -#define TWL_INTBR_GPBR1 0xC | |
55 | - | |
56 | -/* Register offsets in TWL_MODULE_PWM */ | |
57 | -#define TWL_LED_PWMON 0x3 | |
58 | -#define TWL_LED_PWMOFF 0x4 | |
59 | - | |
60 | -static int zoom_set_bl_intensity(struct omap_dss_device *dssdev, int level) | |
61 | -{ | |
62 | -#ifdef CONFIG_TWL4030_CORE | |
63 | - unsigned char c; | |
64 | - u8 mux_pwm, enb_pwm; | |
65 | - | |
66 | - if (level > 100) | |
67 | - return -1; | |
68 | - | |
69 | - twl_i2c_read_u8(TWL4030_MODULE_INTBR, &mux_pwm, TWL_INTBR_PMBR1); | |
70 | - twl_i2c_read_u8(TWL4030_MODULE_INTBR, &enb_pwm, TWL_INTBR_GPBR1); | |
71 | - | |
72 | - if (level == 0) { | |
73 | - /* disable pwm1 output and clock */ | |
74 | - enb_pwm = enb_pwm & 0xF5; | |
75 | - /* change pwm1 pin to gpio pin */ | |
76 | - mux_pwm = mux_pwm & 0xCF; | |
77 | - twl_i2c_write_u8(TWL4030_MODULE_INTBR, | |
78 | - enb_pwm, TWL_INTBR_GPBR1); | |
79 | - twl_i2c_write_u8(TWL4030_MODULE_INTBR, | |
80 | - mux_pwm, TWL_INTBR_PMBR1); | |
81 | - return 0; | |
82 | - } | |
83 | - | |
84 | - if (!((enb_pwm & 0xA) && (mux_pwm & 0x30))) { | |
85 | - /* change gpio pin to pwm1 pin */ | |
86 | - mux_pwm = mux_pwm | 0x30; | |
87 | - /* enable pwm1 output and clock*/ | |
88 | - enb_pwm = enb_pwm | 0x0A; | |
89 | - twl_i2c_write_u8(TWL4030_MODULE_INTBR, | |
90 | - mux_pwm, TWL_INTBR_PMBR1); | |
91 | - twl_i2c_write_u8(TWL4030_MODULE_INTBR, | |
92 | - enb_pwm, TWL_INTBR_GPBR1); | |
93 | - } | |
94 | - | |
95 | - c = ((50 * (100 - level)) / 100) + 1; | |
96 | - twl_i2c_write_u8(TWL_MODULE_PWM, 0x7F, TWL_LED_PWMOFF); | |
97 | - twl_i2c_write_u8(TWL_MODULE_PWM, c, TWL_LED_PWMON); | |
98 | -#else | |
99 | - pr_warn("Backlight not enabled\n"); | |
100 | -#endif | |
101 | - | |
102 | - return 0; | |
103 | -} | |
104 | - | |
105 | 51 | static struct omap_dss_device zoom_lcd_device = { |
106 | 52 | .name = "lcd", |
107 | 53 | .driver_name = "NEC_8048_panel", |
... | ... | @@ -109,8 +55,6 @@ |
109 | 55 | .phy.dpi.data_lines = 24, |
110 | 56 | .platform_enable = zoom_panel_enable_lcd, |
111 | 57 | .platform_disable = zoom_panel_disable_lcd, |
112 | - .max_backlight_level = 100, | |
113 | - .set_backlight = zoom_set_bl_intensity, | |
114 | 58 | }; |
115 | 59 | |
116 | 60 | static struct omap_dss_device *zoom_dss_devices[] = { |
arch/arm/mach-omap2/board-zoom-peripherals.c
... | ... | @@ -22,6 +22,9 @@ |
22 | 22 | #include <linux/platform_data/gpio-omap.h> |
23 | 23 | #include <linux/platform_data/omap-twl4030.h> |
24 | 24 | #include <linux/usb/phy.h> |
25 | +#include <linux/pwm.h> | |
26 | +#include <linux/leds_pwm.h> | |
27 | +#include <linux/pwm_backlight.h> | |
25 | 28 | |
26 | 29 | #include <asm/mach-types.h> |
27 | 30 | #include <asm/mach/arch.h> |
... | ... | @@ -193,6 +196,53 @@ |
193 | 196 | }, |
194 | 197 | }; |
195 | 198 | |
199 | +static struct pwm_lookup zoom_pwm_lookup[] = { | |
200 | + PWM_LOOKUP("twl-pwm", 0, "leds_pwm", "zoom::keypad"), | |
201 | + PWM_LOOKUP("twl-pwm", 1, "pwm-backlight", "backlight"), | |
202 | +}; | |
203 | + | |
204 | +static struct led_pwm zoom_pwm_leds[] = { | |
205 | + { | |
206 | + .name = "zoom::keypad", | |
207 | + .max_brightness = 127, | |
208 | + .pwm_period_ns = 7812500, | |
209 | + }, | |
210 | +}; | |
211 | + | |
212 | +static struct led_pwm_platform_data zoom_pwm_data = { | |
213 | + .num_leds = ARRAY_SIZE(zoom_pwm_leds), | |
214 | + .leds = zoom_pwm_leds, | |
215 | +}; | |
216 | + | |
217 | +static struct platform_device zoom_leds_pwm = { | |
218 | + .name = "leds_pwm", | |
219 | + .id = -1, | |
220 | + .dev = { | |
221 | + .platform_data = &zoom_pwm_data, | |
222 | + }, | |
223 | +}; | |
224 | + | |
225 | +static struct platform_pwm_backlight_data zoom_backlight_data = { | |
226 | + .pwm_id = 1, | |
227 | + .max_brightness = 127, | |
228 | + .dft_brightness = 127, | |
229 | + .pwm_period_ns = 7812500, | |
230 | +}; | |
231 | + | |
232 | +static struct platform_device zoom_backlight_pwm = { | |
233 | + .name = "pwm-backlight", | |
234 | + .id = -1, | |
235 | + .dev = { | |
236 | + .platform_data = &zoom_backlight_data, | |
237 | + }, | |
238 | +}; | |
239 | + | |
240 | +static struct platform_device *zoom_devices[] __initdata = { | |
241 | + &omap_vwlan_device, | |
242 | + &zoom_leds_pwm, | |
243 | + &zoom_backlight_pwm, | |
244 | +}; | |
245 | + | |
196 | 246 | static struct wl12xx_platform_data omap_zoom_wlan_data __initdata = { |
197 | 247 | .board_ref_clock = WL12XX_REFCLOCK_26, /* 26 MHz */ |
198 | 248 | }; |
... | ... | @@ -301,7 +351,8 @@ |
301 | 351 | |
302 | 352 | omap_hsmmc_init(mmc); |
303 | 353 | omap_i2c_init(); |
304 | - platform_device_register(&omap_vwlan_device); | |
354 | + pwm_add_table(zoom_pwm_lookup, ARRAY_SIZE(zoom_pwm_lookup)); | |
355 | + platform_add_devices(zoom_devices, ARRAY_SIZE(zoom_devices)); | |
305 | 356 | usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); |
306 | 357 | usb_musb_init(NULL); |
307 | 358 | enable_board_wakeup_source(); |