Re: [PATCH 1/2] leds: lp55xx: handle enable pin in driver
On Tue, Oct 22, 2013 at 10:06 AM, Tony Lindgren t...@atomide.com wrote: * Sebastian Reichel s...@debian.org [131022 06:02]: This patch moves the handling of the chip's enable pin from the board code into the driver. It also updates all board-code files using the driver to incorporate this change. This is needed for device tree support of the enable pin. This seems safe to merge along with the other LED patches, the changes to arch/arm/mach-omap2 should not conflict with anything. So for the arch/arm/mach-omap2 changes: Acked-by: Tony Lindgren t...@atomide.com I'm OK for LED parts, will this patch go through omap tree? If so, please add my ack. Acked-by: Bryan Wu coolo...@gmail.com Thanks, -Bryan -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2] leds: lp55xx: handle enable pin in driver
On Tue, Oct 22, 2013 at 10:37 AM, Tony Lindgren t...@atomide.com wrote: * Bryan Wu coolo...@gmail.com [131022 10:23]: On Tue, Oct 22, 2013 at 10:06 AM, Tony Lindgren t...@atomide.com wrote: * Sebastian Reichel s...@debian.org [131022 06:02]: This patch moves the handling of the chip's enable pin from the board code into the driver. It also updates all board-code files using the driver to incorporate this change. This is needed for device tree support of the enable pin. This seems safe to merge along with the other LED patches, the changes to arch/arm/mach-omap2 should not conflict with anything. So for the arch/arm/mach-omap2 changes: Acked-by: Tony Lindgren t...@atomide.com I'm OK for LED parts, will this patch go through omap tree? If so, please add my ack. Acked-by: Bryan Wu coolo...@gmail.com It's probably best that you take it via with the LED patches. OK, I will do it. what about PATCH 2 of this patch set? Will you take care of it? Thanks, -Bryan -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] DTS: ARM: OMAP3-N900: Add LP5523 support
On Tue, Oct 22, 2013 at 10:38 AM, Tony Lindgren t...@atomide.com wrote: * Sebastian Reichel s...@debian.org [131022 06:02]: Add support for LP5523 device. This patch should be queued separately by Benoit. OK, got it. I will merge Patch 1. -Bryan -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] ARM: OMAP: OMAP_DEBUG_LEDS needs to select LEDS_CLASS
On Tue, Sep 18, 2012 at 11:30 AM, Axel Lin axel@gmail.com wrote: This fixes below build error when CONFIG_LEDS_CLASS is not set. LD init/built-in.o arch/arm/plat-omap/built-in.o: In function `fpga_probe': arch/arm/plat-omap/debug-leds.c:113: undefined reference to `led_classdev_register' make: *** [vmlinux] Error 1 Thanks for posting this. But I think Tony has already fixed it in mainline: -- commit 359f64f7b3997e94ee71039b5fcdc1278b9b77c4 Author: Tony Lindgren t...@atomide.com Date: Wed Sep 15 10:18:51 2010 -0700 omap: Fix compile dependency to LEDS_CLASS If we LEDS_CLASS is not selected, we will get undefined reference to `led_classdev_register'. Signed-off-by: Tony Lindgren t...@atomide.com -- -Bryan Signed-off-by: Axel Lin axel@gmail.com --- arch/arm/plat-omap/Kconfig |1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index ca83a76..c262781 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig @@ -43,6 +43,7 @@ config OMAP_DEBUG_DEVICES config OMAP_DEBUG_LEDS def_bool y if NEW_LEDS + select LEDS_CLASS depends on OMAP_DEBUG_DEVICES config POWER_AVS_OMAP -- 1.7.9.5 -- Bryan Wu bryan...@canonical.com Kernel Developer+86.186-168-78255 Mobile Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] ARM: OMAP: OMAP_DEBUG_LEDS needs to select LEDS_CLASS
On Tue, Sep 18, 2012 at 2:49 PM, Axel Lin axel@gmail.com wrote: 2012/9/18 Bryan Wu bryan...@canonical.com: On Tue, Sep 18, 2012 at 11:30 AM, Axel Lin axel@gmail.com wrote: This fixes below build error when CONFIG_LEDS_CLASS is not set. LD init/built-in.o arch/arm/plat-omap/built-in.o: In function `fpga_probe': arch/arm/plat-omap/debug-leds.c:113: undefined reference to `led_classdev_register' make: *** [vmlinux] Error 1 Thanks for posting this. But I think Tony has already fixed it in mainline: -- commit 359f64f7b3997e94ee71039b5fcdc1278b9b77c4 Author: Tony Lindgren t...@atomide.com Date: Wed Sep 15 10:18:51 2010 -0700 omap: Fix compile dependency to LEDS_CLASS If we LEDS_CLASS is not selected, we will get undefined reference to `led_classdev_register'. Signed-off-by: Tony Lindgren t...@atomide.com Commit 359f64f7b was commited on Sep 15 2010. This patch is against current linux-next tree. I got the build error on linux-next tree (next-20120917). Obviously, linux-next is not updated to latest mainline, -:D Thanks, -- Bryan Wu bryan...@canonical.com Kernel Developer+86.186-168-78255 Mobile Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] leds: leds-gpio: adopt pinctrl support
On Fri, Sep 7, 2012 at 3:59 PM, AnilKumar, Chimata anilku...@ti.com wrote: On Fri, Sep 07, 2012 at 05:39:35, Marek Vasut wrote: Dear Tony Lindgren, * Marek Vasut ma...@denx.de [120905 19:05]: Hi Tony, * Marek Vasut ma...@denx.de [120904 20:13]: Dear Bryan Wu, On Sat, Sep 1, 2012 at 4:16 PM, AnilKumar Ch anilku...@ti.com wrote: Adopt pinctrl support to leds-gpio driver based on leds-gpio device pointer, pinctrl driver configure SoC pins to GPIO mode according to definitions provided in .dts file. Thanks for this, actually Marek Vasut submitted a similar patch before. I'm pretty fine with this patch. Thanks for submitting this actually ... I didn't have time to properly investigate this. But without proper DT setting, it will also give us warning I think. or we can provide some dummy functions as a temp solution as Shawn pointed out before. But this driver is also used on hardware that's not yet coverted to DT, so I'd say dev_warn() if CONFIG_OF is enabled and otherwise simply go on ? Actually, can we not skip whole this pinctrl thing if CONFIG_OF is disabled? Actually (2), what's the relationship between OF and pinctrl? The warning should be pinctrl related as the pinctrl drivers may not be device tree based drivers. Exactly my concern. Also the warning shouldnt be present on systems where pinctrl is disabled. But pinctrl_get_select() returns 0 in include/linux/pinctrl/consumer.h if CONFIG_PINCTRL is not selected, so no warning is produced AFAIK ;) Oh all right then. Bryan, If this patch looks fine, can you queue this for 3.7? I've applied this to my for-next branch. Thanks, -Bryan -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] leds: leds-gpio: adopt pinctrl support
On Sat, Sep 1, 2012 at 4:16 PM, AnilKumar Ch anilku...@ti.com wrote: Adopt pinctrl support to leds-gpio driver based on leds-gpio device pointer, pinctrl driver configure SoC pins to GPIO mode according to definitions provided in .dts file. Thanks for this, actually Marek Vasut submitted a similar patch before. I'm pretty fine with this patch. But without proper DT setting, it will also give us warning I think. or we can provide some dummy functions as a temp solution as Shawn pointed out before. -Bryan Signed-off-by: AnilKumar Ch anilku...@ti.com --- Changes from v1: - Seperated from Add DT for AM33XX devices patch series - Incorporated Tony's comments on v1 * Changed to warning message instead od error return drivers/leds/leds-gpio.c |7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index c032b21..ad577f4 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -20,6 +20,7 @@ #include linux/slab.h #include linux/workqueue.h #include linux/module.h +#include linux/pinctrl/consumer.h struct gpio_led_data { struct led_classdev cdev; @@ -236,8 +237,14 @@ static int __devinit gpio_led_probe(struct platform_device *pdev) { struct gpio_led_platform_data *pdata = pdev-dev.platform_data; struct gpio_leds_priv *priv; + struct pinctrl *pinctrl; int i, ret = 0; + pinctrl = devm_pinctrl_get_select_default(pdev-dev); + if (IS_ERR(pinctrl)) + dev_warn(pdev-dev, + pins are not configured from the driver\n); + if (pdata pdata-num_leds) { priv = devm_kzalloc(pdev-dev, sizeof_gpio_leds_priv(pdata-num_leds), -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-leds in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- Bryan Wu bryan...@canonical.com Kernel Developer+86.186-168-78255 Mobile Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 01/18] led-triggers: create a trigger for CPU activity
On Sat, Apr 7, 2012 at 6:15 AM, Andrew Morton a...@linux-foundation.org wrote: On Fri, 30 Mar 2012 19:58:16 +0800 Bryan Wu bryan...@canonical.com wrote: Attempting to consolidate the ARM LED code, this removes the custom RealView LED trigger code to turn LEDs on and off in response to CPU activity and replace it with a standard trigger. (bryan...@canonical.com: It moves arch/arm/kernel/leds.c syscore stubs into this trigger. It also provides ledtrig_cpu trigger event stub in linux/leds.h. Although it was inspired by ARM work, it can be used in other arch.) ... +#include linux/percpu.h +#include linux/syscore_ops.h +#include leds.h + +#define MAX_NAME_LEN 8 The kernel already has at least eight different definitions of MAX_NAME_LEN. I guess a ninth won't hurt ;) ... +static void __init ledtrig_cpu_register(void) +{ + int cpuid = smp_processor_id(); + struct led_trigger *trig; + char *name = __get_cpu_var(trig_name); + + snprintf(name, MAX_NAME_LEN, cpu%d, cpuid); + led_trigger_register_simple(name, trig); + + pr_info(LED trigger %s indicate activity on CPU %d\n, + trig-name, cpuid); + + __get_cpu_var(cpu_trig) = trig; +} + +static void __exit ledtrig_cpu_unregister(void) +{ + struct led_trigger *trig = __get_cpu_var(cpu_trig); + char *name = __get_cpu_var(trig_name); + + led_trigger_unregister_simple(trig); + __get_cpu_var(cpu_trig) = NULL; + memset(name, 0, MAX_NAME_LEN); +} + +static int __init ledtrig_cpu_init(void) +{ + int cpu; + + for_each_possible_cpu(cpu) + ledtrig_cpu_register(); + + register_syscore_ops(ledtrig_cpu_syscore_ops); + + return 0; +} +module_init(ledtrig_cpu_init); This all looks horridly broken. We call ledtrig_cpu_register() once for each CPU, but we call it on the same CPU each time, and it uses smp_processor_id() which a) is wrong and b) will emit a runtime preemption-is-enabled warning. Indeed, my bad. I've already rewritten this function by using per_cpu() API. I'm assuming this wasn't tested on SMP. It needs to be, please. Yeah, tested on my OMAP4 dual core SMP panda board. Also, the code uses for_each_possible_cpu, ignoring CPU hotplug. That's probably justifiable for this small storage size and not-hotpath code, but the decision should be given prominence and justified in the changelog or, better, in code comments please. I tested with CPU hotplug after this initial function on Panda and added comments. ... The patchset is basically an ARM thing. Is there some ARM tree via which we can get it merged? I put these patches in my git tree, but might need Russell or Arnd to help review and merge. And I just resent the patchset. Thanks, -- Bryan Wu bryan...@canonical.com Kernel Developer +86.186-168-78255 Mobile Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v5 00/18] Introduce a led trigger for CPU activity and consolidate LED driver in ARM
Based on Linus Walleij's ARM LED consolidation work, this patchset introduce a new generic led trigger for CPU not only for ARM but also for others. For enabling CPU idle event, CPU arch code should call ledtrig_cpu() stub to trigger idle start or idle end event. These patches convert old style LED driver in arch/arm to gpio_led or new led driver interface. Against linux-next 20120330 and build successfully for all the machines. Test ledtrig-cpu driver on OMAP4 Panda board. -- root@omap4430-panda:~# dmesg | grep trig [1.891265] LED trigger cpu0 indicate activity on CPU 0 [1.896728] LED trigger cpu1 indicate activity on CPU 1 root@omap4430-panda:~# cat /sys/class/leds/pandaboard\:\:status1/trigger none nand-disk mmc0 mmc1 timer [heartbeat] cpu0 cpu1 root@omap4430-panda:~# cat /sys/class/leds/pandaboard\:\:status2/trigger none nand-disk [mmc0] mmc1 timer heartbeat cpu0 cpu1 root@omap4430-panda:~# echo cpu0 /sys/class/leds/pandaboard\:\:status1/trigger root@omap4430-panda:~# cat /sys/class/leds/pandaboard\:\:status1/trigger none nand-disk mmc0 mmc1 timer heartbeat [cpu0] cpu1 root@omap4430-panda:~# echo cpu1 /sys/class/leds/pandaboard\:\:status2/trigger root@omap4430-panda:~# cat /sys/class/leds/pandaboard\:\:status2/trigger none nand-disk mmc0 mmc1 timer heartbeat cpu0 [cpu1] Then try some heavy task like dd and use taskset to assign the task to a specific CPU, LED will turn on or off as expect -- Please find these patches here: git://kernel.ubuntu.com/roc/linux-2.6/.git leds v4 -- v5: * rebase all the patches on top of latest linux-next * replace on_each_cpu() with for_each_possible_cpu() * add some description of ledtrig_cpu() API * remove old leds code from driver nwflash.c, which should use a new led trigger then * this trigger driver can be built as module now v3 -- v4: * fix a typo pointed by Jochen Friedrich * fix some building errors * add Reviewed-by and Tested-by into patch log v2 -- v3: * almost rewrote the whole ledtrig-cpu driver, which is more simple * every CPU will have a per-CPU trigger * cpu trigger can be assigned to any leds * fix a lockdep issue in led-trigger common code * other fix according to review v1 -- v2: * remove select operations in Kconfig of every machines * add back supporting of led in core module of mach-integrator * solidate name scheme in ledtrig-cpu.c * add comments of CPU_LED_* cpu led events * fold patches of RealView and Versatile together * add machine_is_ check during assabet led driver init * add some Acked-by in patch logs * remove code for simpad machine in machine-sa11000, since Jochen Friedrich introduced gpiolib and gpio-led driver for simpad * on Assabet and Netwinder machine, LED operations is reversed like: setting bit means turn off leds clearing bit means turn on leds * add a new function to read CM_CTRL register for led driver Bryan Wu (18): led-triggers: create a trigger for CPU activity ARM: at91: convert old leds drivers to gpio_led and led_trigger drivers ARM: mach-realview and mach-versatile: retire custom LED code ARM: mach-ks8695: remove leds driver, since nobody use it ARM: mach-shark: retire custom LED code ARM: mach-orion5x: convert custom LED code to gpio_led and LED CPU trigger ARM: mach-integrator: move CM_CTRL to header file for accessing by other functions ARM: mach-integrator: retire custom LED code ARM: mach-clps711x: retire custom LED code of P720T machine ARM: mach-ebsa110: retire custom LED code ARM: mach-footbridge: retire custom LED code char: nwflash: remove old led event code ARM: mach-pxa: retire custom LED code ARM: plat-samsung: remove including old leds event API header file ARM: mach-pnx4008: remove including old leds event API header file ARM: mach-omap1: retire custom LED code ARM: mach-sa1100: retire custom LED code ARM: use new LEDS CPU trigger stub to replace old one arch/arm/Kconfig | 53 - arch/arm/include/asm/leds.h | 50 - arch/arm/kernel/Makefile |1 - arch/arm/kernel/leds.c | 121 --- arch/arm/kernel/process.c|6 +- arch/arm/kernel/time.c | 17 -- arch/arm/mach-at91/board-csb337.c|3 - arch/arm/mach-at91/board-ecbat91.c | 18 ++- arch/arm/mach-at91/board-eco920.c| 23 ++- arch/arm/mach-at91/board-kafa.c | 17 ++- arch/arm/mach-at91/board-kb9202.c| 23 ++- arch/arm/mach-at91/board-rm9200dk.c |3 - arch/arm/mach-at91/board-rm9200ek.c |3 - arch/arm/mach-at91/board-sam9-l9260.c| 23 ++- arch/arm/mach-at91/board-sam9261ek.c |3 - arch/arm/mach-at91/board-yl-9200.c |3 - arch/arm/mach-at91/include/mach/board.h |1 - arch/arm/mach-at91/leds.c| 105 - arch/arm/mach-clps711x/Makefile
[PATCH 01/18] led-triggers: create a trigger for CPU activity
Attempting to consolidate the ARM LED code, this removes the custom RealView LED trigger code to turn LEDs on and off in response to CPU activity and replace it with a standard trigger. (bryan...@canonical.com: It moves arch/arm/kernel/leds.c syscore stubs into this trigger. It also provides ledtrig_cpu trigger event stub in linux/leds.h. Although it was inspired by ARM work, it can be used in other arch.) Cc: Richard Purdie rpur...@rpsys.net Signed-off-by: Linus Walleij linus.wall...@linaro.org Signed-off-by: Bryan Wu bryan...@canonical.com Reviewed-by: Jamie Iles ja...@jamieiles.com Tested-by: Jochen Friedrich joc...@scram.de --- drivers/leds/Kconfig | 10 +++ drivers/leds/Makefile |1 + drivers/leds/ledtrig-cpu.c | 138 include/linux/leds.h | 23 +++ 4 files changed, 172 insertions(+), 0 deletions(-) create mode 100644 drivers/leds/ledtrig-cpu.c diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index ff4b8cf..cf02fb8 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig @@ -448,6 +448,16 @@ config LEDS_TRIGGER_BACKLIGHT If unsure, say N. +config LEDS_TRIGGER_CPU + tristate LED CPU Trigger + depends on LEDS_TRIGGERS + help + This allows LEDs to be controlled by active CPUs. This shows + the active CPUs across an array of LEDs so you can see what + CPUs are active on the system at any given moment. + + If unsure, say N. + config LEDS_TRIGGER_GPIO tristate LED GPIO Trigger depends on LEDS_TRIGGERS diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile index 890481c..0a3d5ad 100644 --- a/drivers/leds/Makefile +++ b/drivers/leds/Makefile @@ -55,4 +55,5 @@ obj-$(CONFIG_LEDS_TRIGGER_IDE_DISK) += ledtrig-ide-disk.o obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT) += ledtrig-heartbeat.o obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT) += ledtrig-backlight.o obj-$(CONFIG_LEDS_TRIGGER_GPIO)+= ledtrig-gpio.o +obj-$(CONFIG_LEDS_TRIGGER_CPU) += ledtrig-cpu.o obj-$(CONFIG_LEDS_TRIGGER_DEFAULT_ON) += ledtrig-default-on.o diff --git a/drivers/leds/ledtrig-cpu.c b/drivers/leds/ledtrig-cpu.c new file mode 100644 index 000..d48c4b5 --- /dev/null +++ b/drivers/leds/ledtrig-cpu.c @@ -0,0 +1,138 @@ +/* + * ledtrig-cpu.c - LED trigger based on CPU activity + * + * This LED trigger will be registered for each possible CPU and named as + * cpu0, cpu1, cpu2, cpu3, etc. + * + * It can be binded with any LEDs as other triggers does, either in board + * file or via sysfs interface. + * + * An API named ledtrig_cpu is exported for any user, who want to add CPU + * activity indication in their code + * + * Copyright 2011 Linus Walleij linus.wall...@linaro.org + * Copyright 2011 - 2012 Bryan Wu bryan...@canonical.com + * + * 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 linux/module.h +#include linux/kernel.h +#include linux/init.h +#include linux/slab.h +#include linux/percpu.h +#include linux/syscore_ops.h +#include leds.h + +#define MAX_NAME_LEN 8 + +static DEFINE_PER_CPU(struct led_trigger *, cpu_trig); +static DEFINE_PER_CPU(char [MAX_NAME_LEN], trig_name); + +void ledtrig_cpu(enum cpu_led_event ledevt) +{ + struct led_trigger *trig = __get_cpu_var(cpu_trig); + + if (!trig) + return; + + /* Locate the correct CPU LED */ + switch (ledevt) { + case CPU_LED_IDLE_END: + case CPU_LED_START: + /* Will turn the LED on, max brightness */ + led_trigger_event(trig, LED_FULL); + break; + + case CPU_LED_IDLE_START: + case CPU_LED_STOP: + case CPU_LED_HALTED: + /* Will turn the LED off */ + led_trigger_event(trig, LED_OFF); + break; + + default: + /* Will leave the LED as it is */ + break; + } +} +EXPORT_SYMBOL(ledtrig_cpu); + +static int ledtrig_cpu_syscore_suspend(void) +{ + ledtrig_cpu(CPU_LED_STOP); + return 0; +} + +static void ledtrig_cpu_syscore_resume(void) +{ + ledtrig_cpu(CPU_LED_START); +} + +static void ledtrig_cpu_syscore_shutdown(void) +{ + ledtrig_cpu(CPU_LED_HALTED); +} + +static struct syscore_ops ledtrig_cpu_syscore_ops = { + .shutdown = ledtrig_cpu_syscore_shutdown, + .suspend= ledtrig_cpu_syscore_suspend, + .resume = ledtrig_cpu_syscore_resume, +}; + +static void __init ledtrig_cpu_register(void) +{ + int cpuid = smp_processor_id(); + struct led_trigger *trig; + char *name = __get_cpu_var(trig_name); + + snprintf(name, MAX_NAME_LEN, cpu%d, cpuid); + led_trigger_register_simple(name, trig); + + pr_info(LED trigger %s indicate activity on CPU %d\n, + trig-name, cpuid
[PATCH 03/18] ARM: mach-realview and mach-versatile: retire custom LED code
This replaces the custom LED trigger code in mach-realview with some overarching platform code for the plat-versatile family that will lock down LEDs 2 thru 5 for CPU activity indication. The day we have 8 core ARM systems the plat-versatile code will have to become more elaborate. Tested on RealView PB11MPCore by invoking four different CPU hogs (yes /dev/null) and see the LEDs go on one at a time. They all go off as the hogs are killed. Tested on the PB1176 as well - just one activity led (led 2) goes on and off with CPU activity. (bryan...@canonical.com: use ledtrig-cpu instead of ledtrig-arm-cpu) Cc: Richard Purdie rpur...@rpsys.net Signed-off-by: Linus Walleij linus.wall...@linaro.org Signed-off-by: Bryan Wu bryan...@canonical.com Acked-by: Pawel Moll pawel.m...@arm.com --- arch/arm/mach-realview/core.c| 39 -- arch/arm/mach-realview/core.h|2 - arch/arm/mach-realview/realview_eb.c |5 arch/arm/mach-realview/realview_pb1176.c |5 arch/arm/mach-realview/realview_pb11mp.c |5 arch/arm/mach-realview/realview_pba8.c |5 arch/arm/mach-realview/realview_pbx.c|5 arch/arm/mach-versatile/core.c |5 arch/arm/plat-versatile/Kconfig |4 ++- arch/arm/plat-versatile/leds.c | 13 +++--- 10 files changed, 12 insertions(+), 76 deletions(-) diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index 45868bb..d22dee9 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c @@ -35,7 +35,6 @@ #include mach/hardware.h #include asm/irq.h -#include asm/leds.h #include asm/mach-types.h #include asm/hardware/arm_timer.h #include asm/hardware/icst.h @@ -436,44 +435,6 @@ struct clcd_board clcd_plat_data = { .remove = versatile_clcd_remove_dma, }; -#ifdef CONFIG_LEDS -#define VA_LEDS_BASE (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LED_OFFSET) - -void realview_leds_event(led_event_t ledevt) -{ - unsigned long flags; - u32 val; - u32 led = 1 smp_processor_id(); - - local_irq_save(flags); - val = readl(VA_LEDS_BASE); - - switch (ledevt) { - case led_idle_start: - val = val ~led; - break; - - case led_idle_end: - val = val | led; - break; - - case led_timer: - val = val ^ REALVIEW_SYS_LED7; - break; - - case led_halted: - val = 0; - break; - - default: - break; - } - - writel(val, VA_LEDS_BASE); - local_irq_restore(flags); -} -#endif /* CONFIG_LEDS */ - /* * Where is the timer (VA)? */ diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h index f8f2c0a..f2141ae 100644 --- a/arch/arm/mach-realview/core.h +++ b/arch/arm/mach-realview/core.h @@ -26,7 +26,6 @@ #include linux/io.h #include asm/setup.h -#include asm/leds.h #define APB_DEVICE(name, busid, base, plat)\ static AMBA_APB_DEVICE(name, busid, 0, REALVIEW_##base##_BASE, base##_IRQ, plat) @@ -47,7 +46,6 @@ extern void __iomem *timer1_va_base; extern void __iomem *timer2_va_base; extern void __iomem *timer3_va_base; -extern void realview_leds_event(led_event_t ledevt); extern void realview_timer_init(unsigned int timer_irq); extern int realview_flash_register(struct resource *res, u32 num); extern int realview_eth_register(const char *name, struct resource *res); diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c index baf382c..21661ad 100644 --- a/arch/arm/mach-realview/realview_eb.c +++ b/arch/arm/mach-realview/realview_eb.c @@ -30,7 +30,6 @@ #include mach/hardware.h #include asm/irq.h -#include asm/leds.h #include asm/mach-types.h #include asm/pmu.h #include asm/pgtable.h @@ -462,10 +461,6 @@ static void __init realview_eb_init(void) struct amba_device *d = amba_devs[i]; amba_device_register(d, iomem_resource); } - -#ifdef CONFIG_LEDS - leds_event = realview_leds_event; -#endif } MACHINE_START(REALVIEW_EB, ARM-RealView EB) diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c index b1d7caf..c0ff882 100644 --- a/arch/arm/mach-realview/realview_pb1176.c +++ b/arch/arm/mach-realview/realview_pb1176.c @@ -32,7 +32,6 @@ #include mach/hardware.h #include asm/irq.h -#include asm/leds.h #include asm/mach-types.h #include asm/pmu.h #include asm/pgtable.h @@ -375,10 +374,6 @@ static void __init realview_pb1176_init(void) struct amba_device *d = amba_devs[i]; amba_device_register(d, iomem_resource); } - -#ifdef CONFIG_LEDS - leds_event = realview_leds_event; -#endif } MACHINE_START(REALVIEW_PB1176, ARM-RealView PB1176) diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach
[PATCH 02/18] ARM: at91: convert old leds drivers to gpio_led and led_trigger drivers
Build with at91 defconfigs successfully Signed-off-by: Bryan Wu bryan...@canonical.com Acked-by: Nicolas Ferre nicolas.fe...@atmel.com --- arch/arm/mach-at91/board-csb337.c |3 - arch/arm/mach-at91/board-ecbat91.c | 18 +- arch/arm/mach-at91/board-eco920.c | 23 ++- arch/arm/mach-at91/board-kafa.c | 17 - arch/arm/mach-at91/board-kb9202.c | 23 ++- arch/arm/mach-at91/board-rm9200dk.c |3 - arch/arm/mach-at91/board-rm9200ek.c |3 - arch/arm/mach-at91/board-sam9-l9260.c | 23 ++- arch/arm/mach-at91/board-sam9261ek.c|3 - arch/arm/mach-at91/board-yl-9200.c |3 - arch/arm/mach-at91/include/mach/board.h |1 - arch/arm/mach-at91/leds.c | 105 --- 12 files changed, 89 insertions(+), 136 deletions(-) diff --git a/arch/arm/mach-at91/board-csb337.c b/arch/arm/mach-at91/board-csb337.c index 1a1547b..ce2eea3 100644 --- a/arch/arm/mach-at91/board-csb337.c +++ b/arch/arm/mach-at91/board-csb337.c @@ -48,9 +48,6 @@ static void __init csb337_init_early(void) /* Initialize processor: 3.6864 MHz crystal */ at91_initialize(3686400); - /* Setup the LEDs */ - at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1); - /* DBGU on ttyS0 */ at91_register_uart(0, 0, 0); diff --git a/arch/arm/mach-at91/board-ecbat91.c b/arch/arm/mach-at91/board-ecbat91.c index 69966ce..da671f5 100644 --- a/arch/arm/mach-at91/board-ecbat91.c +++ b/arch/arm/mach-at91/board-ecbat91.c @@ -51,9 +51,6 @@ static void __init ecb_at91init_early(void) /* Initialize processor: 18.432 MHz crystal */ at91_initialize(18432000); - /* Setup the LEDs */ - at91_init_leds(AT91_PIN_PC7, AT91_PIN_PC7); - /* DBGU on ttyS0. (Rx Tx only) */ at91_register_uart(0, 0, 0); @@ -149,6 +146,18 @@ static struct spi_board_info __initdata ecb_at91spi_devices[] = { }, }; +/* + * LEDs + */ +static struct gpio_led ecb_leds[] = { + { /* D1 */ + .name = led1, + .gpio = AT91_PIN_PC7, + .active_low = 1, + .default_trigger= heartbeat, + } +}; + static void __init ecb_at91board_init(void) { /* Serial */ @@ -168,6 +177,9 @@ static void __init ecb_at91board_init(void) /* SPI */ at91_add_device_spi(ecb_at91spi_devices, ARRAY_SIZE(ecb_at91spi_devices)); + + /* LEDs */ + at91_gpio_leds(ecb_leds, ARRAY_SIZE(ecb_leds)); } MACHINE_START(ECBAT91, emQbit's ECB_AT91) diff --git a/arch/arm/mach-at91/board-eco920.c b/arch/arm/mach-at91/board-eco920.c index f23aabe..3484eac 100644 --- a/arch/arm/mach-at91/board-eco920.c +++ b/arch/arm/mach-at91/board-eco920.c @@ -38,9 +38,6 @@ static void __init eco920_init_early(void) at91_initialize(18432000); - /* Setup the LEDs */ - at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1); - /* DBGU on ttyS0. (Rx Tx only */ at91_register_uart(0, 0, 0); @@ -101,6 +98,24 @@ static struct spi_board_info eco920_spi_devices[] = { }, }; +/* + * LEDs + */ +static struct gpio_led eco920_leds[] = { + { /* D1 */ + .name = led1, + .gpio = AT91_PIN_PB0, + .active_low = 1, + .default_trigger= heartbeat, + }, + { /* D2 */ + .name = led2, + .gpio = AT91_PIN_PB1, + .active_low = 1, + .default_trigger= timer, + } +}; + static void __init eco920_board_init(void) { at91_add_device_serial(); @@ -131,6 +146,8 @@ static void __init eco920_board_init(void) ); at91_add_device_spi(eco920_spi_devices, ARRAY_SIZE(eco920_spi_devices)); + /* LEDs */ + at91_gpio_leds(eco920_leds, ARRAY_SIZE(eco920_leds)); } MACHINE_START(ECO920, eco920) diff --git a/arch/arm/mach-at91/board-kafa.c b/arch/arm/mach-at91/board-kafa.c index efde1b2..bcd7f44 100644 --- a/arch/arm/mach-at91/board-kafa.c +++ b/arch/arm/mach-at91/board-kafa.c @@ -48,9 +48,6 @@ static void __init kafa_init_early(void) /* Initialize processor: 18.432 MHz crystal */ at91_initialize(18432000); - /* Set up the LEDs */ - at91_init_leds(AT91_PIN_PB4, AT91_PIN_PB4); - /* DBGU on ttyS0. (Rx Tx only) */ at91_register_uart(0, 0, 0); @@ -77,6 +74,18 @@ static struct at91_udc_data __initdata kafa_udc_data = { .pullup_pin = AT91_PIN_PB7, }; +/* + * LEDs + */ +static struct gpio_led kafa_leds[] = { + { /* D1 */ + .name = led1, + .gpio = AT91_PIN_PB4, + .active_low = 1, + .default_trigger= heartbeat
[PATCH 04/18] ARM: mach-ks8695: remove leds driver, since nobody use it
Signed-off-by: Bryan Wu bryan...@canonical.com Acked-by: Andrew Victor li...@maxim.org.za --- arch/arm/mach-ks8695/Makefile |3 - arch/arm/mach-ks8695/devices.c | 21 -- arch/arm/mach-ks8695/include/mach/devices.h |5 -- arch/arm/mach-ks8695/leds.c | 92 --- 4 files changed, 0 insertions(+), 121 deletions(-) delete mode 100644 arch/arm/mach-ks8695/leds.c diff --git a/arch/arm/mach-ks8695/Makefile b/arch/arm/mach-ks8695/Makefile index 853efd9..9324ef9 100644 --- a/arch/arm/mach-ks8695/Makefile +++ b/arch/arm/mach-ks8695/Makefile @@ -11,9 +11,6 @@ obj- := # PCI support is optional obj-$(CONFIG_PCI) += pci.o -# LEDs -obj-$(CONFIG_LEDS) += leds.o - # Board-specific support obj-$(CONFIG_MACH_KS8695) += board-micrel.o obj-$(CONFIG_MACH_DSM320) += board-dsm320.o diff --git a/arch/arm/mach-ks8695/devices.c b/arch/arm/mach-ks8695/devices.c index 73bd638..47399bc 100644 --- a/arch/arm/mach-ks8695/devices.c +++ b/arch/arm/mach-ks8695/devices.c @@ -182,27 +182,6 @@ static void __init ks8695_add_device_watchdog(void) } -/* - * LEDs - * */ - -#if defined(CONFIG_LEDS) -short ks8695_leds_cpu = -1; -short ks8695_leds_timer = -1; - -void __init ks8695_init_leds(u8 cpu_led, u8 timer_led) -{ - /* Enable GPIO to access the LEDs */ - gpio_direction_output(cpu_led, 1); - gpio_direction_output(timer_led, 1); - - ks8695_leds_cpu = cpu_led; - ks8695_leds_timer = timer_led; -} -#else -void __init ks8695_init_leds(u8 cpu_led, u8 timer_led) {} -#endif - /* */ /* diff --git a/arch/arm/mach-ks8695/include/mach/devices.h b/arch/arm/mach-ks8695/include/mach/devices.h index 85a3c9a..1e6594a 100644 --- a/arch/arm/mach-ks8695/include/mach/devices.h +++ b/arch/arm/mach-ks8695/include/mach/devices.h @@ -18,11 +18,6 @@ extern void __init ks8695_add_device_wan(void); extern void __init ks8695_add_device_lan(void); extern void __init ks8695_add_device_hpna(void); - /* LEDs */ -extern short ks8695_leds_cpu; -extern short ks8695_leds_timer; -extern void __init ks8695_init_leds(u8 cpu_led, u8 timer_led); - /* PCI */ #define KS8695_MODE_PCI0 #define KS8695_MODE_MINIPCI1 diff --git a/arch/arm/mach-ks8695/leds.c b/arch/arm/mach-ks8695/leds.c deleted file mode 100644 index 4bd7075..000 --- a/arch/arm/mach-ks8695/leds.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * LED driver for KS8695-based boards. - * - * Copyright (C) Andrew Victor - * - * 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 linux/gpio.h -#include linux/kernel.h -#include linux/module.h -#include linux/init.h - -#include asm/leds.h -#include mach/devices.h - - -static inline void ks8695_led_on(unsigned int led) -{ - gpio_set_value(led, 0); -} - -static inline void ks8695_led_off(unsigned int led) -{ - gpio_set_value(led, 1); -} - -static inline void ks8695_led_toggle(unsigned int led) -{ - unsigned long is_off = gpio_get_value(led); - if (is_off) - ks8695_led_on(led); - else - ks8695_led_off(led); -} - - -/* - * Handle LED events. - */ -static void ks8695_leds_event(led_event_t evt) -{ - unsigned long flags; - - local_irq_save(flags); - - switch(evt) { - case led_start: /* System startup */ - ks8695_led_on(ks8695_leds_cpu); - break; - - case led_stop: /* System stop / suspend */ - ks8695_led_off(ks8695_leds_cpu); - break; - -#ifdef CONFIG_LEDS_TIMER - case led_timer: /* Every 50 timer ticks */ - ks8695_led_toggle(ks8695_leds_timer); - break; -#endif - -#ifdef CONFIG_LEDS_CPU - case led_idle_start:/* Entering idle state */ - ks8695_led_off(ks8695_leds_cpu); - break; - - case led_idle_end: /* Exit idle state */ - ks8695_led_on(ks8695_leds_cpu); - break; -#endif - - default: - break; - } - - local_irq_restore(flags); -} - - -static int __init leds_init(void) -{ - if ((ks8695_leds_timer == -1) || (ks8695_leds_cpu == -1)) - return -ENODEV; - - leds_event = ks8695_leds_event; - - leds_event(led_start); - return 0; -} - -__initcall(leds_init); -- 1.7.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 05/18] ARM: mach-shark: retire custom LED code
The CPU activity LED is now handled by the trigger in the leds subsystem, retire this old CONFIG_LEDS-based code. Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-shark/Makefile |4 +- arch/arm/mach-shark/core.c |1 - arch/arm/mach-shark/leds.c | 226 - 3 files changed, 89 insertions(+), 142 deletions(-) diff --git a/arch/arm/mach-shark/Makefile b/arch/arm/mach-shark/Makefile index 45be9b0..2965718 100644 --- a/arch/arm/mach-shark/Makefile +++ b/arch/arm/mach-shark/Makefile @@ -4,9 +4,7 @@ # Object file lists. -obj-y := core.o dma.o irq.o pci.o +obj-y := core.o dma.o irq.o pci.o leds.o obj-m := obj-n := obj- := - -obj-$(CONFIG_LEDS) += leds.o diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c index 6a2a7f2..58f6c65 100644 --- a/arch/arm/mach-shark/core.c +++ b/arch/arm/mach-shark/core.c @@ -13,7 +13,6 @@ #include asm/setup.h #include asm/mach-types.h -#include asm/leds.h #include asm/param.h #include asm/mach/map.h diff --git a/arch/arm/mach-shark/leds.c b/arch/arm/mach-shark/leds.c index 2560907..55433b0 100644 --- a/arch/arm/mach-shark/leds.c +++ b/arch/arm/mach-shark/leds.c @@ -1,165 +1,115 @@ /* - * arch/arm/mach-shark/leds.c - * by Alexander Schulz - * - * derived from: - * arch/arm/kernel/leds-footbridge.c - * Copyright (C) 1998-1999 Russell King - * * DIGITAL Shark LED control routines. * - * The leds use is as follows: - * - Green front - toggles state every 50 timer interrupts - * - Amber front - Unused, this is a dual color led (Amber/Green) - * - Amber back - On if system is not idle + * Driver for the 3 user LEDs found on the Shark + * Based on Versatile and RealView machine LED code * - * Changelog: + * License terms: GNU General Public License (GPL) version 2 + * Author: Bryan Wu bryan...@canonical.com */ #include linux/kernel.h -#include linux/module.h #include linux/init.h -#include linux/spinlock.h -#include linux/ioport.h #include linux/io.h +#include linux/ioport.h +#include linux/slab.h +#include linux/leds.h -#include asm/leds.h +#include asm/mach-types.h -#define LED_STATE_ENABLED 1 -#define LED_STATE_CLAIMED 2 +struct shark_led { + struct led_classdev cdev; + u8 mask; +}; -#define SEQUOIA_LED_GREEN (16) -#define SEQUOIA_LED_AMBER (15) -#define SEQUOIA_LED_BACK(17) +/* + * The triggers lines up below will only be used if the + * LED triggers are compiled in. + */ +static const struct { + const char *name; + const char *trigger; +} shark_leds[] = { + { shark:amber0, default-on, }, /* Bit 5 */ + { shark:green, heartbeat, },/* Bit 6 */ + { shark:amber1, cpu0 }, /* Bit 7 */ +}; + +static u16 led_reg_read(void) +{ + outw(0x09, 0x24); + return inw(0x26); +} -static char led_state; -static short hw_led_state; -static short saved_state; +static void led_reg_write(u16 value) +{ + outw(0x09, 0x24); + outw(value, 0x26); +} -static DEFINE_RAW_SPINLOCK(leds_lock); +static void shark_led_set(struct led_classdev *cdev, + enum led_brightness b) +{ + struct shark_led *led = container_of(cdev, +struct shark_led, cdev); + u16 reg = led_reg_read(); -short sequoia_read(int addr) { - outw(addr,0x24); - return inw(0x26); -} + if (b != LED_OFF) + reg |= led-mask; + else + reg = ~led-mask; -void sequoia_write(short value,short addr) { - outw(addr,0x24); - outw(value,0x26); + led_reg_write(reg); } -static void sequoia_leds_event(led_event_t evt) +static enum led_brightness shark_led_get(struct led_classdev *cdev) { - unsigned long flags; - - raw_spin_lock_irqsave(leds_lock, flags); - - hw_led_state = sequoia_read(0x09); - - switch (evt) { - case led_start: - hw_led_state |= SEQUOIA_LED_GREEN; - hw_led_state |= SEQUOIA_LED_AMBER; -#ifdef CONFIG_LEDS_CPU - hw_led_state |= SEQUOIA_LED_BACK; -#else - hw_led_state = ~SEQUOIA_LED_BACK; -#endif - led_state |= LED_STATE_ENABLED; - break; - - case led_stop: - hw_led_state = ~SEQUOIA_LED_BACK; - hw_led_state |= SEQUOIA_LED_GREEN; - hw_led_state |= SEQUOIA_LED_AMBER; - led_state = ~LED_STATE_ENABLED; - break; - - case led_claim: - led_state |= LED_STATE_CLAIMED; - saved_state = hw_led_state; - hw_led_state = ~SEQUOIA_LED_BACK; - hw_led_state |= SEQUOIA_LED_GREEN; - hw_led_state |= SEQUOIA_LED_AMBER; - break; - - case led_release: - led_state = ~LED_STATE_CLAIMED; - hw_led_state
[PATCH 06/18] ARM: mach-orion5x: convert custom LED code to gpio_led and LED CPU trigger
Signed-off-by: Bryan Wu bryan...@canonical.com Acked-by: Nicolas Pitre n...@fluxnic.net --- arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c |1 - arch/arm/mach-orion5x/rd88f5181l-ge-setup.c |1 - arch/arm/mach-orion5x/rd88f5182-setup.c | 72 -- arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c |1 - 4 files changed, 22 insertions(+), 53 deletions(-) diff --git a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c index 292038f..698ad13 100644 --- a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c +++ b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c @@ -18,7 +18,6 @@ #include linux/ethtool.h #include net/dsa.h #include asm/mach-types.h -#include asm/leds.h #include asm/mach/arch.h #include asm/mach/pci.h #include mach/orion5x.h diff --git a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c index c44eaba..0379f5b 100644 --- a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c +++ b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c @@ -19,7 +19,6 @@ #include linux/i2c.h #include net/dsa.h #include asm/mach-types.h -#include asm/leds.h #include asm/mach/arch.h #include asm/mach/pci.h #include mach/orion5x.h diff --git a/arch/arm/mach-orion5x/rd88f5182-setup.c b/arch/arm/mach-orion5x/rd88f5182-setup.c index e3ce617..8bc8962 100644 --- a/arch/arm/mach-orion5x/rd88f5182-setup.c +++ b/arch/arm/mach-orion5x/rd88f5182-setup.c @@ -19,8 +19,8 @@ #include linux/mv643xx_eth.h #include linux/ata_platform.h #include linux/i2c.h +#include linux/leds.h #include asm/mach-types.h -#include asm/leds.h #include asm/mach/arch.h #include asm/mach/pci.h #include mach/orion5x.h @@ -53,12 +53,6 @@ #define RD88F5182_PCI_SLOT0_IRQ_A_PIN 7 #define RD88F5182_PCI_SLOT0_IRQ_B_PIN 6 -/* - * GPIO Debug LED - */ - -#define RD88F5182_GPIO_DBG_LED 0 - /* * 16M NOR Flash on Device bus CS1 / @@ -83,55 +77,32 @@ static struct platform_device rd88f5182_nor_flash = { .resource = rd88f5182_nor_flash_resource, }; -#ifdef CONFIG_LEDS - /* - * Use GPIO debug led as CPU active indication + * Use GPIO LED as CPU active indication / -static void rd88f5182_dbgled_event(led_event_t evt) -{ - int val; - - if (evt == led_idle_end) - val = 1; - else if (evt == led_idle_start) - val = 0; - else - return; - - gpio_set_value(RD88F5182_GPIO_DBG_LED, val); -} - -static int __init rd88f5182_dbgled_init(void) -{ - int pin; - - if (machine_is_rd88f5182()) { - pin = RD88F5182_GPIO_DBG_LED; +#define RD88F5182_GPIO_LED 0 - if (gpio_request(pin, DBGLED) == 0) { - if (gpio_direction_output(pin, 0) != 0) { - printk(KERN_ERR rd88f5182_dbgled_init failed - to set output pin %d\n, pin); - gpio_free(pin); - return 0; - } - } else { - printk(KERN_ERR rd88f5182_dbgled_init failed - to request gpio %d\n, pin); - return 0; - } - - leds_event = rd88f5182_dbgled_event; - } - - return 0; -} +static struct gpio_led rd88f5182_gpio_led_pins[] = { + { + .name = rd88f5182:cpu, + .default_trigger = cpu0, + .gpio = RD88F5182_GPIO_LED, + }, +}; -__initcall(rd88f5182_dbgled_init); +static struct gpio_led_platform_data rd88f5182_gpio_led_data = { + .leds = rd88f5182_gpio_led_pins, + .num_leds = ARRAY_SIZE(rd88f5182_gpio_led_pins), +}; -#endif +static struct platform_device rd88f5182_gpio_leds = { + .name = leds-gpio, + .id = -1, + .dev= { + .platform_data = rd88f5182_gpio_led_data, + }, +}; /* * PCI @@ -299,6 +270,7 @@ static void __init rd88f5182_init(void) orion5x_setup_dev1_win(RD88F5182_NOR_BASE, RD88F5182_NOR_SIZE); platform_device_register(rd88f5182_nor_flash); + platform_device_register(rd88f5182_gpio_leds); i2c_register_board_info(0, rd88f5182_i2c_rtc, 1); } diff --git a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c index 2c5fab0..e2fd500 100644 --- a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c +++ b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c @@ -21,7 +21,6 @@ #include
[PATCH 08/18] ARM: mach-integrator: retire custom LED code
Use the LED in core module for CPU activity and also enable 4 debugging LEDs in baseboard. The CPU activity LED is now handled by the trigger in the leds subsystem, retire this old CONFIG_LEDS-based code. Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-integrator/Makefile |3 +- arch/arm/mach-integrator/core.c |1 - arch/arm/mach-integrator/leds.c | 158 ++--- 3 files changed, 96 insertions(+), 66 deletions(-) diff --git a/arch/arm/mach-integrator/Makefile b/arch/arm/mach-integrator/Makefile index ebeef96..5521d18 100644 --- a/arch/arm/mach-integrator/Makefile +++ b/arch/arm/mach-integrator/Makefile @@ -4,11 +4,10 @@ # Object file lists. -obj-y := core.o lm.o +obj-y := core.o lm.o leds.o obj-$(CONFIG_ARCH_INTEGRATOR_AP) += integrator_ap.o obj-$(CONFIG_ARCH_INTEGRATOR_CP) += integrator_cp.o -obj-$(CONFIG_LEDS) += leds.o obj-$(CONFIG_PCI) += pci_v3.o pci.o obj-$(CONFIG_CPU_FREQ_INTEGRATOR) += cpu.o obj-$(CONFIG_INTEGRATOR_IMPD1) += impd1.o diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c index 8c53562..0c7c4ef 100644 --- a/arch/arm/mach-integrator/core.c +++ b/arch/arm/mach-integrator/core.c @@ -28,7 +28,6 @@ #include mach/cm.h #include mach/irqs.h -#include asm/leds.h #include asm/mach-types.h #include asm/mach/time.h #include asm/pgtable.h diff --git a/arch/arm/mach-integrator/leds.c b/arch/arm/mach-integrator/leds.c index 466defa..dab912b 100644 --- a/arch/arm/mach-integrator/leds.c +++ b/arch/arm/mach-integrator/leds.c @@ -1,90 +1,122 @@ /* - * linux/arch/arm/mach-integrator/leds.c + * Driver for the 4 user LEDs found on the Integrator AP/CP baseboard + * Based on Versatile and RealView machine LED code * - * Integrator/AP and Integrator/CP LED control routines - * - * Copyright (C) 1999 ARM Limited - * Copyright (C) 2000 Deep Blue Solutions Ltd - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License terms: GNU General Public License (GPL) version 2 + * Author: Bryan Wu bryan...@canonical.com */ #include linux/kernel.h #include linux/init.h -#include linux/smp.h -#include linux/spinlock.h #include linux/io.h +#include linux/slab.h +#include linux/leds.h +#include mach/cm.h #include mach/hardware.h #include mach/platform.h -#include asm/leds.h -#include asm/mach-types.h -#include mach/cm.h -static int saved_leds; +#define ALPHA_REG __io_address(INTEGRATOR_DBG_BASE) +#define LEDREG (__io_address(INTEGRATOR_DBG_BASE) + INTEGRATOR_DBG_LEDS_OFFSET) + +struct integrator_led { + struct led_classdev cdev; + u8 mask; +}; + +/* + * The triggers lines up below will only be used if the + * LED triggers are compiled in. + */ +static const struct { + const char *name; + const char *trigger; +} integrator_leds[] = { + { integrator:green0, heartbeat, }, + { integrator:yellow, }, + { integrator:red, }, + { integrator:green1, }, + { integrator:core_module, cpu0, }, +}; -static void integrator_leds_event(led_event_t ledevt) +static void integrator_led_set(struct led_classdev *cdev, + enum led_brightness b) { - unsigned long flags; - const unsigned int dbg_base = IO_ADDRESS(INTEGRATOR_DBG_BASE); - unsigned int update_alpha_leds; + struct integrator_led *led = container_of(cdev, +struct integrator_led, cdev); + u32 reg = __raw_readl(LEDREG); - // yup, change the LEDs - local_irq_save(flags); - update_alpha_leds = 0; + if (b != LED_OFF) + reg |= led-mask; + else + reg = ~led-mask; - switch(ledevt) { - case led_idle_start: - cm_control(CM_CTRL_LED, 0); - break; + while (__raw_readl(ALPHA_REG) 1) + cpu_relax(); - case led_idle_end: - cm_control(CM_CTRL_LED, CM_CTRL_LED); - break; + __raw_writel(reg, LEDREG); +} - case led_timer: - saved_leds ^= GREEN_LED; - update_alpha_leds = 1; - break; +static
[PATCH 09/18] ARM: mach-clps711x: retire custom LED code of P720T machine
Add tigger based LED driver into board file of P720T. Remove old LED driver file. Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-clps711x/Makefile|2 - arch/arm/mach-clps711x/common.c|1 - arch/arm/mach-clps711x/include/mach/time.h |2 - arch/arm/mach-clps711x/p720t-leds.c| 66 arch/arm/mach-clps711x/p720t.c | 59 + 5 files changed, 59 insertions(+), 71 deletions(-) delete mode 100644 arch/arm/mach-clps711x/p720t-leds.c diff --git a/arch/arm/mach-clps711x/Makefile b/arch/arm/mach-clps711x/Makefile index f2f0256..5872b49 100644 --- a/arch/arm/mach-clps711x/Makefile +++ b/arch/arm/mach-clps711x/Makefile @@ -16,5 +16,3 @@ obj-$(CONFIG_ARCH_CLEP7312) += clep7312.o obj-$(CONFIG_ARCH_EDB7211) += edb7211-arch.o edb7211-mm.o obj-$(CONFIG_ARCH_FORTUNET) += fortunet.o obj-$(CONFIG_ARCH_P720T)+= p720t.o -leds-$(CONFIG_ARCH_P720T) += p720t-leds.o -obj-$(CONFIG_LEDS) += $(leds-y) diff --git a/arch/arm/mach-clps711x/common.c b/arch/arm/mach-clps711x/common.c index 3c5b5bb..c9ba167 100644 --- a/arch/arm/mach-clps711x/common.c +++ b/arch/arm/mach-clps711x/common.c @@ -31,7 +31,6 @@ #include asm/sizes.h #include mach/hardware.h #include asm/irq.h -#include asm/leds.h #include asm/pgtable.h #include asm/page.h #include asm/mach/map.h diff --git a/arch/arm/mach-clps711x/include/mach/time.h b/arch/arm/mach-clps711x/include/mach/time.h index 61fef91..bafc325 100644 --- a/arch/arm/mach-clps711x/include/mach/time.h +++ b/arch/arm/mach-clps711x/include/mach/time.h @@ -17,7 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include asm/leds.h #include asm/hardware/clps7111.h extern void clps711x_setup_timer(void); @@ -29,7 +28,6 @@ static irqreturn_t p720t_timer_interrupt(int irq, void *dev_id) { struct pt_regs *regs = get_irq_regs(); - do_leds(); xtime_update(1); #ifndef CONFIG_SMP update_process_times(user_mode(regs)); diff --git a/arch/arm/mach-clps711x/p720t-leds.c b/arch/arm/mach-clps711x/p720t-leds.c deleted file mode 100644 index dd9a6cd..000 --- a/arch/arm/mach-clps711x/p720t-leds.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * linux/arch/arm/mach-clps711x/leds.c - * - * Integrator LED control routines - * - * Copyright (C) 2000 Deep Blue Solutions Ltd - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include linux/kernel.h -#include linux/init.h -#include linux/io.h - -#include mach/hardware.h -#include asm/leds.h -#include asm/mach-types.h - -#include asm/hardware/clps7111.h -#include asm/hardware/ep7212.h - -static void p720t_leds_event(led_event_t ledevt) -{ - unsigned long flags; - u32 pddr; - - local_irq_save(flags); - switch(ledevt) { - case led_idle_start: - break; - - case led_idle_end: - break; - - case led_timer: - pddr = clps_readb(PDDR); - clps_writeb(pddr ^ 1, PDDR); - break; - - default: - break; - } - - local_irq_restore(flags); -} - -static int __init leds_init(void) -{ - if (machine_is_p720t()) - leds_event = p720t_leds_event; - - return 0; -} - -arch_initcall(leds_init); diff --git a/arch/arm/mach-clps711x/p720t.c b/arch/arm/mach-clps711x/p720t.c index 42ee8f3..c782cbf 100644 --- a/arch/arm/mach-clps711x/p720t.c +++ b/arch/arm/mach-clps711x/p720t.c @@ -23,6 +23,8 @@ #include linux/string.h #include linux/mm.h #include linux/io.h +#include linux/slab.h +#include linux/leds.h #include mach/hardware.h #include asm/pgtable.h @@ -34,6 +36,8 @@ #include asm/mach/map.h #include mach/syspld.h +#include asm/hardware/clps7111.h + #include common.h /* @@ -121,3 +125,58 @@ static int p720t_hw_init(void) __initcall(p720t_hw_init); +/* + * LED controled by CPLD + */ +static void p720t_led_set(struct led_classdev *cdev, + enum led_brightness b) +{ + u8 reg = clps_readb(PDDR); + + if (b != LED_OFF) + reg |= 0x1; + else + reg = ~0x1; + + clps_writeb(reg, PDDR); +} + +static enum
[PATCH 10/18] ARM: mach-ebsa110: retire custom LED code
Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-ebsa110/Makefile |4 +-- arch/arm/mach-ebsa110/leds.c | 79 2 files changed, 49 insertions(+), 34 deletions(-) diff --git a/arch/arm/mach-ebsa110/Makefile b/arch/arm/mach-ebsa110/Makefile index 6520ac8..935e4af 100644 --- a/arch/arm/mach-ebsa110/Makefile +++ b/arch/arm/mach-ebsa110/Makefile @@ -4,9 +4,7 @@ # Object file lists. -obj-y := core.o io.o +obj-y := core.o io.o leds.o obj-m := obj-n := obj- := - -obj-$(CONFIG_LEDS) += leds.o diff --git a/arch/arm/mach-ebsa110/leds.c b/arch/arm/mach-ebsa110/leds.c index 99e14e3..b7dd0a5 100644 --- a/arch/arm/mach-ebsa110/leds.c +++ b/arch/arm/mach-ebsa110/leds.c @@ -1,52 +1,69 @@ /* - * linux/arch/arm/mach-ebsa110/leds.c + * Driver for the LED found on the EBSA110 machine + * Based on Versatile and RealView machine LED code * - * Copyright (C) 1998 Russell King - * - * 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. - * - * EBSA-110 LED control routines. We use the led as follows: - * - * - Red - toggles state every 50 timer interrupts + * License terms: GNU General Public License (GPL) version 2 + * Author: Bryan Wu bryan...@canonical.com */ -#include linux/module.h -#include linux/spinlock.h +#include linux/kernel.h #include linux/init.h +#include linux/io.h +#include linux/slab.h +#include linux/leds.h -#include mach/hardware.h -#include asm/leds.h #include asm/mach-types.h #include core.h -static spinlock_t leds_lock; - -static void ebsa110_leds_event(led_event_t ledevt) +static void ebsa110_led_set(struct led_classdev *cdev, + enum led_brightness b) { - unsigned long flags; + u8 reg = __raw_readb(SOFT_BASE); - spin_lock_irqsave(leds_lock, flags); + if (b != LED_OFF) + reg |= 0x80; + else + reg = ~0x80; - switch(ledevt) { - case led_timer: - *(volatile unsigned char *)SOFT_BASE ^= 128; - break; + __raw_writeb(reg, SOFT_BASE); +} - default: - break; - } +static enum led_brightness ebsa110_led_get(struct led_classdev *cdev) +{ + u8 reg = __raw_readb(SOFT_BASE); - spin_unlock_irqrestore(leds_lock, flags); + return (reg 0x80) ? LED_FULL : LED_OFF; } -static int __init leds_init(void) +static int __init ebsa110_leds_init(void) { - if (machine_is_ebsa110()) - leds_event = ebsa110_leds_event; + + struct led_classdev *cdev; + int ret; + + if (!machine_is_ebsa110()) + return -ENODEV; + + cdev = kzalloc(sizeof(*cdev), GFP_KERNEL); + if (!cdev) + return -ENOMEM; + + cdev-name = ebsa110:0; + cdev-brightness_set = ebsa110_led_set; + cdev-brightness_get = ebsa110_led_get; + cdev-default_trigger = heartbeat; + + ret = led_classdev_register(NULL, cdev); + if (ret 0) { + kfree(cdev); + return ret; + } return 0; } -__initcall(leds_init); +/* + * Since we may have triggers on any subsystem, defer registration + * until after subsystem_init. + */ +fs_initcall(ebsa110_leds_init); -- 1.7.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 11/18] ARM: mach-footbridge: retire custom LED code
Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-footbridge/Makefile |4 - arch/arm/mach-footbridge/ebsa285-leds.c | 138 - arch/arm/mach-footbridge/ebsa285.c| 79 arch/arm/mach-footbridge/netwinder-hw.c | 110 --- arch/arm/mach-footbridge/netwinder-leds.c | 138 - 5 files changed, 175 insertions(+), 294 deletions(-) delete mode 100644 arch/arm/mach-footbridge/ebsa285-leds.c delete mode 100644 arch/arm/mach-footbridge/netwinder-leds.c diff --git a/arch/arm/mach-footbridge/Makefile b/arch/arm/mach-footbridge/Makefile index 3afb1b2..0b64dd4 100644 --- a/arch/arm/mach-footbridge/Makefile +++ b/arch/arm/mach-footbridge/Makefile @@ -14,15 +14,11 @@ pci-$(CONFIG_ARCH_EBSA285_HOST) += ebsa285-pci.o pci-$(CONFIG_ARCH_NETWINDER) += netwinder-pci.o pci-$(CONFIG_ARCH_PERSONAL_SERVER) += personal-pci.o -leds-$(CONFIG_ARCH_EBSA285) += ebsa285-leds.o -leds-$(CONFIG_ARCH_NETWINDER) += netwinder-leds.o - obj-$(CONFIG_ARCH_CATS) += cats-hw.o isa-timer.o obj-$(CONFIG_ARCH_EBSA285) += ebsa285.o dc21285-timer.o obj-$(CONFIG_ARCH_NETWINDER) += netwinder-hw.o isa-timer.o obj-$(CONFIG_ARCH_PERSONAL_SERVER) += personal.o dc21285-timer.o obj-$(CONFIG_PCI) +=$(pci-y) -obj-$(CONFIG_LEDS) +=$(leds-y) obj-$(CONFIG_ISA) += isa.o isa-rtc.o diff --git a/arch/arm/mach-footbridge/ebsa285-leds.c b/arch/arm/mach-footbridge/ebsa285-leds.c deleted file mode 100644 index 5bd2667..000 --- a/arch/arm/mach-footbridge/ebsa285-leds.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * linux/arch/arm/mach-footbridge/ebsa285-leds.c - * - * Copyright (C) 1998-1999 Russell King - * - * 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. - * EBSA-285 control routines. - * - * The EBSA-285 uses the leds as follows: - * - Green - toggles state every 50 timer interrupts - * - Amber - On if system is not idle - * - Red - currently unused - * - * Changelog: - * 02-05-1999RMK Various cleanups - */ -#include linux/module.h -#include linux/kernel.h -#include linux/init.h -#include linux/spinlock.h - -#include mach/hardware.h -#include asm/leds.h -#include asm/mach-types.h - -#define LED_STATE_ENABLED 1 -#define LED_STATE_CLAIMED 2 -static char led_state; -static char hw_led_state; - -static DEFINE_SPINLOCK(leds_lock); - -static void ebsa285_leds_event(led_event_t evt) -{ - unsigned long flags; - - spin_lock_irqsave(leds_lock, flags); - - switch (evt) { - case led_start: - hw_led_state = XBUS_LED_RED | XBUS_LED_GREEN; -#ifndef CONFIG_LEDS_CPU - hw_led_state |= XBUS_LED_AMBER; -#endif - led_state |= LED_STATE_ENABLED; - break; - - case led_stop: - led_state = ~LED_STATE_ENABLED; - break; - - case led_claim: - led_state |= LED_STATE_CLAIMED; - hw_led_state = XBUS_LED_RED | XBUS_LED_GREEN | XBUS_LED_AMBER; - break; - - case led_release: - led_state = ~LED_STATE_CLAIMED; - hw_led_state = XBUS_LED_RED | XBUS_LED_GREEN | XBUS_LED_AMBER; - break; - -#ifdef CONFIG_LEDS_TIMER - case led_timer: - if (!(led_state LED_STATE_CLAIMED)) - hw_led_state ^= XBUS_LED_GREEN; - break; -#endif - -#ifdef CONFIG_LEDS_CPU - case led_idle_start: - if (!(led_state LED_STATE_CLAIMED)) - hw_led_state |= XBUS_LED_AMBER; - break; - - case led_idle_end: - if (!(led_state LED_STATE_CLAIMED)) - hw_led_state = ~XBUS_LED_AMBER; - break; -#endif - - case led_halted: - if (!(led_state LED_STATE_CLAIMED)) - hw_led_state = ~XBUS_LED_RED; - break; - - case led_green_on: - if (led_state LED_STATE_CLAIMED) - hw_led_state = ~XBUS_LED_GREEN; - break; - - case led_green_off: - if (led_state LED_STATE_CLAIMED) - hw_led_state |= XBUS_LED_GREEN; - break; - - case led_amber_on: - if (led_state LED_STATE_CLAIMED) - hw_led_state = ~XBUS_LED_AMBER; - break; - - case led_amber_off: - if (led_state LED_STATE_CLAIMED) - hw_led_state |= XBUS_LED_AMBER; - break; - - case led_red_on: - if (led_state LED_STATE_CLAIMED) - hw_led_state = ~XBUS_LED_RED; - break; - - case led_red_off: - if (led_state LED_STATE_CLAIMED) - hw_led_state |= XBUS_LED_RED
[PATCH 12/18] char: nwflash: remove old led event code
Signed-off-by: Bryan Wu bryan...@canonical.com --- drivers/char/nwflash.c | 34 -- 1 files changed, 0 insertions(+), 34 deletions(-) diff --git a/drivers/char/nwflash.c b/drivers/char/nwflash.c index d45c334..a0e2f7d 100644 --- a/drivers/char/nwflash.c +++ b/drivers/char/nwflash.c @@ -30,7 +30,6 @@ #include asm/hardware/dec21285.h #include asm/io.h -#include asm/leds.h #include asm/mach-types.h #include asm/uaccess.h @@ -179,9 +178,6 @@ static ssize_t flash_write(struct file *file, const char __user *buf, written = 0; - leds_event(led_claim); - leds_event(led_green_on); - nBlock = (int) p 16; //block # of 64K bytes /* @@ -258,11 +254,6 @@ static ssize_t flash_write(struct file *file, const char __user *buf, printk(KERN_DEBUG flash_write: written 0x%X bytes OK.\n, written); } - /* -* restore reg on exit -*/ - leds_event(led_release); - mutex_unlock(nwflash_mutex); return written; @@ -334,11 +325,6 @@ static int erase_block(int nBlock) int temp, temp1; /* -* orange LED == erase -*/ - leds_event(led_amber_on); - - /* * reset footbridge to the correct offset 0 (...0..3) */ *CSR_ROMWRITEREG = 0; @@ -446,12 +432,6 @@ static int write_block(unsigned long p, const char __user *buf, int count) unsigned long timeout; unsigned long timeout1; - /* -* red LED == write -*/ - leds_event(led_amber_off); - leds_event(led_red_on); - pWritePtr = (unsigned char *) ((unsigned int) (FLASH_BASE + p)); /* @@ -558,17 +538,9 @@ static int write_block(unsigned long p, const char __user *buf, int count) pWritePtr - FLASH_BASE); /* -* no LED == waiting -*/ - leds_event(led_amber_off); - /* * wait couple ms */ msleep(10); - /* -* red LED == write -*/ - leds_event(led_red_on); goto WriteRetry; } else { @@ -583,12 +555,6 @@ static int write_block(unsigned long p, const char __user *buf, int count) } } - /* -* green LED == read/verify -*/ - leds_event(led_amber_off); - leds_event(led_green_on); - msleep(10); pWritePtr = (unsigned char *) ((unsigned int) (FLASH_BASE + p)); -- 1.7.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 14/18] ARM: plat-samsung: remove including old leds event API header file
Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/plat-samsung/time.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/arch/arm/plat-samsung/time.c b/arch/arm/plat-samsung/time.c index 4dcb11c..60552e2 100644 --- a/arch/arm/plat-samsung/time.c +++ b/arch/arm/plat-samsung/time.c @@ -28,7 +28,6 @@ #include linux/io.h #include linux/platform_device.h -#include asm/leds.h #include asm/mach-types.h #include asm/irq.h -- 1.7.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 13/18] ARM: mach-pxa: retire custom LED code
Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-pxa/Makefile |8 -- arch/arm/mach-pxa/idp.c| 79 +++ arch/arm/mach-pxa/leds-idp.c | 115 - arch/arm/mach-pxa/leds-lubbock.c | 124 arch/arm/mach-pxa/leds-mainstone.c | 119 -- arch/arm/mach-pxa/leds.c | 32 - arch/arm/mach-pxa/leds.h | 13 arch/arm/mach-pxa/lubbock.c| 93 +++ arch/arm/mach-pxa/mainstone.c | 92 ++ 9 files changed, 264 insertions(+), 411 deletions(-) delete mode 100644 arch/arm/mach-pxa/leds-idp.c delete mode 100644 arch/arm/mach-pxa/leds-lubbock.c delete mode 100644 arch/arm/mach-pxa/leds-mainstone.c delete mode 100644 arch/arm/mach-pxa/leds.c delete mode 100644 arch/arm/mach-pxa/leds.h diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile index be0f7df..d4337e3 100644 --- a/arch/arm/mach-pxa/Makefile +++ b/arch/arm/mach-pxa/Makefile @@ -95,12 +95,4 @@ obj-$(CONFIG_MACH_RAUMFELD_CONNECTOR)+= raumfeld.o obj-$(CONFIG_MACH_RAUMFELD_SPEAKER)+= raumfeld.o obj-$(CONFIG_MACH_ZIPIT2) += z2.o -# Support for blinky lights -led-y := leds.o -led-$(CONFIG_ARCH_LUBBOCK) += leds-lubbock.o -led-$(CONFIG_MACH_MAINSTONE) += leds-mainstone.o -led-$(CONFIG_ARCH_PXA_IDP) += leds-idp.o - -obj-$(CONFIG_LEDS) += $(led-y) - obj-$(CONFIG_TOSA_BT) += tosa-bt.o diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c index 6ff466b..3c58d95 100644 --- a/arch/arm/mach-pxa/idp.c +++ b/arch/arm/mach-pxa/idp.c @@ -191,6 +191,85 @@ static void __init idp_map_io(void) iotable_init(idp_io_desc, ARRAY_SIZE(idp_io_desc)); } +/* LEDs */ +struct idp_led { + struct led_classdev cdev; + u8 mask; +}; + +/* + * The triggers lines up below will only be used if the + * LED triggers are compiled in. + */ +static const struct { + const char *name; + const char *trigger; +} idp_leds[] = { + { idp:green, heartbeat, }, + { idp:red, cpu0, }, +}; + +static void idp_led_set(struct led_classdev *cdev, + enum led_brightness b) +{ + struct idp_led *led = container_of(cdev, + struct idp_led, cdev); + u32 reg = IDP_CPLD_LED_CONTROL; + + if (b != LED_OFF) + reg = ~led-mask; + else + reg |= led-mask; + + IDP_CPLD_LED_CONTROL = reg; +} + +static enum led_brightness idp_led_get(struct led_classdev *cdev) +{ + struct idp_led *led = container_of(cdev, + struct idp_led, cdev); + + return (IDP_CPLD_LED_CONTROL led-mask) ? LED_OFF : LED_FULL; +} + +static int __init idp_leds_init(void) +{ + int i; + + if (!machine_is_pxa_idp()) + return -ENODEV; + + for (i = 0; i ARRAY_SIZE(idp_leds); i++) { + struct idp_led *led; + + led = kzalloc(sizeof(*led), GFP_KERNEL); + if (!led) + break; + + led-cdev.name = idp_leds[i].name; + led-cdev.brightness_set = idp_led_set; + led-cdev.brightness_get = idp_led_get; + led-cdev.default_trigger = idp_leds[i].trigger; + + if (i == 0) + led-mask = IDP_HB_LED; + else + led-mask = IDP_BUSY_LED; + + if (led_classdev_register(NULL, led-cdev) 0) { + kfree(led); + break; + } + } + + return 0; +} + +/* + * Since we may have triggers on any subsystem, defer registration + * until after subsystem_init. + */ +fs_initcall(idp_leds_init); MACHINE_START(PXA_IDP, Vibren PXA255 IDP) /* Maintainer: Vibren Technologies */ diff --git a/arch/arm/mach-pxa/leds-idp.c b/arch/arm/mach-pxa/leds-idp.c deleted file mode 100644 index 06b0600..000 --- a/arch/arm/mach-pxa/leds-idp.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - * linux/arch/arm/mach-pxa/leds-idp.c - * - * Copyright (C) 2000 John Dorsey jo...@cs.cmu.edu - * - * Copyright (c) 2001 Jeff Sutherland je...@accelent.com - * - * Original (leds-footbridge.c) by Russell King - * - * Macros for actual LED manipulation should be in machine specific - * files in this 'mach' directory. - */ - - -#include linux/init.h - -#include mach/hardware.h -#include asm/leds.h - -#include mach/pxa25x.h -#include mach/idp.h - -#include leds.h - -#define LED_STATE_ENABLED 1 -#define LED_STATE_CLAIMED 2 - -static unsigned int led_state; -static unsigned int hw_led_state; - -void idp_leds_event(led_event_t evt) -{ - unsigned long flags; - - local_irq_save(flags); - - switch (evt) { - case led_start: - hw_led_state = IDP_HB_LED | IDP_BUSY_LED
[PATCH 15/18] ARM: mach-pnx4008: remove including old leds event API header file
Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-pnx4008/time.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-pnx4008/time.c b/arch/arm/mach-pnx4008/time.c index 0cfe8af..47a7ae9 100644 --- a/arch/arm/mach-pnx4008/time.c +++ b/arch/arm/mach-pnx4008/time.c @@ -25,7 +25,6 @@ #include linux/io.h #include mach/hardware.h -#include asm/leds.h #include asm/mach/time.h #include asm/errno.h -- 1.7.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 17/18] ARM: mach-sa1100: retire custom LED code
Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-sa1100/Makefile |9 --- arch/arm/mach-sa1100/assabet.c | 83 + arch/arm/mach-sa1100/badge4.c | 30 + arch/arm/mach-sa1100/cerf.c | 42 + arch/arm/mach-sa1100/hackkit.c | 32 ++ arch/arm/mach-sa1100/lart.c | 26 arch/arm/mach-sa1100/leds-assabet.c | 113 --- arch/arm/mach-sa1100/leds-badge4.c | 110 -- arch/arm/mach-sa1100/leds-cerf.c| 109 - arch/arm/mach-sa1100/leds-hackkit.c | 111 -- arch/arm/mach-sa1100/leds-lart.c| 100 --- arch/arm/mach-sa1100/leds.c | 50 --- arch/arm/mach-sa1100/leds.h | 13 13 files changed, 213 insertions(+), 615 deletions(-) delete mode 100644 arch/arm/mach-sa1100/leds-assabet.c delete mode 100644 arch/arm/mach-sa1100/leds-badge4.c delete mode 100644 arch/arm/mach-sa1100/leds-cerf.c delete mode 100644 arch/arm/mach-sa1100/leds-hackkit.c delete mode 100644 arch/arm/mach-sa1100/leds-lart.c delete mode 100644 arch/arm/mach-sa1100/leds.c delete mode 100644 arch/arm/mach-sa1100/leds.h diff --git a/arch/arm/mach-sa1100/Makefile b/arch/arm/mach-sa1100/Makefile index 60b97ec..1aed9e7 100644 --- a/arch/arm/mach-sa1100/Makefile +++ b/arch/arm/mach-sa1100/Makefile @@ -7,21 +7,17 @@ obj-y := clock.o generic.o irq.o time.o #nmi-oopser.o obj-m := obj-n := obj- := -led-y := leds.o obj-$(CONFIG_CPU_FREQ_SA1100) += cpu-sa1100.o obj-$(CONFIG_CPU_FREQ_SA1110) += cpu-sa1110.o # Specific board support obj-$(CONFIG_SA1100_ASSABET) += assabet.o -led-$(CONFIG_SA1100_ASSABET) += leds-assabet.o obj-$(CONFIG_ASSABET_NEPONSET) += neponset.o obj-$(CONFIG_SA1100_BADGE4)+= badge4.o -led-$(CONFIG_SA1100_BADGE4)+= leds-badge4.o obj-$(CONFIG_SA1100_CERF) += cerf.o -led-$(CONFIG_SA1100_CERF) += leds-cerf.o obj-$(CONFIG_SA1100_COLLIE)+= collie.o @@ -29,13 +25,11 @@ obj-$(CONFIG_SA1100_H3100) += h3100.o h3xxx.o obj-$(CONFIG_SA1100_H3600) += h3600.o h3xxx.o obj-$(CONFIG_SA1100_HACKKIT) += hackkit.o -led-$(CONFIG_SA1100_HACKKIT) += leds-hackkit.o obj-$(CONFIG_SA1100_JORNADA720)+= jornada720.o obj-$(CONFIG_SA1100_JORNADA720_SSP)+= jornada720_ssp.o obj-$(CONFIG_SA1100_LART) += lart.o -led-$(CONFIG_SA1100_LART) += leds-lart.o obj-$(CONFIG_SA1100_NANOENGINE)+= nanoengine.o obj-$(CONFIG_PCI_NANOENGINE) += pci-nanoengine.o @@ -46,9 +40,6 @@ obj-$(CONFIG_SA1100_SHANNON) += shannon.o obj-$(CONFIG_SA1100_SIMPAD)+= simpad.o -# LEDs support -obj-$(CONFIG_LEDS) += $(led-y) - # Miscellaneous functions obj-$(CONFIG_PM) += pm.o sleep.o obj-$(CONFIG_SA1100_SSP) += ssp.o diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c index 375d3f7..0e29ec2 100644 --- a/arch/arm/mach-sa1100/assabet.c +++ b/arch/arm/mach-sa1100/assabet.c @@ -20,6 +20,8 @@ #include linux/mtd/partitions.h #include linux/delay.h #include linux/mm.h +#include linux/leds.h +#include linux/slab.h #include video/sa1100fb.h @@ -529,6 +531,87 @@ static void __init assabet_map_io(void) sa1100_register_uart(2, 3); } +/* LEDs */ +struct assabet_led { + struct led_classdev cdev; + u32 mask; +}; + +/* + * The triggers lines up below will only be used if the + * LED triggers are compiled in. + */ +static const struct { + const char *name; + const char *trigger; +} assabet_leds[] = { + { assabet:red, cpu0,}, + { assabet:green, heartbeat, }, +}; + +/* + * The LED control in Assabet is reversed: + * - setting bit means turn off LED + * - clearing bit means turn on LED + */ +static void assabet_led_set(struct led_classdev *cdev, + enum led_brightness b) +{ + struct assabet_led *led = container_of(cdev, + struct assabet_led, cdev); + + if (b != LED_OFF) + ASSABET_BCR_clear(led-mask); + else + ASSABET_BCR_set(led-mask); +} + +static enum led_brightness assabet_led_get(struct led_classdev *cdev) +{ + struct assabet_led *led = container_of(cdev, + struct assabet_led, cdev); + + return (ASSABET_BCR led-mask) ? LED_OFF : LED_FULL; +} + +static int __init assabet_leds_init(void) +{ + int i; + + if (!machine_is_assabet()) + return -ENODEV; + + for (i = 0; i ARRAY_SIZE(assabet_leds); i++) { + struct assabet_led *led; + + led = kzalloc(sizeof(*led), GFP_KERNEL); + if (!led) + break
[PATCH 18/18] ARM: use new LEDS CPU trigger stub to replace old one
Cc: Linus Walleij linus.wall...@linaro.org Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/Kconfig| 53 --- arch/arm/include/asm/leds.h | 50 -- arch/arm/kernel/Makefile|1 - arch/arm/kernel/leds.c | 121 --- arch/arm/kernel/process.c |6 +- arch/arm/kernel/time.c | 17 -- 6 files changed, 3 insertions(+), 245 deletions(-) delete mode 100644 arch/arm/include/asm/leds.h delete mode 100644 arch/arm/kernel/leds.c diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index bd84f2d..3e247a6 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1760,59 +1760,6 @@ config FORCE_MAX_ZONEORDER This config option is actually maximum order plus one. For example, a value of 11 means that the largest free memory block is 2^10 pages. -config LEDS - bool Timer and CPU usage LEDs - depends on ARCH_CDB89712 || ARCH_EBSA110 || \ - ARCH_EBSA285 || ARCH_INTEGRATOR || \ - ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_NETWINDER || \ - ARCH_OMAP || ARCH_P720T || ARCH_PXA_IDP || \ - ARCH_SA1100 || ARCH_SHARK || ARCH_VERSATILE || \ - ARCH_AT91 || ARCH_DAVINCI || \ - ARCH_KS8695 || MACH_RD88F5182 || ARCH_REALVIEW - help - If you say Y here, the LEDs on your machine will be used - to provide useful information about your current system status. - - If you are compiling a kernel for a NetWinder or EBSA-285, you will - be able to select which LEDs are active using the options below. If - you are compiling a kernel for the EBSA-110 or the LART however, the - red LED will simply flash regularly to indicate that the system is - still functional. It is safe to say Y here if you have a CATS - system, but the driver will do nothing. - -config LEDS_TIMER - bool Timer LED if (!ARCH_CDB89712 !ARCH_OMAP) || \ - OMAP_OSK_MISTRAL || MACH_OMAP_H2 \ - || MACH_OMAP_PERSEUS2 - depends on LEDS - depends on !GENERIC_CLOCKEVENTS - default y if ARCH_EBSA110 - help - If you say Y here, one of the system LEDs (the green one on the - NetWinder, the amber one on the EBSA285, or the red one on the LART) - will flash regularly to indicate that the system is still - operational. This is mainly useful to kernel hackers who are - debugging unstable kernels. - - The LART uses the same LED for both Timer LED and CPU usage LED - functions. You may choose to use both, but the Timer LED function - will overrule the CPU usage LED. - -config LEDS_CPU - bool CPU usage LED if (!ARCH_CDB89712 !ARCH_EBSA110 \ - !ARCH_OMAP) \ - || OMAP_OSK_MISTRAL || MACH_OMAP_H2 \ - || MACH_OMAP_PERSEUS2 - depends on LEDS - help - If you say Y here, the red LED will be used to give a good real - time indication of CPU usage, by lighting whenever the idle task - is not currently executing. - - The LART uses the same LED for both Timer LED and CPU usage LED - functions. You may choose to use both, but the Timer LED function - will overrule the CPU usage LED. - config ALIGNMENT_TRAP bool depends on CPU_CP15_MMU diff --git a/arch/arm/include/asm/leds.h b/arch/arm/include/asm/leds.h deleted file mode 100644 index c545739..000 --- a/arch/arm/include/asm/leds.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * arch/arm/include/asm/leds.h - * - * Copyright (C) 1998 Russell King - * - * 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. - * - * Event-driven interface for LEDs on machines - * Added led_start and led_stop- Alex Holden, 28th Dec 1998. - */ -#ifndef ASM_ARM_LEDS_H -#define ASM_ARM_LEDS_H - - -typedef enum { - led_idle_start, - led_idle_end, - led_timer, - led_start, - led_stop, - led_claim, /* override idle timer leds */ - led_release,/* restore idle timer leds */ - led_start_timer_mode, - led_stop_timer_mode, - led_green_on, - led_green_off, - led_amber_on, - led_amber_off, - led_red_on, - led_red_off, - led_blue_on, - led_blue_off, - /* -* I want this between led_timer and led_start, but -* someone has decided to export this to user space -*/ - led_halted -} led_event_t; - -/* Use this routine to handle LEDs */ - -#ifdef CONFIG_LEDS -extern void (*leds_event)(led_event_t); -#else -#define leds_event(e) -#endif - -#endif diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel
[PATCH 16/18] ARM: mach-omap1: retire custom LED code
Signed-off-by: Bryan Wu bryan...@canonical.com Acked-by: Tony Lindgren t...@atomide.com --- arch/arm/mach-omap1/Makefile |8 - arch/arm/mach-omap1/board-h2.c| 32 arch/arm/mach-omap1/board-h3.c| 32 arch/arm/mach-omap1/board-osk.c | 33 arch/arm/mach-omap1/leds-h2p2-debug.c | 166 --- arch/arm/mach-omap1/leds-innovator.c | 98 --- arch/arm/mach-omap1/leds-osk.c| 113 - arch/arm/mach-omap1/leds.c| 69 arch/arm/mach-omap1/leds.h|3 - arch/arm/mach-omap1/time.c|1 - arch/arm/mach-omap1/timer32k.c|1 - arch/arm/plat-omap/Kconfig|3 +- arch/arm/plat-omap/debug-leds.c | 293 - 13 files changed, 165 insertions(+), 687 deletions(-) delete mode 100644 arch/arm/mach-omap1/leds-h2p2-debug.c delete mode 100644 arch/arm/mach-omap1/leds-innovator.c delete mode 100644 arch/arm/mach-omap1/leds-osk.c delete mode 100644 arch/arm/mach-omap1/leds.c delete mode 100644 arch/arm/mach-omap1/leds.h diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile index 9923f92..e63e6e7 100644 --- a/arch/arm/mach-omap1/Makefile +++ b/arch/arm/mach-omap1/Makefile @@ -56,14 +56,6 @@ obj-$(CONFIG_ARCH_OMAP850) += gpio7xx.o obj-$(CONFIG_ARCH_OMAP15XX)+= gpio15xx.o obj-$(CONFIG_ARCH_OMAP16XX)+= gpio16xx.o -# LEDs support -led-$(CONFIG_MACH_OMAP_H2) += leds-h2p2-debug.o -led-$(CONFIG_MACH_OMAP_H3) += leds-h2p2-debug.o -led-$(CONFIG_MACH_OMAP_INNOVATOR) += leds-innovator.o -led-$(CONFIG_MACH_OMAP_PERSEUS2) += leds-h2p2-debug.o -led-$(CONFIG_MACH_OMAP_OSK)+= leds-osk.o -obj-$(CONFIG_LEDS) += $(led-y) - ifneq ($(CONFIG_FB_OMAP),) obj-y += lcd_dma.o endif diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c index 553a2e5..6a22696 100644 --- a/arch/arm/mach-omap1/board-h2.c +++ b/arch/arm/mach-omap1/board-h2.c @@ -31,6 +31,7 @@ #include linux/i2c/tps65010.h #include linux/smc91x.h #include linux/omapfb.h +#include linux/leds.h #include asm/mach-types.h #include asm/mach/arch.h @@ -324,12 +325,39 @@ static struct platform_device h2_irda_device = { .resource = h2_irda_resources, }; +static struct gpio_led h2_gpio_led_pins[] = { + { + .name = h2:red, + .default_trigger = heartbeat, + .gpio = 3, + }, + { + .name = h2:green, + .default_trigger = cpu0, + .gpio = OMAP_MPUIO(4), + }, +}; + +static struct gpio_led_platform_data h2_gpio_led_data = { + .leds = h2_gpio_led_pins, + .num_leds = ARRAY_SIZE(h2_gpio_led_pins), +}; + +static struct platform_device h2_gpio_leds = { + .name = leds-gpio, + .id = -1, + .dev= { + .platform_data = h2_gpio_led_data, + }, +}; + static struct platform_device *h2_devices[] __initdata = { h2_nor_device, h2_nand_device, h2_smc91x_device, h2_irda_device, h2_kp_device, + h2_gpio_leds, }; static void __init h2_init_smc91x(void) @@ -424,6 +452,10 @@ static void __init h2_init(void) omap_cfg_reg(E19_1610_KBR4); omap_cfg_reg(N19_1610_KBR5); + /* GPIO based LEDs */ + omap_cfg_reg(P18_1610_GPIO3); + omap_cfg_reg(MPUIO4); + h2_smc91x_resources[1].start = gpio_to_irq(0); h2_smc91x_resources[1].end = gpio_to_irq(0); platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices)); diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c index 4c19f4c..4acdc71 100644 --- a/arch/arm/mach-omap1/board-h3.c +++ b/arch/arm/mach-omap1/board-h3.c @@ -31,6 +31,7 @@ #include linux/i2c/tps65010.h #include linux/smc91x.h #include linux/omapfb.h +#include linux/leds.h #include asm/setup.h #include asm/page.h @@ -341,6 +342,32 @@ static struct spi_board_info h3_spi_board_info[] __initdata = { }, }; +static struct gpio_led h3_gpio_led_pins[] = { + { + .name = h3:red, + .default_trigger = heartbeat, + .gpio = 3, + }, + { + .name = h3:green, + .default_trigger = cpu0, + .gpio = OMAP_MPUIO(4), + }, +}; + +static struct gpio_led_platform_data h3_gpio_led_data = { + .leds = h3_gpio_led_pins, + .num_leds = ARRAY_SIZE(h3_gpio_led_pins), +}; + +static struct platform_device h3_gpio_leds = { + .name = leds-gpio, + .id = -1, + .dev= { + .platform_data = h3_gpio_led_data, + }, +}; + static struct platform_device *devices[] __initdata = { nor_device, nand_device, @@ -348,6
[PATCH 07/18] ARM: mach-integrator: move CM_CTRL to header file for accessing by other functions
Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-integrator/core.c|2 -- arch/arm/mach-integrator/include/mach/cm.h |2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c index eaf6c63..8c53562 100644 --- a/arch/arm/mach-integrator/core.c +++ b/arch/arm/mach-integrator/core.c @@ -172,8 +172,6 @@ static struct amba_pl010_data integrator_uart_data = { .set_mctrl = integrator_uart_set_mctrl, }; -#define CM_CTRLIO_ADDRESS(INTEGRATOR_HDR_CTRL) - static DEFINE_RAW_SPINLOCK(cm_lock); /** diff --git a/arch/arm/mach-integrator/include/mach/cm.h b/arch/arm/mach-integrator/include/mach/cm.h index 445d57a..1a78692e 100644 --- a/arch/arm/mach-integrator/include/mach/cm.h +++ b/arch/arm/mach-integrator/include/mach/cm.h @@ -3,6 +3,8 @@ */ void cm_control(u32, u32); +#define CM_CTRLIO_ADDRESS(INTEGRATOR_HDR_CTRL) + #define CM_CTRL_LED(1 0) #define CM_CTRL_nMBDET (1 1) #define CM_CTRL_REMAP (1 2) -- 1.7.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] leds-class: change back LEDS_CLASS to tristate instead of bool
Hiya, Any comments and need I do anything to improve this patch? Thanks, -Bryan On Tue, Sep 27, 2011 at 4:50 PM, Bryan Wu bryan...@canonical.com wrote: LEDS_CLASS is required by leds and trigger drivers, but we can build it as module. So change this option back as tristate and treak the help message as well. LEDS_TRIGGERS depends on LEDS_CLASSS, which should be tristate. So set it as tristate too and update header files as well. Change those ifdefs to take care of module configuration. Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-omap1/board-ams-delta.c | 4 ++-- drivers/leds/Kconfig | 9 ++--- drivers/leds/led-class.c | 8 drivers/leds/leds.h | 2 +- drivers/mmc/host/au1xmmc.c | 6 +++--- drivers/power/power_supply.h | 2 +- include/linux/leds.h | 7 --- include/linux/mmc/host.h | 2 +- include/linux/power_supply.h | 2 +- 9 files changed, 23 insertions(+), 19 deletions(-) diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index b2572f7..fd28696 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c @@ -241,7 +241,7 @@ static struct i2c_board_info ams_delta_camera_board_info[] = { }, }; -#ifdef CONFIG_LEDS_TRIGGERS +#if defined(CONFIG_LEDS_TRIGGERS) || defined(CONFIG_LEDS_TRIGGERS_MODULE) DEFINE_LED_TRIGGER(ams_delta_camera_led_trigger); static int ams_delta_camera_power(struct device *dev, int power) @@ -320,7 +320,7 @@ static void __init ams_delta_init(void) omap1_usb_init(ams_delta_usb_config); omap1_set_camera_info(ams_delta_camera_platform_data); -#ifdef CONFIG_LEDS_TRIGGERS +#if defined(CONFIG_LEDS_TRIGGERS) || defined(CONFIG_LEDS_TRIGGERS_MODULE) led_trigger_register_simple(ams_delta_camera, ams_delta_camera_led_trigger); #endif diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index ff203a4..c30233e 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig @@ -17,10 +17,13 @@ menuconfig NEW_LEDS if NEW_LEDS config LEDS_CLASS - bool LED Class Support + tristate LED Class Support help This option enables the led sysfs class in /sys/class/leds. You'll - need this to do anything useful with LEDs. If unsure, say N. + need this to do anything useful with LEDs. If unsure, say M. + + Note: don't disable it as N, because plenty of led and trigger drivers + are using this option. comment LED drivers @@ -388,7 +391,7 @@ config LEDS_RENESAS_TPU Brightness control is supported but hardware blinking is not. config LEDS_TRIGGERS - bool LED Trigger support + tristate LED Trigger support depends on LEDS_CLASS help This option enables trigger support for the leds class. diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c index dc3d3d8..1f54cb0 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c @@ -75,7 +75,7 @@ static ssize_t led_max_brightness_show(struct device *dev, static struct device_attribute led_class_attrs[] = { __ATTR(brightness, 0644, led_brightness_show, led_brightness_store), __ATTR(max_brightness, 0444, led_max_brightness_show, NULL), -#ifdef CONFIG_LEDS_TRIGGERS +#if defined(CONFIG_LEDS_TRIGGERS) || defined(CONFIG_LEDS_TRIGGERS_MODULE) __ATTR(trigger, 0644, led_trigger_show, led_trigger_store), #endif __ATTR_NULL, @@ -209,7 +209,7 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev) if (IS_ERR(led_cdev-dev)) return PTR_ERR(led_cdev-dev); -#ifdef CONFIG_LEDS_TRIGGERS +#if defined(CONFIG_LEDS_TRIGGERS) || defined(CONFIG_LEDS_TRIGGERS_MODULE) init_rwsem(led_cdev-trigger_lock); #endif /* add to the list of leds */ @@ -226,7 +226,7 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev) led_cdev-blink_timer.function = led_timer_function; led_cdev-blink_timer.data = (unsigned long)led_cdev; -#ifdef CONFIG_LEDS_TRIGGERS +#if defined(CONFIG_LEDS_TRIGGERS) || defined(CONFIG_LEDS_TRIGGERS_MODULE) led_trigger_set_default(led_cdev); #endif @@ -245,7 +245,7 @@ EXPORT_SYMBOL_GPL(led_classdev_register); */ void led_classdev_unregister(struct led_classdev *led_cdev) { -#ifdef CONFIG_LEDS_TRIGGERS +#if defined(CONFIG_LEDS_TRIGGERS) || defined(CONFIG_LEDS_TRIGGERS_MODULE) down_write(led_cdev-trigger_lock); if (led_cdev-trigger) led_trigger_set(led_cdev, NULL); diff --git a/drivers/leds/leds.h b/drivers/leds/leds.h index e77c7f8..53b59b7 100644 --- a/drivers/leds/leds.h +++ b/drivers/leds/leds.h @@ -35,7 +35,7 @@ static inline int led_get_brightness(struct
[PATCH] leds-class: change back LEDS_CLASS to tristate instead of bool
LEDS_CLASS is required by leds and trigger drivers, but we can build it as module. So change this option back as tristate and treak the help message as well. LEDS_TRIGGERS depends on LEDS_CLASSS, which should be tristate. So set it as tristate too and update header files as well. Change those ifdefs to take care of module configuration. Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-omap1/board-ams-delta.c |4 ++-- drivers/leds/Kconfig |9 ++--- drivers/leds/led-class.c |8 drivers/leds/leds.h |2 +- drivers/mmc/host/au1xmmc.c|6 +++--- drivers/power/power_supply.h |2 +- include/linux/leds.h |7 --- include/linux/mmc/host.h |2 +- include/linux/power_supply.h |2 +- 9 files changed, 23 insertions(+), 19 deletions(-) diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index b2572f7..fd28696 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c @@ -241,7 +241,7 @@ static struct i2c_board_info ams_delta_camera_board_info[] = { }, }; -#ifdef CONFIG_LEDS_TRIGGERS +#if defined(CONFIG_LEDS_TRIGGERS) || defined(CONFIG_LEDS_TRIGGERS_MODULE) DEFINE_LED_TRIGGER(ams_delta_camera_led_trigger); static int ams_delta_camera_power(struct device *dev, int power) @@ -320,7 +320,7 @@ static void __init ams_delta_init(void) omap1_usb_init(ams_delta_usb_config); omap1_set_camera_info(ams_delta_camera_platform_data); -#ifdef CONFIG_LEDS_TRIGGERS +#if defined(CONFIG_LEDS_TRIGGERS) || defined(CONFIG_LEDS_TRIGGERS_MODULE) led_trigger_register_simple(ams_delta_camera, ams_delta_camera_led_trigger); #endif diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index ff203a4..c30233e 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig @@ -17,10 +17,13 @@ menuconfig NEW_LEDS if NEW_LEDS config LEDS_CLASS - bool LED Class Support + tristate LED Class Support help This option enables the led sysfs class in /sys/class/leds. You'll - need this to do anything useful with LEDs. If unsure, say N. + need this to do anything useful with LEDs. If unsure, say M. + + Note: don't disable it as N, because plenty of led and trigger drivers + are using this option. comment LED drivers @@ -388,7 +391,7 @@ config LEDS_RENESAS_TPU Brightness control is supported but hardware blinking is not. config LEDS_TRIGGERS - bool LED Trigger support + tristate LED Trigger support depends on LEDS_CLASS help This option enables trigger support for the leds class. diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c index dc3d3d8..1f54cb0 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c @@ -75,7 +75,7 @@ static ssize_t led_max_brightness_show(struct device *dev, static struct device_attribute led_class_attrs[] = { __ATTR(brightness, 0644, led_brightness_show, led_brightness_store), __ATTR(max_brightness, 0444, led_max_brightness_show, NULL), -#ifdef CONFIG_LEDS_TRIGGERS +#if defined(CONFIG_LEDS_TRIGGERS) || defined(CONFIG_LEDS_TRIGGERS_MODULE) __ATTR(trigger, 0644, led_trigger_show, led_trigger_store), #endif __ATTR_NULL, @@ -209,7 +209,7 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev) if (IS_ERR(led_cdev-dev)) return PTR_ERR(led_cdev-dev); -#ifdef CONFIG_LEDS_TRIGGERS +#if defined(CONFIG_LEDS_TRIGGERS) || defined(CONFIG_LEDS_TRIGGERS_MODULE) init_rwsem(led_cdev-trigger_lock); #endif /* add to the list of leds */ @@ -226,7 +226,7 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev) led_cdev-blink_timer.function = led_timer_function; led_cdev-blink_timer.data = (unsigned long)led_cdev; -#ifdef CONFIG_LEDS_TRIGGERS +#if defined(CONFIG_LEDS_TRIGGERS) || defined(CONFIG_LEDS_TRIGGERS_MODULE) led_trigger_set_default(led_cdev); #endif @@ -245,7 +245,7 @@ EXPORT_SYMBOL_GPL(led_classdev_register); */ void led_classdev_unregister(struct led_classdev *led_cdev) { -#ifdef CONFIG_LEDS_TRIGGERS +#if defined(CONFIG_LEDS_TRIGGERS) || defined(CONFIG_LEDS_TRIGGERS_MODULE) down_write(led_cdev-trigger_lock); if (led_cdev-trigger) led_trigger_set(led_cdev, NULL); diff --git a/drivers/leds/leds.h b/drivers/leds/leds.h index e77c7f8..53b59b7 100644 --- a/drivers/leds/leds.h +++ b/drivers/leds/leds.h @@ -35,7 +35,7 @@ static inline int led_get_brightness(struct led_classdev *led_cdev) extern struct rw_semaphore leds_list_lock; extern struct list_head leds_list; -#ifdef CONFIG_LEDS_TRIGGERS +#if defined(CONFIG_LEDS_TRIGGERS) || defined(CONFIG_LEDS_TRIGGERS_MODULE) void
Re: [GIT PULL] omap changes for v2.6.39 merge window
On Wed, Apr 6, 2011 at 2:11 PM, Barry Song 21cn...@gmail.com wrote: 2011/4/1 Arnd Bergmann a...@arndb.de: On Friday 01 April 2011, Ingo Molnar wrote: IMO the right answer is what Linus and Thomas outlined: 1) provide a small number of clean examples and clean abstractions 2) to not pull new crap from that point on 3) do this gradually but consistently I.e. make all your requirements technical and actionable - avoid sweeping, impossible to meet requirements. Do not require people to clean up all of the existing mess straight away (they cannot realistically do it), do not summarily block the flow of patches, but be firm about drawing a line in the sand and be firm about not introducing new mess in a gradually growing list of well-chosen areas of focus. Rinse, repeat. I believe getting to point 1 is the hard part here. There are a lot of things that are wrong with the mach-* (and also plat-*) implementations, and I don't think we have one today that can really serve as an example. Most decisions made in there made a lot of sense when they were introduced, and declaring code that was perfectly acceptable yesterday to be unacceptable crap today is not going to be met with much understanding by the someone who just wants to add support for one more board to 100 already existing ones in the same SoC family. I would actually suggest a different much more radical start: Fork the way that platforms are managed today, and start an alternative way of setting up boards and devices together with the proven ARM core kernel infrastructure, based on these observations (please correct me if some of them they don't make sense): 1. The core arch code is not a problem (Russell does a great job here) 2. The platform specific code contains a lot of crap that doesn't belong there (not enough reviewers to push back on crap) 3. The amount of crap in platform specfic files is growing exponentially, despite the best efforts of a handful of people to clean it up. 4. Having one source file per board does not scale any more. 5. Discoverable hardware would solve this, but is not going to happen in practice. 6. Board firmware would not solve this and is usually not present. 7. Boot loaders can not be trusted to pass valid information 8. Device tree blobs can solve a lot of the problems, and nobody has come up with a better solution. ARM BSP is still blasting! we are planning to merge our new ARM cortex-a9 SoC into kernel. As far as I know, Barry is working on a new SoC family based on Cortex-A9. He asked me/Eric personally before about this issue, it is quite confused for new comers. On one hand, they wanna follow the mainline style to join our upstream family, on the other hand if they duplicate some crap from other SoC families, they will bring us trouble or more crap. So I am just wondering whether traditional ARM BSP way can still be accepted, or we must move to use device tree? but i have't seen any arm device tree codes enter mainline yet. but we can get those patches from linaro 2.6.38. So what's the plan for merging arm device tree? I suggest you need a dedicated guy who will work on DT supporting for your SoC. As I can tell from this thread, DT will be heavily supported by other SoC soon. What i have seen is that the BSP architecture of different ARM SoC companies is even different. samsung has three levels: plat-samsung plat-s3c24xx mach-s3c2410 mach-s3c2440 plat-s5p mach-s5pv210 mach-s5pv310 TI has two levels: plat-omap mach-omap1 mach-omap2 Nvidia has one level: mach-tegra I didn't find any rule about what codes should be placed in what directories. Different companies have different ways. It looks like the only agreement is board files are in mach-xxx. Any suggestions for that? That's totally frustrated for a new comer, I think. It's that possible we do more unification firstly and then allow new comers to follow, like: plat-common (or just named 'plat')- common plat-common framework for all ARM based SoC, which might contains IRQ framework, GPIO, Timer, Clock, PWM or other common things SoC players just need add one file to enable the platform common things on their SoC such as plat-omap.c, plat-imx.c, plat-samsung.c and etc. mach-'soc' - for machine or board related code, such as mach-omap, mach-imx .., or maybe we can also introduce mach-common to share other machine or board layer common code. I guess it will be some machine related API common functions. It's just a simple idea, we still need lots of work to make that happen. Thanks, -Bryan BTW, we don't want to dick around, which Linus has been very angry. we want to fix more issues this email pointed out before we send patches. 9. All interesting work is going into a handful of platforms, all of which are ARMv7 based. 10.
Re: [PATCH] omap3: Adding vdd_sdi regulator supply to OMAP3EVM
Hi, would you guys take a look at this? Thanks, -Bryan On Thu, Feb 17, 2011 at 4:11 PM, Bryan Wu bryan...@canonical.com wrote: From: Mathieu J. Poirier mathieu.poir...@canonical.com https://bugs.launchpad.net/bugs/630885 When booting, the omapdss subsystem is looking for a regulator named vdds_sdi. When the regulator is not found the initialisation sequence is aborted resulting in omapfb not finding a display to work with. This patch allows the omapfb sub system to complete its initialisation properly and enable LCD display. The problem was fixed by lumping a vdds_sdi with the already existing vdds_dsi regulator. This fix takes its root from work done on the Beagle board and the Pandora board. Signed-off-by: Mathieu Poirier mathieu.poir...@canonical.com Signed-off-by: Andy Whitcroft a...@canonical.com Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-omap2/board-omap3evm.c | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index c2a0fca..8b8eb36 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -521,8 +521,10 @@ static struct regulator_init_data omap3_evm_vdac = { }; /* VPLL2 for digital video outputs */ -static struct regulator_consumer_supply omap3_evm_vpll2_supply = - REGULATOR_SUPPLY(vdds_dsi, omapdss); +static struct regulator_consumer_supply omap3_evm_vdds_supplies[] = { + REGULATOR_SUPPLY(vdds_sdi, omapdss), + REGULATOR_SUPPLY(vdds_dsi, omapdss), +}; static struct regulator_init_data omap3_evm_vpll2 = { .constraints = { @@ -534,8 +536,8 @@ static struct regulator_init_data omap3_evm_vpll2 = { .valid_ops_mask = REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS, }, - .num_consumer_supplies = 1, - .consumer_supplies = omap3_evm_vpll2_supply, + .num_consumer_supplies = ARRAY_SIZE(omap3_evm_vdds_supplies), + .consumer_supplies = omap3_evm_vdds_supplies, }; static struct twl4030_platform_data omap3evm_twldata = { -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] omap3: Adding vdd_sdi regulator supply to OMAP3EVM
From: Mathieu J. Poirier mathieu.poir...@canonical.com https://bugs.launchpad.net/bugs/630885 When booting, the omapdss subsystem is looking for a regulator named vdds_sdi. When the regulator is not found the initialisation sequence is aborted resulting in omapfb not finding a display to work with. This patch allows the omapfb sub system to complete its initialisation properly and enable LCD display. The problem was fixed by lumping a vdds_sdi with the already existing vdds_dsi regulator. This fix takes its root from work done on the Beagle board and the Pandora board. Signed-off-by: Mathieu Poirier mathieu.poir...@canonical.com Signed-off-by: Andy Whitcroft a...@canonical.com Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-omap2/board-omap3evm.c | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index c2a0fca..8b8eb36 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -521,8 +521,10 @@ static struct regulator_init_data omap3_evm_vdac = { }; /* VPLL2 for digital video outputs */ -static struct regulator_consumer_supply omap3_evm_vpll2_supply = - REGULATOR_SUPPLY(vdds_dsi, omapdss); +static struct regulator_consumer_supply omap3_evm_vdds_supplies[] = { + REGULATOR_SUPPLY(vdds_sdi, omapdss), + REGULATOR_SUPPLY(vdds_dsi, omapdss), +}; static struct regulator_init_data omap3_evm_vpll2 = { .constraints = { @@ -534,8 +536,8 @@ static struct regulator_init_data omap3_evm_vpll2 = { .valid_ops_mask = REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS, }, - .num_consumer_supplies = 1, - .consumer_supplies = omap3_evm_vpll2_supply, + .num_consumer_supplies = ARRAY_SIZE(omap3_evm_vdds_supplies), + .consumer_supplies = omap3_evm_vdds_supplies, }; static struct twl4030_platform_data omap3evm_twldata = { -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: omapfb: no driver for display
Sung Hee, Could you please try the patch I forwarded to L-O yesterday? https://patchwork.kernel.org/patch/569501/ Thanks, -Bryan On Fri, Feb 18, 2011 at 11:17 AM, Sung Hee Park shpa...@stanford.edu wrote: Hi, I found my frame buffer is not working while I'm testing the linux kernel 2.6.38-rc5 on omap3evm, which used to work fine with 2.6.37. Kernel command line: mem=128M console=ttyO0,115200n8 noinitrd rw root=/dev/mmcblk0p2 rootfstype=ext3 rootwait omapfb.rot ate=3 omapfb.vrfb=y vram=8M earlyprintk=serial,uart0,115200n8 omapdss.debug=1 omapfb.debug=1 OMAPFB: omapfb_init OMAPFB: omapfb_probe omapfb omapfb: no driver for display omapfb omapfb: failed to setup omapfb I found Kevin reported the similar issue here ( http://www.spinics.net/lists/linux-omap/msg44384.html ), and wondering about whether I has been patched. Sumit, could you please let me know if one of your recent patches would solve this problem? If it does, which patches am I supposed to apply on 2.6.38-rc5? Regards, Sung Hee -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- Bryan Wu bryan...@canonical.com Kernel Developer +86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] OMAP4: PandaBoard: Adding DVI support
On Wed, Feb 9, 2011 at 10:08 PM, Gadiyar, Anand gadi...@ti.com wrote: On Wed, Feb 9, 2011 at 7:25 PM, Raghuveer Murthy raghuveer.mur...@ti.com wrote: Adding DVI support to OMAP4 PandaBoard. PandaBoard uses TFP410 DVI Framer chip http://focus.ti.com/lit/ds/symlink/tfp410.pdf The TFP410 gets its power enable and display data over GPIO lines muxed in from OMAP4430. PandaBoard supports other LCD displays through expansion connectors, following board rework. This will disable the DVI interface. However, the existing mux settings remain the same PandaBoard additionally supports display over HDMI interface. It is mutually exclusive to display over DVI. Hence the mux settings need to be configured seperately, as and when HDMI is enabled Also, I2C3 bus used for reading EDID data from DVI Monitors is registered here. Since the design is similar to BeagleBoard, the code for the same is taken from the kernel.org commit ef48dd5cb21 (omap: Adding beagle i2c eeprom driver to read EDID) Reviewed-by: Manjunath G Kondaiah manj...@ti.com Reviewed-by: Anand Gadiyar gadi...@ti.com I've also tested it on the Panda, and gone through this and most of the other patches in the series. So if you like, you could consider this an: Acked-by: Anand Gadiyar gadi...@ti.com Reviewed-by: Nishanth Menon n...@ti.com Reviewed-by: Sumit Semwal sumit.sem...@ti.com Signed-off-by: Raghuveer Murthy raghuveer.mur...@ti.com --- Base url = git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git branch master commit 100b33c8bd8a3235fd0b7948338d6cbb3db3c63d tag 2.6.38-rc4 To make it easier for someone to test, I've extracted this and the 6 dependent series from patchwork, and hosted them in a branch on my devel tree. They are available against v2.6.38-rc4 here: git://dev.omapzoom.org/pub/scm/anand/linux-omap-usb.git in the display-patches-for-v2.6.38-rc4 branch if someone wants to take a look. I fetched this branch which contains 35 patches on top of 2.6.38-rc4. After fixing some conflict, I applied these 35 patches on our Ubuntu ti-omap-dev kernel. With built-in the DSS2 driver and GENERIC_DPI driver, kernel boots fine on my Panda with Ubuntu GUI. But I have to set the kernel boot command args with omapfb.mode=dvi:1024x768MR-24@60 omapdss.def_disp=dvi, pointed out by Sebastien. Without this bootargs, no graphic at all. so as Robert concerned, EDID detection doesn't work. Does that related to I2C driver? I2C driver always tell me timeout in dmesg. Thanks a lot, -- Bryan Wu bryan...@canonical.com Kernel Developer +86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Passing mem=1G to kernel on Panda, system is unstable.
On Fri, Jan 14, 2011 at 1:41 PM, Paul Walmsley p...@pwsan.com wrote: On Thu, 13 Jan 2011, Bryan Wu wrote: On Thu, Jan 13, 2011 at 7:50 AM, Paul Walmsley p...@pwsan.com wrote: On Wed, 12 Jan 2011, Bryan Wu wrote: Does the problem also happen if you boot with 'nosmp' on the kernel command line? Yeah, I think so, since Sebastien reported that 'nosmp' doesn't work either. Will try to find time to give this a shot. You might want to try a build without CONFIG_SMP set to see if it helps. Thanks a lot, man. Sebastien and I will try to disable CONFIG_SMP with mainline kernel on Panda. Is the rootfs that you used downloadable from anywhere? Please check this wiki page: http://omappedia.org/wiki/Ubuntu_rootfs I use following command to build a latest Natty (11.04) Ubuntu rootfs. sudo rootstock -d natty -f ubuntu -l ubuntu -p ubuntu --serial ttyO2 --locale en_US.UTF-8 -s ubuntu-minimal,openssh-server, Thanks, -- Bryan Wu bryan...@canonical.com Kernel Developer +86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Passing mem=1G to kernel on Panda, system is unstable.
On Fri, Jan 14, 2011 at 4:12 PM, Santosh Shilimkar santosh.shilim...@ti.com wrote: Bryan, -Original Message- From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap- ow...@vger.kernel.org] On Behalf Of Bryan Wu Sent: Tuesday, January 11, 2011 10:22 PM To: linux-omap@vger.kernel.org; Ricardo Salveti de Araujo Subject: Passing mem=1G to kernel on Panda, system is unstable. Hi folks, We are trying to build kernel package or GCC natively on OMAP4 panda board. With the mainline 2.6.37 kernel or Ubuntu Natty 2.6.35 based kernel, we met same instabilities on the system when we try to use mem=1G on the board. Please find our bug tracker here: https://bugs.launchpad.net/ubuntu/+source/linux-ti-omap4/+bug/633227 and I think another bug is also related: https://bugs.launchpad.net/ubuntu/+source/linux-ti- omap4/+bug/690370. System will freeze at all when building GCC natively on Panda. Did any folks meet this issue? or we need more simple test case to catch the root cause of this issue. Haven't seen this issue on my SDP with 2.6.37. Do you have Panda for testing? I don't have SDP. Maybe Sebastien can help to verify on SDP. Have you enabled HIGHMEM, when tried mem = 1G on 2.6.37 ? Yeah, CONFIG_HIGHMEM=y for this mainline testing. Please use this kernel config file: http://launchpadlibrarian.net/62061659/mainline_config Thanks, -- Bryan Wu bryan...@canonical.com Kernel Developer +86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Passing mem=1G to kernel on Panda, system is unstable.
On Fri, Jan 14, 2011 at 4:56 PM, Santosh Shilimkar santosh.shilim...@ti.com wrote: -Original Message- From: Santosh Shilimkar [mailto:santosh.shilim...@ti.com] Sent: Friday, January 14, 2011 1:43 PM To: Bryan Wu; linux-omap@vger.kernel.org; Ricardo Salveti de Araujo Subject: RE: Passing mem=1G to kernel on Panda, system is unstable. Bryan, -Original Message- From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap- ow...@vger.kernel.org] On Behalf Of Bryan Wu Sent: Tuesday, January 11, 2011 10:22 PM To: linux-omap@vger.kernel.org; Ricardo Salveti de Araujo Subject: Passing mem=1G to kernel on Panda, system is unstable. Hi folks, We are trying to build kernel package or GCC natively on OMAP4 panda board. With the mainline 2.6.37 kernel or Ubuntu Natty 2.6.35 based kernel, we met same instabilities on the system when we try to use mem=1G on the board. Please find our bug tracker here: https://bugs.launchpad.net/ubuntu/+source/linux-ti- omap4/+bug/633227 and I think another bug is also related: https://bugs.launchpad.net/ubuntu/+source/linux-ti- omap4/+bug/690370. System will freeze at all when building GCC natively on Panda. Did any folks meet this issue? or we need more simple test case to catch the root cause of this issue. Haven't seen this issue on my SDP with 2.6.37. Have you enabled HIGHMEM, when tried mem = 1G on 2.6.37 ? This patch may not be relevant but last week while scanning errata's I came across one which is applicable to OMAP4 ES2.x Am attaching it. Please give a try. Have boot tested with latest mainline tree. No problem. I will try it later. Here is 4:15am, I'll try to sleep for a while. Thanks, -- Bryan Wu bryan...@canonical.com Kernel Developer +86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Passing mem=1G to kernel on Panda, system is unstable.
On Sat, Jan 15, 2011 at 1:22 AM, Santosh Shilimkar santosh.shilim...@ti.com wrote: Seb, -Original Message- From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap- ow...@vger.kernel.org] On Behalf Of Jan, Sebastien Sent: Friday, January 14, 2011 10:41 PM To: Bryan Wu Cc: Paul Walmsley; linux-omap@vger.kernel.org; Ricardo Salveti de Araujo Subject: Re: Passing mem=1G to kernel on Panda, system is unstable. On Fri, Jan 14, 2011 at 11:09 AM, Bryan Wu bryan...@canonical.com wrote: On Fri, Jan 14, 2011 at 1:41 PM, Paul Walmsley p...@pwsan.com wrote: On Thu, 13 Jan 2011, Bryan Wu wrote: On Thu, Jan 13, 2011 at 7:50 AM, Paul Walmsley p...@pwsan.com wrote: On Wed, 12 Jan 2011, Bryan Wu wrote: Does the problem also happen if you boot with 'nosmp' on the kernel command line? Yeah, I think so, since Sebastien reported that 'nosmp' doesn't work either. Will try to find time to give this a shot. You might want to try a build without CONFIG_SMP set to see if it helps. Thanks a lot, man. Sebastien and I will try to disable CONFIG_SMP with mainline kernel on Panda. I just tested with the 2.6.37 mainline kernel and Bryan config, and can reproduce the issue with CONFIG_SMP disabled. Can you try the patch I sent on the list as well ? I've applied this patch to our Ubuntu Natty 2.6.35 based kernel, still can reproduce the issue. But it looks to me this patch makes the building run longer. I'm testing the mainline 2.6.37 kernel + your patch here. I will let you know the result soon. Thanks, -- Bryan Wu bryan...@canonical.com Kernel Developer +86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: OMAP4 ES2.0 Unhandled fault: imprecise external abort
On Fri, Jan 14, 2011 at 4:06 PM, Santosh Shilimkar santosh.shilim...@ti.com wrote: -Original Message- From: TAO HU [mailto:tgh...@motorola.com] Sent: Friday, January 14, 2011 1:29 PM To: Santosh Shilimkar Cc: Bryan Wu; TAO HU; linux-omap Subject: Re: OMAP4 ES2.0 Unhandled fault: imprecise external abort Hi, Santosh I think it depends on whether IRQ is enabled. It is a limitation for current L3 error logging mechanism. L3 IRQ is always enabled except low power states. I guess we patched this part as well so that error is not lost and its logged. It's not a limitation L3 interrupt but behavior of CPU. Because scenario's where the I bit is cleared at CPU level (Interrupt disable), it's immune to interrupts. Note the interrupt is not lost but just got delayed a bit Is there any testcase I can try to make sure the L3 error interrupt is working? Thanks, -- Bryan Wu bryan...@canonical.com Kernel Developer +86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Passing mem=1G to kernel on Panda, system is unstable.
On Sat, Jan 15, 2011 at 1:48 AM, Jan, Sebastien s-...@ti.com wrote: Hi Santosh, On Fri, Jan 14, 2011 at 6:22 PM, Santosh Shilimkar santosh.shilim...@ti.com wrote: I just tested with the 2.6.37 mainline kernel and Bryan config, and can reproduce the issue with CONFIG_SMP disabled. Can you try the patch I sent on the list as well ? Unfortunately, I still can reproduce this issue with mainline 2.6.37 kernel + the patch here: --- [ 3391.102539] Unhandled fault: imprecise external abort (0x1406) at 0x4278f000 /home/ubuntu/ubuntu-natty/drivers/media/dvb/dvb-usb/a800.c:197:1: internal compiler error: Bus error Please submit a full bug report, with preprocessed source if appropriate. See file:///usr/share/doc/gcc-4.5/README.Bugs for instructions. --- -Bryan Bryan is currently testing your patch. I have a build running with HIGHMEM deactivated. I'll also make a try on blaze board. I do not expect any difference here. Note that the only way to trigger this issue for me was to make native compilation of a big component (like native kernel compilation). -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Passing mem=1G to kernel on Panda, system is unstable.
On Sat, Jan 15, 2011 at 2:55 AM, Santosh Shilimkar santosh.shilim...@ti.com wrote: -Original Message- From: coolo...@gmail.com [mailto:coolo...@gmail.com] On Behalf Of Bryan Wu Sent: Saturday, January 15, 2011 12:11 AM To: Jan, Sebastien; Santosh Shilimkar Cc: Paul Walmsley; linux-omap@vger.kernel.org; Ricardo Salveti de Araujo Subject: Re: Passing mem=1G to kernel on Panda, system is unstable. On Sat, Jan 15, 2011 at 1:48 AM, Jan, Sebastien s-...@ti.com wrote: Hi Santosh, On Fri, Jan 14, 2011 at 6:22 PM, Santosh Shilimkar santosh.shilim...@ti.com wrote: I just tested with the 2.6.37 mainline kernel and Bryan config, and can reproduce the issue with CONFIG_SMP disabled. Can you try the patch I sent on the list as well ? Unfortunately, I still can reproduce this issue with mainline 2.6.37 kernel + the patch here: I see. Since it's undefined async abort Mostly some clock/module race. I have one more experimental debug patch if you would like to try out. This patch just configures the interconnect space to SO instead of device memory. No problem, I will try this soon. Thanks, -- Bryan Wu bryan...@canonical.com Kernel Developer +86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Passing mem=1G to kernel on Panda, system is unstable.
On Sat, Jan 15, 2011 at 3:06 AM, Bryan Wu bryan...@canonical.com wrote: On Sat, Jan 15, 2011 at 2:55 AM, Santosh Shilimkar santosh.shilim...@ti.com wrote: -Original Message- From: coolo...@gmail.com [mailto:coolo...@gmail.com] On Behalf Of Bryan Wu Sent: Saturday, January 15, 2011 12:11 AM To: Jan, Sebastien; Santosh Shilimkar Cc: Paul Walmsley; linux-omap@vger.kernel.org; Ricardo Salveti de Araujo Subject: Re: Passing mem=1G to kernel on Panda, system is unstable. On Sat, Jan 15, 2011 at 1:48 AM, Jan, Sebastien s-...@ti.com wrote: Hi Santosh, On Fri, Jan 14, 2011 at 6:22 PM, Santosh Shilimkar santosh.shilim...@ti.com wrote: I just tested with the 2.6.37 mainline kernel and Bryan config, and can reproduce the issue with CONFIG_SMP disabled. Can you try the patch I sent on the list as well ? Unfortunately, I still can reproduce this issue with mainline 2.6.37 kernel + the patch here: I see. Since it's undefined async abort Mostly some clock/module race. I have one more experimental debug patch if you would like to try out. This patch just configures the interconnect space to SO instead of device memory. I applied this patch to 2.6.37 kernel and try the kernel again, still got the same bus error with this patch. for the clock/module race, do you have any simpler test case to generate this issue than building a whole kernel package. Thanks, -- Bryan Wu bryan...@canonical.com Kernel Developer +86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: OMAP4 ES2.0 Unhandled fault: imprecise external abort
On Wed, Nov 24, 2010 at 2:23 PM, Santosh Shilimkar santosh.shilim...@ti.com wrote: -Original Message- From: TAO HU [mailto:tgh...@motorola.com] Sent: Wednesday, November 24, 2010 11:40 AM To: Santosh Shilimkar Cc: TAO HU; Bryan Wu; linux-omap Subject: Re: OMAP4 ES2.0 Unhandled fault: imprecise external abort Hi, Santosh Could you point out the specific kernel option for L3 error debugging? System Type --- [*] Enable L3 error logging I've enabled that for my Panda kernel. How to get the error log? I still got the same Unhandled fault: imprecise external abort message. Maybe L3 does not have any error at all. Thanks a lot, -- Bryan Wu bryan...@canonical.com Kernel Developer +86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Passing mem=1G to kernel on Panda, system is unstable.
On Thu, Jan 13, 2011 at 7:50 AM, Paul Walmsley p...@pwsan.com wrote: On Wed, 12 Jan 2011, Bryan Wu wrote: We are trying to build kernel package or GCC natively on OMAP4 panda board. With the mainline 2.6.37 kernel or Ubuntu Natty 2.6.35 based kernel, we met same instabilities on the system when we try to use mem=1G on the board. Please find our bug tracker here: https://bugs.launchpad.net/ubuntu/+source/linux-ti-omap4/+bug/633227 and I think another bug is also related: https://bugs.launchpad.net/ubuntu/+source/linux-ti-omap4/+bug/690370. System will freeze at all when building GCC natively on Panda. Did any folks meet this issue? or we need more simple test case to catch the root cause of this issue. Does the problem also happen if you boot with 'nosmp' on the kernel command line? Yeah, I think so, since Sebastien reported that 'nosmp' doesn't work either. Thanks, -Bryan -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Section mismatch warnings 2.6.37-rc6
On Fri, Dec 17, 2010 at 7:53 AM, Elvis Dowson elvis.dow...@mac.com wrote: Hi, When I build the linux mainline 2.6.37-rc6, I get 3 section mismatch warnings. What do they indicate? That tells us these 3 functions need to check for the right usage of '__init'. And which defconfig are you using? $ make ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi- uImage -j6 LOCALVERSION= CONFIG_DEBUG_SECTION_MISMATCH=y WARNING: vmlinux.o(.data+0x1b70): Section mismatch in reference from the variable etb_driver to the function .init.text:etb_probe() The variable etb_driver references the function __init etb_probe() If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, WARNING: vmlinux.o(.data+0x1bbc): Section mismatch in reference from the variable etm_driver to the function .init.text:etm_probe() The variable etm_driver references the function __init etm_probe() If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, WARNING: vmlinux.o(.data+0x3477c): Section mismatch in reference from the variable twl_driver to the function .init.text:twl_probe() The variable twl_driver references the function __init twl_probe() If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, I've sent a patch to twl driver maintainer to fix that. Thanks, -- Bryan Wu bryan...@canonical.com Kernel Developer +86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] MFD: TWL/TPS: fix twl_probe section mismatch warning in mfd/twl-core.c
On Wed, Dec 8, 2010 at 12:12 AM, Paul Walmsley p...@pwsan.com wrote: Hello Samuel, On Tue, 7 Dec 2010, Samuel Ortiz wrote: On Mon, Dec 06, 2010 at 06:40:38PM -0700, Paul Walmsley wrote: That's fine with me. Samuel et al, Bryan's already done a patch for this stuff: https://patchwork.kernel.org/patch/367011/ so we should use that instead, if you're happy with it. Samuel, maybe we could get an ack from you on it? The twl driver is not OMAP specific, so this should be a separate patch thatI will merge to my mfd tree. If you really insist in pushing this through Tony's tree, then please add my Acked-by for the mfd part. I don't insist at all :-) Bryan, maybe split your patch into a mach-omap2 patch and a TWL driver-specific patch, and send the latter for Samuel? No problem. I'll do soon. Thanks, -- Bryan Wu bryan...@canonical.com Kernel Developer +86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] OMAP: kill all section mismatch warning for omap2plus_defconfig
This patch will kill following section mismatch warnings: WARNING: vmlinux.o(.text+0x24a00): Section mismatch in reference from the function zoom_twl_gpio_setup() to the (unknown reference) .init.data:(unknown) The function zoom_twl_gpio_setup() references the (unknown reference) __initdata (unknown). This is often because zoom_twl_gpio_setup lacks a __initdata annotation or the annotation of (unknown) is wrong. WARNING: vmlinux.o(.text+0x24bfc): Section mismatch in reference from the function cm_t35_twl_gpio_setup() to the (unknown reference) .init.data:(unknown) The function cm_t35_twl_gpio_setup() references the (unknown reference) __initdata (unknown). This is often because cm_t35_twl_gpio_setup lacks a __initdata annotation or the annotation of (unknown) is wrong. WARNING: vmlinux.o(.data+0x1d3e0): Section mismatch in reference from the variable h4_config to the (unknown reference) .init.data:(unknown) The variable h4_config references the (unknown reference) __initdata (unknown) If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, WARNING: vmlinux.o(.data+0x1dc08): Section mismatch in reference from the variable sdp2430_config to the (unknown reference) .init.data:(unknown) The variable sdp2430_config references the (unknown reference) __initdata (unknown) If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, WARNING: vmlinux.o(.data+0x1e1d8): Section mismatch in reference from the variable apollon_config to the (unknown reference) .init.data:(unknown) The variable apollon_config references the (unknown reference) __initdata (unknown) If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, Signed-off-by: Bryan Wu bryan...@canonical.com Cc: Paul Walmsley p...@pwsan.com --- arch/arm/mach-omap2/board-2430sdp.c |2 +- arch/arm/mach-omap2/board-apollon.c |2 +- arch/arm/mach-omap2/board-cm-t35.c | 11 +++ arch/arm/mach-omap2/board-h4.c |2 +- arch/arm/mach-omap2/board-zoom-peripherals.c |2 +- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index b527f8d..9ab8bb1 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c @@ -135,7 +135,7 @@ static inline void board_smc91x_init(void) #endif -static struct omap_board_config_kernel sdp2430_config[] = { +static struct omap_board_config_kernel sdp2430_config[] __initdata = { {OMAP_TAG_LCD, sdp2430_lcd_config}, }; diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index 2c6db1a..5c432d8 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c @@ -270,7 +270,7 @@ static struct omap_lcd_config apollon_lcd_config __initdata = { .ctrl_name = internal, }; -static struct omap_board_config_kernel apollon_config[] = { +static struct omap_board_config_kernel apollon_config[] __initdata = { { OMAP_TAG_LCD, apollon_lcd_config }, }; diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 63f764e..cd97159 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c @@ -600,8 +600,8 @@ static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = { .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, .phy_reset = true, - .reset_gpio_port[0] = -EINVAL, - .reset_gpio_port[1] = -EINVAL, + .reset_gpio_port[0] = OMAP_MAX_GPIO_LINES + 6, + .reset_gpio_port[1] = OMAP_MAX_GPIO_LINES + 7, .reset_gpio_port[2] = -EINVAL }; @@ -630,12 +630,6 @@ static int cm_t35_twl_gpio_setup(struct device *dev, unsigned gpio, cm_t35_vmmc1_supply.dev = mmc[0].dev; cm_t35_vsim_supply.dev = mmc[0].dev; - /* setup USB with proper PHY reset GPIOs */ - ehci_pdata.reset_gpio_port[0] = gpio + 6; - ehci_pdata.reset_gpio_port[1] = gpio + 7; - - usb_ehci_init(ehci_pdata); - return 0; } @@ -805,6 +799,7 @@ static void __init cm_t35_init(void) cm_t35_init_display(); usb_musb_init(musb_board_data); + usb_ehci_init(ehci_pdata); } MACHINE_START(CM_T35, Compulab CM-T35) diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index 929993b..5549f2c 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c @@ -283,7 +283,7 @@ static struct omap_usb_config h4_usb_config __initdata = { .hmc_mode = 0x00, /* 0:dev|otg 1:disable 2:disable
[PATCH] MFD: TWL/TPS: fix twl_probe section mismatch warning in mfd/twl-core.c
Fix the following section mismatch warning when building omap2plus_defconfig: WARNING: vmlinux.o(.data+0x47d7c): Section mismatch in reference from the variable twl_driver to the function .init.text:twl_probe() Signed-off-by: Bryan Wu bryan...@canonical.com Signed-off-by: Paul Walmsley p...@pwsan.com --- drivers/mfd/twl-core.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index 35275ba..3aa46ff 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c @@ -969,7 +969,7 @@ static int twl_remove(struct i2c_client *client) } /* NOTE: this driver only handles a single twl4030/tps659x0 chip */ -static int __init +static int __devinit twl_probe(struct i2c_client *client, const struct i2c_device_id *id) { int status; -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] OMAP2+: resolve section mismatch warnings in OMAP core code
Paul, I did the similar patch several days ago. https://patchwork.kernel.org/patch/367011/ On Tue, Dec 7, 2010 at 8:32 AM, Paul Walmsley p...@pwsan.com wrote: Resolve the following section mismatch warnings in the OMAP core code when building omap2plus_defconfig: WARNING: vmlinux.o(.text+0x2617c): Section mismatch in reference from the function zoom_twl_gpio_setup() to the (unknown reference) .init.data:(unknown) WARNING: vmlinux.o(.text+0x26378): Section mismatch in reference from the function cm_t35_twl_gpio_setup() to the (unknown reference) .init.data:(unknown) WARNING: vmlinux.o(.data+0x1f460): Section mismatch in reference from the variable h4_config to the (unknown reference) .init.data:(unknown) WARNING: vmlinux.o(.data+0x1fc88): Section mismatch in reference from the variable sdp2430_config to the (unknown reference) .init.data:(unknown) WARNING: vmlinux.o(.data+0x20258): Section mismatch in reference from the variable apollon_config to the (unknown reference) .init.data:(unknown) Signed-off-by: Paul Walmsley p...@pwsan.com --- arch/arm/mach-omap2/board-2430sdp.c | 2 +- arch/arm/mach-omap2/board-apollon.c | 2 +- arch/arm/mach-omap2/board-cm-t35.c | 2 +- arch/arm/mach-omap2/board-h4.c | 2 +- arch/arm/mach-omap2/board-zoom-peripherals.c | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index b527f8d..9ab8bb1 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c @@ -135,7 +135,7 @@ static inline void board_smc91x_init(void) #endif -static struct omap_board_config_kernel sdp2430_config[] = { +static struct omap_board_config_kernel sdp2430_config[] __initdata = { {OMAP_TAG_LCD, sdp2430_lcd_config}, }; diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index 2c6db1a..5c432d8 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c @@ -270,7 +270,7 @@ static struct omap_lcd_config apollon_lcd_config __initdata = { .ctrl_name = internal, }; -static struct omap_board_config_kernel apollon_config[] = { +static struct omap_board_config_kernel apollon_config[] __initdata = { { OMAP_TAG_LCD, apollon_lcd_config }, }; diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 63f764e..df16d69 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c @@ -594,7 +594,7 @@ static struct omap2_hsmmc_info mmc[] = { {} /* Terminator */ }; -static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = { +static struct ehci_hcd_omap_platform_data ehci_pdata = { How about move out the code of ehci init from cm_t35_twl_gpio_setup like others did? .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index 929993b..5549f2c 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c @@ -283,7 +283,7 @@ static struct omap_usb_config h4_usb_config __initdata = { .hmc_mode = 0x00, /* 0:dev|otg 1:disable 2:disable */ }; -static struct omap_board_config_kernel h4_config[] = { +static struct omap_board_config_kernel h4_config[] __initdata = { { OMAP_TAG_LCD, h4_lcd_config }, }; diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c index 86c9b21..e58fe1e 100644 --- a/arch/arm/mach-omap2/board-zoom-peripherals.c +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c @@ -196,7 +196,7 @@ struct wl12xx_platform_data omap_zoom_wlan_data __initdata = { .board_ref_clock = 1, }; -static struct omap2_hsmmc_info mmc[] __initdata = { +static struct omap2_hsmmc_info mmc[] = { { .name = external, .mmc = 1, @@ -224,8 +224,8 @@ static struct omap2_hsmmc_info mmc[] __initdata = { {} /* Terminator */ }; -static int zoom_twl_gpio_setup(struct device *dev, - unsigned gpio, unsigned ngpio) +static int zoom_twl_gpio_setup(struct device *dev, unsigned gpio, + unsigned ngpio) { /* gpio + 0 is mmc0_cd (input/IRQ) */ mmc[0].gpio_cd = gpio + 0; -- 1.7.2.3 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- Bryan Wu bryan...@canonical.com Kernel Developer +86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com
Re: [PATCH] MFD: TWL/TPS: fix twl_probe section mismatch warning in mfd/twl-core.c
On Tue, Dec 7, 2010 at 8:35 AM, Paul Walmsley p...@pwsan.com wrote: Fix the following section mismatch warning when building omap2plus_defconfig: WARNING: vmlinux.o(.data+0x47d7c): Section mismatch in reference from the variable twl_driver to the function .init.text:twl_probe() Signed-off-by: Paul Walmsley p...@pwsan.com Cc: Samuel Ortiz sa...@linux.intel.com --- drivers/mfd/twl-core.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index 35275ba..615cf38 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c @@ -969,7 +969,7 @@ static int twl_remove(struct i2c_client *client) } /* NOTE: this driver only handles a single twl4030/tps659x0 chip */ -static int __init +static int I think we might change __init to __devinit. twl_probe(struct i2c_client *client, const struct i2c_device_id *id) { int status; -- Thanks, -- Bryan Wu bryan...@canonical.com Kernel Developer +86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] OMAP2+: resolve section mismatch warnings in OMAP core code
On Tue, Dec 7, 2010 at 9:38 AM, Paul Walmsley p...@pwsan.com wrote: On Tue, 7 Dec 2010, Bryan Wu wrote: Paul, I did the similar patch several days ago. https://patchwork.kernel.org/patch/367011/ Great, thanks Bryan, in that case yours should be used instead. Thanks, Paul. I guess you work very late today, -:D -Bryan -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/3] OMAP: Introduce Backlight driver for Sharp LS037V7DW01 LCD panel
On Wed, Dec 1, 2010 at 11:32 PM, Tomi Valkeinen tomi.valkei...@nokia.com wrote: Hi, On Tue, 2010-11-30 at 20:07 +0800, ext Bryan Wu wrote: After instroducing generic DPI panel driver for OMAP DSS2 system, we need to split out backlight driver from Sharp LS037V7DW01 panel driver before we move to the generic DPI panel driver. This patchset introcuded backlight driver and cleanup the old Sharp LS037V7DW01 panel driver related code. It's built on mainline 2.6.37-rc4 Bryan Wu (3): Backlight: driver for Sharp LS037V7DW01 panel on OMAP machine OMAP: move Sharp LS LCD panel device to generic DPI panel driver and new backlight driver OMAP: DSS2: remove Sharp LS037V7DW01 panel driver I don't think this is quite the right direction. All the backlight driver does is call a function in the board file. It's not really a sharp ls backlight driver, but rather generic one. I'm not even sure if it needs the dssdev pointer. Since dssdev struct contains backlight releated fields, I passed that into the driver. It can be replaced by a backlight related platform data struct. Then we can remove those backlight related fields from dssdev struct. This kind of backlight is, in a sense, totally separate component from the panel itself. All they have in common is that they are packaged in the same physical display module, and they usually share the same connector. I have seen three kinds of backlights on OMAP devices: - on/off GPIO (like on 3430 SDP) It seems like that we need a gpio_bl.c driver for this kind of usage. - PWM based (zoom seems to have this) I failed to find any PWM or Backlight code in ZOOM boards source file. Is that possible to us pwm_bl.c driver which is used by pxa? - Panel controlled (Taal-panel. Also PWM based, but OMAP doesn't see that) Yeah, I don't plan to reform this driver at this time. The first two could (should?) be totally separate backlights from the panel itself. For those, a generic backlight driver could perhaps work. The third one needs to be quite tied to the panel driver, and I'm not sure how easy it would be to have a separate driver for that. OK, I totally understand you concern now. How about a GPIO based backlight driver for the first 2 cases. Thanks, -- Bryan Wu bryan...@canonical.com Kernel Developer +86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] Backlight: driver for Sharp LS037V7DW01 panel on OMAP machine
On Tue, Nov 30, 2010 at 9:09 PM, Janorkar, Mayuresh ma...@ti.com wrote: -Original Message- From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap- ow...@vger.kernel.org] On Behalf Of Bryan Wu Sent: Tuesday, November 30, 2010 5:38 PM To: tomi.valkei...@nokia.com; linux-omap@vger.kernel.org; linux-arm- ker...@lists.infradead.org; Gadiyar, Anand; rpur...@rpsys.net Subject: [PATCH 1/3] Backlight: driver for Sharp LS037V7DW01 panel on OMAP machine This driver is split from drivers/video/backlight/sharp_ls037v7dw01.c Signed-off-by: Bryan Wu bryan...@canonical.com --- drivers/video/backlight/Kconfig | 10 ++ drivers/video/backlight/Makefile | 1 + drivers/video/backlight/sharp_ls037v7dw01.c | 144 +++ 3 files changed, 155 insertions(+), 0 deletions(-) create mode 100644 drivers/video/backlight/sharp_ls037v7dw01.c diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index e54a337..46b2415 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -307,6 +307,16 @@ config BACKLIGHT_PCF50633 If you have a backlight driven by a NXP PCF50633 MFD, say Y here to enable its driver. +config BACKLIGHT_SHARP_LS037V7DW01 + tristate Backlight driver for SHARP LS037V7DW01 Panel + depends on PANEL_GENERIC_DPI + help + If you are using Sharp LS037V7DW01 LCD panel, say Y here to enable this driver. + + To compile this driver as a module, choose M here: the module will + be called sharp_ls037v7dw01. + + [Mayuresh]: Please do not introduce extra new lines. No problem, I will remove this for next try. endif # BACKLIGHT_CLASS_DEVICE endif # BACKLIGHT_LCD_SUPPORT diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index 44c0f81..c756f49 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile @@ -35,4 +35,5 @@ obj-$(CONFIG_BACKLIGHT_ADP5520) += adp5520_bl.o obj-$(CONFIG_BACKLIGHT_ADP8860) += adp8860_bl.o obj-$(CONFIG_BACKLIGHT_88PM860X) += 88pm860x_bl.o obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o +obj-$(CONFIG_BACKLIGHT_SHARP_LS037V7DW01) += sharp_ls037v7dw01.o diff --git a/drivers/video/backlight/sharp_ls037v7dw01.c b/drivers/video/backlight/sharp_ls037v7dw01.c new file mode 100644 index 000..e90595e --- /dev/null +++ b/drivers/video/backlight/sharp_ls037v7dw01.c @@ -0,0 +1,144 @@ +/* + * Backlight driver for Sharp LS037V7DW01 + * + * Copyright (C) 2010 Canonical Ltd. + * Author: Bryan Wu bryan...@canonical.com + * + * Copyright (C) 2008 Nokia Corporation + * Author: Tomi Valkeinen tomi.valkei...@nokia.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see http://www.gnu.org/licenses/. + */ + +#include linux/module.h +#include linux/device.h +#include linux/backlight.h +#include linux/fb.h +#include linux/err.h + +/* This OMAP platform header file is required by this driver */ +#include plat/display.h + +static int sharp_ls_bl_update_status(struct backlight_device *bl) +{ + struct omap_dss_device *dssdev = bl_get_data(bl); + int level; + + if (!dssdev-set_backlight) + return -EINVAL; + + if (bl-props.fb_blank == FB_BLANK_UNBLANK + bl-props.power == FB_BLANK_UNBLANK) + level = bl-props.brightness; + else + level = 0; + + return dssdev-set_backlight(dssdev, level); +} + +static int sharp_ls_bl_get_brightness(struct backlight_device *bl) +{ + if (bl-props.fb_blank == FB_BLANK_UNBLANK + bl-props.power == FB_BLANK_UNBLANK) + return bl-props.brightness; + + return 0; +} + +static const struct backlight_ops sharp_ls_bl_ops = { + .get_brightness = sharp_ls_bl_get_brightness, + .update_status = sharp_ls_bl_update_status, +}; + +static int __devinit sharp_ls_bl_probe(struct platform_device *pdev) +{ + struct backlight_properties props; + struct backlight_device *bl; + struct omap_dss_device *dssdev = pdev-dev.platform_data; + + if (!dssdev) + return -EINVAL; + + memset(props, 0, sizeof(struct backlight_properties)); + props.max_brightness = dssdev-max_backlight_level; + + bl = backlight_device_register(sharp-ls-bl, dssdev-dev, dssdev, + sharp_ls_bl_ops
[PATCH 0/3] OMAP: Introduce Backlight driver for Sharp LS037V7DW01 LCD panel
After instroducing generic DPI panel driver for OMAP DSS2 system, we need to split out backlight driver from Sharp LS037V7DW01 panel driver before we move to the generic DPI panel driver. This patchset introcuded backlight driver and cleanup the old Sharp LS037V7DW01 panel driver related code. It's built on mainline 2.6.37-rc4 Bryan Wu (3): Backlight: driver for Sharp LS037V7DW01 panel on OMAP machine OMAP: move Sharp LS LCD panel device to generic DPI panel driver and new backlight driver OMAP: DSS2: remove Sharp LS037V7DW01 panel driver arch/arm/mach-omap2/board-3430sdp.c| 18 ++- arch/arm/mach-omap2/board-omap3evm.c | 20 ++- drivers/video/backlight/Kconfig| 10 + drivers/video/backlight/Makefile |1 + drivers/video/backlight/sharp_ls037v7dw01.c| 144 drivers/video/omap2/displays/Kconfig |7 - drivers/video/omap2/displays/Makefile |1 - .../video/omap2/displays/panel-sharp-ls037v7dw01.c | 232 8 files changed, 187 insertions(+), 246 deletions(-) create mode 100644 drivers/video/backlight/sharp_ls037v7dw01.c delete mode 100644 drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/3] Backlight: driver for Sharp LS037V7DW01 panel on OMAP machine
This driver is split from drivers/video/backlight/sharp_ls037v7dw01.c Signed-off-by: Bryan Wu bryan...@canonical.com --- drivers/video/backlight/Kconfig | 10 ++ drivers/video/backlight/Makefile|1 + drivers/video/backlight/sharp_ls037v7dw01.c | 144 +++ 3 files changed, 155 insertions(+), 0 deletions(-) create mode 100644 drivers/video/backlight/sharp_ls037v7dw01.c diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index e54a337..46b2415 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -307,6 +307,16 @@ config BACKLIGHT_PCF50633 If you have a backlight driven by a NXP PCF50633 MFD, say Y here to enable its driver. +config BACKLIGHT_SHARP_LS037V7DW01 + tristate Backlight driver for SHARP LS037V7DW01 Panel + depends on PANEL_GENERIC_DPI + help + If you are using Sharp LS037V7DW01 LCD panel, say Y here to enable this driver. + + To compile this driver as a module, choose M here: the module will + be called sharp_ls037v7dw01. + + endif # BACKLIGHT_CLASS_DEVICE endif # BACKLIGHT_LCD_SUPPORT diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index 44c0f81..c756f49 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile @@ -35,4 +35,5 @@ obj-$(CONFIG_BACKLIGHT_ADP5520) += adp5520_bl.o obj-$(CONFIG_BACKLIGHT_ADP8860)+= adp8860_bl.o obj-$(CONFIG_BACKLIGHT_88PM860X) += 88pm860x_bl.o obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o +obj-$(CONFIG_BACKLIGHT_SHARP_LS037V7DW01) += sharp_ls037v7dw01.o diff --git a/drivers/video/backlight/sharp_ls037v7dw01.c b/drivers/video/backlight/sharp_ls037v7dw01.c new file mode 100644 index 000..e90595e --- /dev/null +++ b/drivers/video/backlight/sharp_ls037v7dw01.c @@ -0,0 +1,144 @@ +/* + * Backlight driver for Sharp LS037V7DW01 + * + * Copyright (C) 2010 Canonical Ltd. + * Author: Bryan Wu bryan...@canonical.com + * + * Copyright (C) 2008 Nokia Corporation + * Author: Tomi Valkeinen tomi.valkei...@nokia.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see http://www.gnu.org/licenses/. + */ + +#include linux/module.h +#include linux/device.h +#include linux/backlight.h +#include linux/fb.h +#include linux/err.h + +/* This OMAP platform header file is required by this driver */ +#include plat/display.h + +static int sharp_ls_bl_update_status(struct backlight_device *bl) +{ + struct omap_dss_device *dssdev = bl_get_data(bl); + int level; + + if (!dssdev-set_backlight) + return -EINVAL; + + if (bl-props.fb_blank == FB_BLANK_UNBLANK + bl-props.power == FB_BLANK_UNBLANK) + level = bl-props.brightness; + else + level = 0; + + return dssdev-set_backlight(dssdev, level); +} + +static int sharp_ls_bl_get_brightness(struct backlight_device *bl) +{ + if (bl-props.fb_blank == FB_BLANK_UNBLANK + bl-props.power == FB_BLANK_UNBLANK) + return bl-props.brightness; + + return 0; +} + +static const struct backlight_ops sharp_ls_bl_ops = { + .get_brightness = sharp_ls_bl_get_brightness, + .update_status = sharp_ls_bl_update_status, +}; + +static int __devinit sharp_ls_bl_probe(struct platform_device *pdev) +{ + struct backlight_properties props; + struct backlight_device *bl; + struct omap_dss_device *dssdev = pdev-dev.platform_data; + + if (!dssdev) + return -EINVAL; + + memset(props, 0, sizeof(struct backlight_properties)); + props.max_brightness = dssdev-max_backlight_level; + + bl = backlight_device_register(sharp-ls-bl, dssdev-dev, dssdev, + sharp_ls_bl_ops, props); + if (IS_ERR(bl)) + return PTR_ERR(bl); + + bl-props.fb_blank = FB_BLANK_UNBLANK; + bl-props.power = FB_BLANK_UNBLANK; + bl-props.brightness = dssdev-max_backlight_level; + backlight_update_status(bl); + + platform_set_drvdata(pdev, bl); + return 0; +} + +static int __devexit sharp_ls_bl_remove(struct platform_device *pdev) +{ + struct backlight_device *bl = platform_get_drvdata(pdev); + + bl-props.power = FB_BLANK_POWERDOWN; + backlight_update_status(bl); + backlight_device_unregister(bl); + + return 0; +} + +#ifdef
[PATCH 2/3] OMAP: move Sharp LS LCD panel device to generic DPI panel driver and new backlight driver
Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-omap2/board-3430sdp.c | 18 +++--- arch/arm/mach-omap2/board-omap3evm.c | 20 +--- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 1ca0156..4c7eaf0 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -261,14 +261,25 @@ static void sdp3430_panel_disable_tv(struct omap_dss_device *dssdev) { } +static struct panel_generic_dpi_data lcd_panel = { + .name = sharp_ls, + .platform_enable= sdp3430_panel_enable_lcd, + .platform_disable = sdp3430_panel_disable_lcd, +}; static struct omap_dss_device sdp3430_lcd_device = { .name = lcd, - .driver_name= sharp_ls_panel, .type = OMAP_DISPLAY_TYPE_DPI, + .driver_name= generic_dpi_panel, + .data = lcd_panel, .phy.dpi.data_lines = 16, - .platform_enable= sdp3430_panel_enable_lcd, - .platform_disable = sdp3430_panel_disable_lcd, +}; + +static struct platform_device sdp3430_lcd_backlight_device = { + .name = sharp-ls-bl, + .dev= { + .platform_data = sdp3430_lcd_device, + }, }; static struct panel_generic_dpi_data dvi_panel = { @@ -322,6 +333,7 @@ static struct regulator_consumer_supply sdp3430_vdda_dac_supply = { static struct platform_device *sdp3430_devices[] __initdata = { sdp3430_dss_device, + sdp3430_lcd_backlight_device, }; static struct omap_board_config_kernel sdp3430_config[] __initdata = { diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 369cbdc..4c507de 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -255,15 +255,28 @@ static void omap3_evm_disable_lcd(struct omap_dss_device *dssdev) lcd_enabled = 0; } +static struct panel_generic_dpi_data lcd_panel = { + .name = sharp_ls, + .platform_enable= omap3_evm_enable_lcd, + .platform_disable = omap3_evm_disable_lcd, +}; + static struct omap_dss_device omap3_evm_lcd_device = { .name = lcd, - .driver_name= sharp_ls_panel, .type = OMAP_DISPLAY_TYPE_DPI, + .driver_name= generic_dpi_panel, + .data = lcd_panel, .phy.dpi.data_lines = 18, - .platform_enable= omap3_evm_enable_lcd, - .platform_disable = omap3_evm_disable_lcd, }; +static struct platform_device omap3_evm_lcd_backlight_device = { + .name = sharp-ls-bl, + .dev= { + .platform_data = omap3_evm_lcd_device, + }, +}; + + static int omap3_evm_enable_tv(struct omap_dss_device *dssdev) { return 0; @@ -636,6 +649,7 @@ static void __init omap3_evm_init_irq(void) static struct platform_device *omap3_evm_devices[] __initdata = { omap3_evm_dss_device, + omap3_evm_lcd_backlight_device, }; static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = { -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/3] OMAP: DSS2: remove Sharp LS037V7DW01 panel driver
panel-generic-dpi.c and backlight driver sharp-ls037v7dw01.c are the replacement. Signed-off-by: Bryan Wu bryan...@canonical.com --- drivers/video/omap2/displays/Kconfig |7 - drivers/video/omap2/displays/Makefile |1 - .../video/omap2/displays/panel-sharp-ls037v7dw01.c | 232 3 files changed, 0 insertions(+), 240 deletions(-) delete mode 100644 drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig index 9c09afd..304d214 100644 --- a/drivers/video/omap2/displays/Kconfig +++ b/drivers/video/omap2/displays/Kconfig @@ -9,13 +9,6 @@ config PANEL_GENERIC_DPI Supports LCD Panel used in TI SDP3430 and EVM boards, OMAP3517 EVM boards and CM-T35. -config PANEL_SHARP_LS037V7DW01 -tristate Sharp LS037V7DW01 LCD Panel -depends on OMAP2_DSS -select BACKLIGHT_CLASS_DEVICE -help - LCD Panel used in TI's SDP3430 and EVM boards - config PANEL_TAAL tristate Taal DSI Panel depends on OMAP2_DSS_DSI diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile index 3bebe4d..450965b 100644 --- a/drivers/video/omap2/displays/Makefile +++ b/drivers/video/omap2/displays/Makefile @@ -1,5 +1,4 @@ obj-$(CONFIG_PANEL_GENERIC_DPI) += panel-generic-dpi.o -obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o obj-$(CONFIG_PANEL_TAAL) += panel-taal.o obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o diff --git a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c deleted file mode 100644 index 9a138f6..000 --- a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c +++ /dev/null @@ -1,232 +0,0 @@ -/* - * LCD panel driver for Sharp LS037V7DW01 - * - * Copyright (C) 2008 Nokia Corporation - * Author: Tomi Valkeinen tomi.valkei...@nokia.com - * - * 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. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see http://www.gnu.org/licenses/. - */ - -#include linux/module.h -#include linux/delay.h -#include linux/device.h -#include linux/backlight.h -#include linux/fb.h -#include linux/err.h -#include linux/slab.h - -#include plat/display.h - -struct sharp_data { - struct backlight_device *bl; -}; - -static struct omap_video_timings sharp_ls_timings = { - .x_res = 480, - .y_res = 640, - - .pixel_clock= 19200, - - .hsw= 2, - .hfp= 1, - .hbp= 28, - - .vsw= 1, - .vfp= 1, - .vbp= 1, -}; - -static int sharp_ls_bl_update_status(struct backlight_device *bl) -{ - struct omap_dss_device *dssdev = dev_get_drvdata(bl-dev); - int level; - - if (!dssdev-set_backlight) - return -EINVAL; - - if (bl-props.fb_blank == FB_BLANK_UNBLANK - bl-props.power == FB_BLANK_UNBLANK) - level = bl-props.brightness; - else - level = 0; - - return dssdev-set_backlight(dssdev, level); -} - -static int sharp_ls_bl_get_brightness(struct backlight_device *bl) -{ - if (bl-props.fb_blank == FB_BLANK_UNBLANK - bl-props.power == FB_BLANK_UNBLANK) - return bl-props.brightness; - - return 0; -} - -static const struct backlight_ops sharp_ls_bl_ops = { - .get_brightness = sharp_ls_bl_get_brightness, - .update_status = sharp_ls_bl_update_status, -}; - - - -static int sharp_ls_panel_probe(struct omap_dss_device *dssdev) -{ - struct backlight_properties props; - struct backlight_device *bl; - struct sharp_data *sd; - int r; - - dssdev-panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS | - OMAP_DSS_LCD_IHS; - dssdev-panel.acb = 0x28; - dssdev-panel.timings = sharp_ls_timings; - - sd = kzalloc(sizeof(*sd), GFP_KERNEL); - if (!sd) - return -ENOMEM; - - dev_set_drvdata(dssdev-dev, sd); - - memset(props, 0, sizeof(struct backlight_properties)); - props.max_brightness = dssdev-max_backlight_level; - - bl = backlight_device_register(sharp-ls, dssdev-dev, dssdev, - sharp_ls_bl_ops, props); - if (IS_ERR(bl)) { - r = PTR_ERR(bl); - kfree(sd); - return r; - } - sd-bl = bl; - - bl
[PATCH] OMAP: kill all section mismatch warning for omap2plus_defconfig
This patch will kill following section mismatch warnings and it's built based on 2.6.37-rc4 WARNING: vmlinux.o(.text+0x24a00): Section mismatch in reference from the function zoom_twl_gpio_setup() to the (unknown reference) .init.data:(unknown) The function zoom_twl_gpio_setup() references the (unknown reference) __initdata (unknown). This is often because zoom_twl_gpio_setup lacks a __initdata annotation or the annotation of (unknown) is wrong. WARNING: vmlinux.o(.text+0x24bfc): Section mismatch in reference from the function cm_t35_twl_gpio_setup() to the (unknown reference) .init.data:(unknown) The function cm_t35_twl_gpio_setup() references the (unknown reference) __initdata (unknown). This is often because cm_t35_twl_gpio_setup lacks a __initdata annotation or the annotation of (unknown) is wrong. WARNING: vmlinux.o(.data+0x1d3e0): Section mismatch in reference from the variable h4_config to the (unknown reference) .init.data:(unknown) The variable h4_config references the (unknown reference) __initdata (unknown) If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, WARNING: vmlinux.o(.data+0x1dc08): Section mismatch in reference from the variable sdp2430_config to the (unknown reference) .init.data:(unknown) The variable sdp2430_config references the (unknown reference) __initdata (unknown) If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, WARNING: vmlinux.o(.data+0x1e1d8): Section mismatch in reference from the variable apollon_config to the (unknown reference) .init.data:(unknown) The variable apollon_config references the (unknown reference) __initdata (unknown) If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, WARNING: vmlinux.o(.data+0x473fc): Section mismatch in reference from the variable twl_driver to the function .init.text:twl_probe() The variable twl_driver references the function __init twl_probe() If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-omap2/board-2430sdp.c |2 +- arch/arm/mach-omap2/board-apollon.c |2 +- arch/arm/mach-omap2/board-cm-t35.c | 11 +++ arch/arm/mach-omap2/board-h4.c |2 +- arch/arm/mach-omap2/board-zoom-peripherals.c |2 +- drivers/mfd/twl-core.c |2 +- 6 files changed, 8 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index b527f8d..9ab8bb1 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c @@ -135,7 +135,7 @@ static inline void board_smc91x_init(void) #endif -static struct omap_board_config_kernel sdp2430_config[] = { +static struct omap_board_config_kernel sdp2430_config[] __initdata = { {OMAP_TAG_LCD, sdp2430_lcd_config}, }; diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index 2c6db1a..5c432d8 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c @@ -270,7 +270,7 @@ static struct omap_lcd_config apollon_lcd_config __initdata = { .ctrl_name = internal, }; -static struct omap_board_config_kernel apollon_config[] = { +static struct omap_board_config_kernel apollon_config[] __initdata = { { OMAP_TAG_LCD, apollon_lcd_config }, }; diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 63f764e..cd97159 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c @@ -600,8 +600,8 @@ static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = { .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, .phy_reset = true, - .reset_gpio_port[0] = -EINVAL, - .reset_gpio_port[1] = -EINVAL, + .reset_gpio_port[0] = OMAP_MAX_GPIO_LINES + 6, + .reset_gpio_port[1] = OMAP_MAX_GPIO_LINES + 7, .reset_gpio_port[2] = -EINVAL }; @@ -630,12 +630,6 @@ static int cm_t35_twl_gpio_setup(struct device *dev, unsigned gpio, cm_t35_vmmc1_supply.dev = mmc[0].dev; cm_t35_vsim_supply.dev = mmc[0].dev; - /* setup USB with proper PHY reset GPIOs */ - ehci_pdata.reset_gpio_port[0] = gpio + 6; - ehci_pdata.reset_gpio_port[1] = gpio + 7; - - usb_ehci_init(ehci_pdata); - return 0; } @@ -805,6 +799,7 @@ static void __init cm_t35_init(void) cm_t35_init_display
Re: OMAP4 ES2.0 Unhandled fault: imprecise external abort
Tao Hu, Did you try the similar solution in our Ubuntu kernel? We suspect it related to HIGHMEM, SMP and cache control code. And how about your test case? Thanks a lot, -Bryan On Wed, Nov 24, 2010 at 11:11 AM, TAO HU tgh...@motorola.com wrote: Hi, All We got following errors on OMAP ES2.0 board. And noticed a similar case was reported at below link http://www.opensubscriber.com/message/kernel-t...@lists.ubuntu.com/14591440.html Is any conclusion/fix available? 1[ 348.873840] Unhandled fault: imprecise external abort (0x1406) at 0x462d301c 1[ 348.885040] Unhandled fault: imprecise external abort (0x1406) at 0xbe8fec78 1[ 348.897247] Unhandled fault: imprecise external abort (0x1406) at 0xbe8fec78 1[ 348.954772] Unhandled fault: imprecise external abort (0x1406) at 0xb000c454 1[ 348.967590] Unhandled fault: imprecise external abort (0x1406) at 0xb000c454 1[ 348.989471] Unhandled fault: imprecise external abort (0x1406) at 0xbeb02fb8 4[ 349.006683] Process 2664(coredump) has RLIMIT_CORE set to 1 4[ 349.012481] Aborting core 1[ 349.023040] Unhandled fault: imprecise external abort (0x1406) at 0xbeb02fb8 1[ 349.041625] Unhandled fault: imprecise external abort (0x1406) at 0xbed6cfbc 4[ 349.061370] Process 2665(kkk) has RLIMIT_CORE set to 1 4[ 349.067810] Aborting core 0[ 349.077362] Kernel panic - not syncing: Attempted to kill init! -- Best Regards Hu Tao -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: OMAP4 ES2.0 Unhandled fault: imprecise external abort
Hu Tao, We hit this issue every time when we build the kernel on the board. Are you running some stress testing program on the board? Thanks, -Bryan On Wed, Nov 24, 2010 at 12:34 PM, TAO HU tgh...@motorola.com wrote: Hi, Bryan Thanks. Unfortunately, it is not easy to reproduce the problem in our HW. We only observed 2~3 times so far. But we do enable HIGHMEM, SMP and L2 cache in our config. That's why I'd like to know the root cause. On Wed, Nov 24, 2010 at 12:21 PM, Bryan Wu bryan...@canonical.com wrote: Tao Hu, Did you try the similar solution in our Ubuntu kernel? We suspect it related to HIGHMEM, SMP and cache control code. And how about your test case? Thanks a lot, -Bryan On Wed, Nov 24, 2010 at 11:11 AM, TAO HU tgh...@motorola.com wrote: Hi, All We got following errors on OMAP ES2.0 board. And noticed a similar case was reported at below link http://www.opensubscriber.com/message/kernel-t...@lists.ubuntu.com/14591440.html Is any conclusion/fix available? 1[ 348.873840] Unhandled fault: imprecise external abort (0x1406) at 0x462d301c 1[ 348.885040] Unhandled fault: imprecise external abort (0x1406) at 0xbe8fec78 1[ 348.897247] Unhandled fault: imprecise external abort (0x1406) at 0xbe8fec78 1[ 348.954772] Unhandled fault: imprecise external abort (0x1406) at 0xb000c454 1[ 348.967590] Unhandled fault: imprecise external abort (0x1406) at 0xb000c454 1[ 348.989471] Unhandled fault: imprecise external abort (0x1406) at 0xbeb02fb8 4[ 349.006683] Process 2664(coredump) has RLIMIT_CORE set to 1 4[ 349.012481] Aborting core 1[ 349.023040] Unhandled fault: imprecise external abort (0x1406) at 0xbeb02fb8 1[ 349.041625] Unhandled fault: imprecise external abort (0x1406) at 0xbed6cfbc 4[ 349.061370] Process 2665(kkk) has RLIMIT_CORE set to 1 4[ 349.067810] Aborting core 0[ 349.077362] Kernel panic - not syncing: Attempted to kill init! -- Best Regards Hu Tao -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- Best Regards Hu Tao -- Bryan Wu bryan...@canonical.com Kernel Developer +86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #8)
On Thu, Nov 18, 2010 at 5:11 PM, Tomi Valkeinen tomi.valkei...@nokia.com wrote: On Thu, 2010-11-18 at 10:14 +0800, ext Bryan Wu wrote: On Wed, Nov 17, 2010 at 10:18 PM, Tomi Valkeinen Are you also interested in solving the backlight issue? =) Yeah, can I start with drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c. I plan to move the blacklight code to drivers/video/blacklight/ and let sharp_ls to use panel-generic-dpi.c driver. Yes, I think that's a good solution for the panels which have a separate backlight (ie. all these dummy panels). However, I'm not sure how that would work for panels with more integrated backlight, for example Taal. But we don't need to worry about that right now. As I'm working on the sharp-ls panel driver, I just find the backlight code is almost dummy functions which will call dssdev-set_backlight(). How about create platform driver for sharp-ls backlight driver? We pass those dssdev data from platform data struct. Thanks a lot, -- Bryan Wu bryan...@canonical.com Kernel Developer +86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #8)
There are 4 duplicated DPI panel drivers in DSS2 display driver. They are similar and a generic DPI panel driver can support all them with specific panel configuration. And new DPI panel driver can be easily supported by adding panel configurations into generic panel DPI driver. This patchset introduces a generic panel DPI driver, remove 3 panel drivers and enable generic panel DPI driver in board files. And it is based on 2.6.37-rc2. Building with omap2plus_defconfig is successful. Keep sharp_ls_panel, since it contains blacklight control code which will be moved out later. Bryan Wu (3): OMAP: DSS2: Add generic DPI panel display driver OMAP: use generic DPI panel driver in board files OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers arch/arm/mach-omap2/board-3430sdp.c| 12 +- arch/arm/mach-omap2/board-am3517evm.c | 23 +- arch/arm/mach-omap2/board-cm-t35.c | 23 +- arch/arm/mach-omap2/board-devkit8000.c | 26 +- arch/arm/mach-omap2/board-igep0020.c | 12 +- arch/arm/mach-omap2/board-omap3beagle.c| 12 +- arch/arm/mach-omap2/board-omap3evm.c | 12 +- arch/arm/mach-omap2/board-omap3stalker.c | 23 +- .../arm/plat-omap/include/plat/panel-generic-dpi.h | 37 ++ drivers/video/omap2/displays/Kconfig | 22 +- drivers/video/omap2/displays/Makefile |4 +- drivers/video/omap2/displays/panel-generic-dpi.c | 355 drivers/video/omap2/displays/panel-generic.c | 174 -- .../video/omap2/displays/panel-sharp-lq043t1dg01.c | 165 - .../video/omap2/displays/panel-toppoly-tdo35s.c| 164 - 15 files changed, 504 insertions(+), 560 deletions(-) create mode 100644 arch/arm/plat-omap/include/plat/panel-generic-dpi.h create mode 100644 drivers/video/omap2/displays/panel-generic-dpi.c delete mode 100644 drivers/video/omap2/displays/panel-generic.c delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c delete mode 100644 drivers/video/omap2/displays/panel-toppoly-tdo35s.c -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/3] OMAP: DSS2: Add generic DPI panel display driver
Generic DPI panel driver includes the driver and 4 similar panel configurations. It will match the panel name which is passed from platform data and setup the right configurations. With generic DPI panel driver, we can remove those 4 duplicated panel display drivers. In the future, it is simple for us just add new panel configuration date in panel-generic-dpi.c to support new display panel. Signed-off-by: Bryan Wu bryan...@canonical.com --- .../arm/plat-omap/include/plat/panel-generic-dpi.h | 37 ++ drivers/video/omap2/displays/Kconfig |8 + drivers/video/omap2/displays/Makefile |1 + drivers/video/omap2/displays/panel-generic-dpi.c | 355 4 files changed, 401 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-omap/include/plat/panel-generic-dpi.h create mode 100644 drivers/video/omap2/displays/panel-generic-dpi.c diff --git a/arch/arm/plat-omap/include/plat/panel-generic-dpi.h b/arch/arm/plat-omap/include/plat/panel-generic-dpi.h new file mode 100644 index 000..7906197 --- /dev/null +++ b/arch/arm/plat-omap/include/plat/panel-generic-dpi.h @@ -0,0 +1,37 @@ +/* + * Header for generic DPI panel driver + * + * Copyright (C) 2010 Canonical Ltd. + * Author: Bryan Wu bryan...@canonical.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see http://www.gnu.org/licenses/. + */ + +#ifndef __ARCH_ARM_PLAT_OMAP_PANEL_GENERIC_DPI_H +#define __ARCH_ARM_PLAT_OMAP_PANEL_GENERIC_DPI_H + +#include display.h + +/** + * struct panel_generic_dpi_data - panel driver configuration data + * @name: panel name + * @platform_enable: platform specific panel enable function + * @platform_disable: platform specific panel disable function + */ +struct panel_generic_dpi_data { + const char *name; + int (*platform_enable)(struct omap_dss_device *dssdev); + void (*platform_disable)(struct omap_dss_device *dssdev); +}; + +#endif /* __ARCH_ARM_PLAT_OMAP_PANEL_GENERIC_DPI_H */ diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig index 12327bb..cb3e339 100644 --- a/drivers/video/omap2/displays/Kconfig +++ b/drivers/video/omap2/displays/Kconfig @@ -1,6 +1,14 @@ menu OMAP2/3 Display Device Drivers depends on OMAP2_DSS +config PANEL_GENERIC_DPI +tristate Generic DPI Panel +help + Generic DPI panel driver. + Supports DVI output for Beagle and OMAP3 SDP. + Supports LCD Panel used in TI SDP3430 and EVM boards, + OMAP3517 EVM boards and CM-T35. + config PANEL_GENERIC tristate Generic Panel help diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile index aa38609..022058c 100644 --- a/drivers/video/omap2/displays/Makefile +++ b/drivers/video/omap2/displays/Makefile @@ -1,3 +1,4 @@ +obj-$(CONFIG_PANEL_GENERIC_DPI) += panel-generic-dpi.o obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c new file mode 100644 index 000..6702cf6 --- /dev/null +++ b/drivers/video/omap2/displays/panel-generic-dpi.c @@ -0,0 +1,355 @@ +/* + * Generic DPI Panels support + * + * Copyright (C) 2010 Canonical Ltd. + * Author: Bryan Wu bryan...@canonical.com + * + * Copyright (C) 2008 Nokia Corporation + * Author: Tomi Valkeinen tomi.valkei...@nokia.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see http://www.gnu.org/licenses/. + */ + +#include linux/module.h +#include linux/delay.h +#include linux/slab.h + +#include plat/panel-generic-dpi.h + +struct panel_config { + struct omap_video_timings timings; + + int acbi; /* ac-bias pin transitions per interrupt */ + /* Unit: line clocks */ + int acb;/* ac-bias pin frequency
[PATCH 2/3] OMAP: use generic DPI panel driver in board files
Still keep sharp_ls_panel, since the sharp_ls_panel driver contains blacklight control driver code which will be moved out later. Then we can use generic DPI driver for sharp_ls_panel. Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-omap2/board-3430sdp.c | 12 +--- arch/arm/mach-omap2/board-am3517evm.c| 23 +-- arch/arm/mach-omap2/board-cm-t35.c | 23 +-- arch/arm/mach-omap2/board-devkit8000.c | 26 ++ arch/arm/mach-omap2/board-igep0020.c | 12 +--- arch/arm/mach-omap2/board-omap3beagle.c | 12 +--- arch/arm/mach-omap2/board-omap3evm.c | 12 +--- arch/arm/mach-omap2/board-omap3stalker.c | 23 +-- 8 files changed, 105 insertions(+), 38 deletions(-) diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 4e3742c..1ca0156 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -38,6 +38,7 @@ #include plat/dma.h #include plat/gpmc.h #include plat/display.h +#include plat/panel-generic-dpi.h #include plat/gpmc-smc91x.h @@ -270,13 +271,18 @@ static struct omap_dss_device sdp3430_lcd_device = { .platform_disable = sdp3430_panel_disable_lcd, }; +static struct panel_generic_dpi_data dvi_panel = { + .name = generic, + .platform_enable= sdp3430_panel_enable_dvi, + .platform_disable = sdp3430_panel_disable_dvi, +}; + static struct omap_dss_device sdp3430_dvi_device = { .name = dvi, - .driver_name= generic_panel, .type = OMAP_DISPLAY_TYPE_DPI, + .driver_name= generic_dpi_panel, + .data = dvi_panel, .phy.dpi.data_lines = 24, - .platform_enable= sdp3430_panel_enable_dvi, - .platform_disable = sdp3430_panel_disable_dvi, }; static struct omap_dss_device sdp3430_tv_device = { diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index 0739950..851683f 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c @@ -35,6 +35,7 @@ #include plat/common.h #include plat/usb.h #include plat/display.h +#include plat/panel-generic-dpi.h #include mux.h #include control.h @@ -303,13 +304,18 @@ static void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev) lcd_enabled = 0; } +static struct panel_generic_dpi_data lcd_panel = { + .name = sharp_lq, + .platform_enable= am3517_evm_panel_enable_lcd, + .platform_disable = am3517_evm_panel_disable_lcd, +}; + static struct omap_dss_device am3517_evm_lcd_device = { .type = OMAP_DISPLAY_TYPE_DPI, .name = lcd, - .driver_name= sharp_lq_panel, + .driver_name= generic_dpi_panel, + .data = lcd_panel, .phy.dpi.data_lines = 16, - .platform_enable= am3517_evm_panel_enable_lcd, - .platform_disable = am3517_evm_panel_disable_lcd, }; static int am3517_evm_panel_enable_tv(struct omap_dss_device *dssdev) @@ -346,13 +352,18 @@ static void am3517_evm_panel_disable_dvi(struct omap_dss_device *dssdev) dvi_enabled = 0; } +static struct panel_generic_dpi_data dvi_panel = { + .name = generic, + .platform_enable= am3517_evm_panel_enable_dvi, + .platform_disable = am3517_evm_panel_disable_dvi, +}; + static struct omap_dss_device am3517_evm_dvi_device = { .type = OMAP_DISPLAY_TYPE_DPI, .name = dvi, - .driver_name= generic_panel, + .driver_name= generic_dpi_panel, + .data = dvi_panel, .phy.dpi.data_lines = 24, - .platform_enable= am3517_evm_panel_enable_dvi, - .platform_disable = am3517_evm_panel_disable_dvi, }; static struct omap_dss_device *am3517_evm_dss_devices[] = { diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 63f764e..e91c986 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c @@ -46,6 +46,7 @@ #include plat/gpmc.h #include plat/usb.h #include plat/display.h +#include plat/panel-generic-dpi.h #include plat/mcspi.h #include mach/hardware.h @@ -351,22 +352,32 @@ static void cm_t35_panel_disable_tv(struct omap_dss_device *dssdev) { } +static struct panel_generic_dpi_data lcd_panel = { + .name = toppoly_tdo35s, + .platform_enable= cm_t35_panel_enable_lcd, + .platform_disable = cm_t35_panel_disable_lcd, +}; + static struct omap_dss_device cm_t35_lcd_device = { .name
[PATCH 3/3] OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers
Still keep sharp_ls_panel driver, because it contains blacklight control driver. Signed-off-by: Bryan Wu bryan...@canonical.com --- drivers/video/omap2/displays/Kconfig | 18 -- drivers/video/omap2/displays/Makefile |3 - drivers/video/omap2/displays/panel-generic.c | 174 .../video/omap2/displays/panel-sharp-lq043t1dg01.c | 165 --- .../video/omap2/displays/panel-toppoly-tdo35s.c| 164 -- 5 files changed, 0 insertions(+), 524 deletions(-) delete mode 100644 drivers/video/omap2/displays/panel-generic.c delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c delete mode 100644 drivers/video/omap2/displays/panel-toppoly-tdo35s.c diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig index cb3e339..9c09afd 100644 --- a/drivers/video/omap2/displays/Kconfig +++ b/drivers/video/omap2/displays/Kconfig @@ -9,12 +9,6 @@ config PANEL_GENERIC_DPI Supports LCD Panel used in TI SDP3430 and EVM boards, OMAP3517 EVM boards and CM-T35. -config PANEL_GENERIC -tristate Generic Panel -help - Generic panel driver. - Used for DVI output for Beagle and OMAP3 SDP. - config PANEL_SHARP_LS037V7DW01 tristate Sharp LS037V7DW01 LCD Panel depends on OMAP2_DSS @@ -22,24 +16,12 @@ config PANEL_SHARP_LS037V7DW01 help LCD Panel used in TI's SDP3430 and EVM boards -config PANEL_SHARP_LQ043T1DG01 -tristate Sharp LQ043T1DG01 LCD Panel -depends on OMAP2_DSS -help - LCD Panel used in TI's OMAP3517 EVM boards - config PANEL_TAAL tristate Taal DSI Panel depends on OMAP2_DSS_DSI help Taal DSI command mode panel from TPO. -config PANEL_TOPPOLY_TDO35S -tristate Toppoly TDO35S LCD Panel support -depends on OMAP2_DSS -help - LCD Panel used in CM-T35 - config PANEL_TPO_TD043MTEA1 tristate TPO TD043MTEA1 LCD Panel depends on OMAP2_DSS SPI diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile index 022058c..3bebe4d 100644 --- a/drivers/video/omap2/displays/Makefile +++ b/drivers/video/omap2/displays/Makefile @@ -1,9 +1,6 @@ obj-$(CONFIG_PANEL_GENERIC_DPI) += panel-generic-dpi.o -obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o -obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o obj-$(CONFIG_PANEL_TAAL) += panel-taal.o -obj-$(CONFIG_PANEL_TOPPOLY_TDO35S) += panel-toppoly-tdo35s.o obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o diff --git a/drivers/video/omap2/displays/panel-generic.c b/drivers/video/omap2/displays/panel-generic.c deleted file mode 100644 index 395a68d..000 --- a/drivers/video/omap2/displays/panel-generic.c +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Generic panel support - * - * Copyright (C) 2008 Nokia Corporation - * Author: Tomi Valkeinen tomi.valkei...@nokia.com - * - * 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. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see http://www.gnu.org/licenses/. - */ - -#include linux/module.h -#include linux/delay.h - -#include plat/display.h - -static struct omap_video_timings generic_panel_timings = { - /* 640 x 480 @ 60 Hz Reduced blanking VESA CVT 0.31M3-R */ - .x_res = 640, - .y_res = 480, - .pixel_clock= 23500, - .hfp= 48, - .hsw= 32, - .hbp= 80, - .vfp= 3, - .vsw= 4, - .vbp= 7, -}; - -static int generic_panel_power_on(struct omap_dss_device *dssdev) -{ - int r; - - if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE) - return 0; - - r = omapdss_dpi_display_enable(dssdev); - if (r) - goto err0; - - if (dssdev-platform_enable) { - r = dssdev-platform_enable(dssdev); - if (r) - goto err1; - } - - return 0; -err1: - omapdss_dpi_display_disable(dssdev); -err0: - return r; -} - -static void generic_panel_power_off(struct omap_dss_device *dssdev) -{ - if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE) - return; - - if (dssdev-platform_disable) - dssdev-platform_disable(dssdev
Re: [PATCH 1/3] OMAP: DSS2: Add generic DPI panel display driver
On Wed, Nov 17, 2010 at 8:44 PM, Tomi Valkeinen tomi.valkei...@nokia.com wrote: On Wed, 2010-11-17 at 10:23 +0800, ext Bryan Wu wrote: Generic DPI panel driver includes the driver and 4 similar panel configurations. It will match the panel name which is passed from platform data and setup the right configurations. With generic DPI panel driver, we can remove those 4 duplicated panel display drivers. In the future, it is simple for us just add new panel configuration date in panel-generic-dpi.c to support new display panel. Signed-off-by: Bryan Wu bryan...@canonical.com --- .../arm/plat-omap/include/plat/panel-generic-dpi.h | 37 ++ drivers/video/omap2/displays/Kconfig | 8 + drivers/video/omap2/displays/Makefile | 1 + drivers/video/omap2/displays/panel-generic-dpi.c | 348 4 files changed, 394 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-omap/include/plat/panel-generic-dpi.h create mode 100644 drivers/video/omap2/displays/panel-generic-dpi.c [snip] + +static void generic_dpi_panel_remove(struct omap_dss_device *dssdev) +{ +} You need to free the drv_data here. Perhaps this will be the last fix =). My bad, I just sent out the 8th version for review. Moreover, I think in panel-taal.c it also misses call dev_set_drvdata(dssdev-dev, NULL); after we kfree(td) in taal_remove(). Thanks, -- Bryan Wu bryan...@canonical.com Kernel Developer +86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] OMAP: DSS2: Add generic DPI panel display driver
On Thu, Nov 18, 2010 at 12:13 AM, Premi, Sanjeev pr...@ti.com wrote: -Original Message- From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-ow...@vger.kernel.org] On Behalf Of Bryan Wu Sent: Wednesday, November 17, 2010 7:05 PM To: tomi.valkei...@nokia.com; linux-omap@vger.kernel.org; linux-arm-ker...@lists.infradead.org; Gadiyar, Anand Subject: [PATCH 1/3] OMAP: DSS2: Add generic DPI panel display driver Generic DPI panel driver includes the driver and 4 similar panel configurations. It will match the panel name which is passed from platform data and setup the right configurations. With generic DPI panel driver, we can remove those 4 duplicated panel display drivers. In the future, it is simple for us just add new panel configuration date in panel-generic-dpi.c to support new display panel. Signed-off-by: Bryan Wu bryan...@canonical.com --- .../arm/plat-omap/include/plat/panel-generic-dpi.h | 37 ++ drivers/video/omap2/displays/Kconfig | 8 + drivers/video/omap2/displays/Makefile | 1 + drivers/video/omap2/displays/panel-generic-dpi.c | 355 4 files changed, 401 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-omap/include/plat/panel-generic-dpi.h create mode 100644 drivers/video/omap2/displays/panel-generic-dpi.c diff --git a/arch/arm/plat-omap/include/plat/panel-generic-dpi.h b/arch/arm/plat-omap/include/plat/panel-generic-dpi.h new file mode 100644 index 000..7906197 --- /dev/null +++ b/arch/arm/plat-omap/include/plat/panel-generic-dpi.h @@ -0,0 +1,37 @@ +/* + * Header for generic DPI panel driver + * + * Copyright (C) 2010 Canonical Ltd. + * Author: Bryan Wu bryan...@canonical.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see http://www.gnu.org/licenses/. + */ + +#ifndef __ARCH_ARM_PLAT_OMAP_PANEL_GENERIC_DPI_H +#define __ARCH_ARM_PLAT_OMAP_PANEL_GENERIC_DPI_H + +#include display.h + +/** + * struct panel_generic_dpi_data - panel driver configuration data + * @name: panel name + * @platform_enable: platform specific panel enable function + * @platform_disable: platform specific panel disable function + */ +struct panel_generic_dpi_data { + const char *name; + int (*platform_enable)(struct omap_dss_device *dssdev); + void (*platform_disable)(struct omap_dss_device *dssdev); +}; + +#endif /* __ARCH_ARM_PLAT_OMAP_PANEL_GENERIC_DPI_H */ diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig index 12327bb..cb3e339 100644 --- a/drivers/video/omap2/displays/Kconfig +++ b/drivers/video/omap2/displays/Kconfig @@ -1,6 +1,14 @@ menu OMAP2/3 Display Device Drivers depends on OMAP2_DSS +config PANEL_GENERIC_DPI + tristate Generic DPI Panel + help + Generic DPI panel driver. + Supports DVI output for Beagle and OMAP3 SDP. + Supports LCD Panel used in TI SDP3430 and EVM boards, + OMAP3517 EVM boards and CM-T35. + config PANEL_GENERIC tristate Generic Panel help diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile index aa38609..022058c 100644 --- a/drivers/video/omap2/displays/Makefile +++ b/drivers/video/omap2/displays/Makefile @@ -1,3 +1,4 @@ +obj-$(CONFIG_PANEL_GENERIC_DPI) += panel-generic-dpi.o obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c new file mode 100644 index 000..6702cf6 --- /dev/null +++ b/drivers/video/omap2/displays/panel-generic-dpi.c @@ -0,0 +1,355 @@ +/* + * Generic DPI Panels support + * + * Copyright (C) 2010 Canonical Ltd. + * Author: Bryan Wu bryan...@canonical.com + * + * Copyright (C) 2008 Nokia Corporation + * Author: Tomi Valkeinen tomi.valkei...@nokia.com + * [sp] Shouldn't all authors (from the files being coalesced) be listed here. No problem, I will provide an incremental patch for Tomi. -Bryan I see this missing from PATCH3/3 in your series: [quote] - * LCD panel driver for Sharp LQ043T1DG01 - * - * Copyright (C) 2009 Texas Instruments Inc - * Author: Vaibhav Hiremath hvaib...@ti.com - * [/quote] [snip]...[snip] -- To unsubscribe
[PATCH] OMAP: DSS2: Add back authors of panel-generic.c based drivers
Signed-off-by: Bryan Wu bryan...@canonical.com --- drivers/video/omap2/displays/panel-generic-dpi.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c index 6702cf6..07eb30e 100644 --- a/drivers/video/omap2/displays/panel-generic-dpi.c +++ b/drivers/video/omap2/displays/panel-generic-dpi.c @@ -4,6 +4,16 @@ * Copyright (C) 2010 Canonical Ltd. * Author: Bryan Wu bryan...@canonical.com * + * LCD panel driver for Sharp LQ043T1DG01 + * + * Copyright (C) 2009 Texas Instruments Inc + * Author: Vaibhav Hiremath hvaib...@ti.com + * + * LCD panel driver for Toppoly TDO35S + * + * Copyright (C) 2009 CompuLab, Ltd. + * Author: Mike Rapoport m...@compulab.co.il + * * Copyright (C) 2008 Nokia Corporation * Author: Tomi Valkeinen tomi.valkei...@nokia.com * -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #8)
On Wed, Nov 17, 2010 at 10:18 PM, Tomi Valkeinen tomi.valkei...@nokia.com wrote: On Wed, 2010-11-17 at 21:34 +0800, ext Bryan Wu wrote: There are 4 duplicated DPI panel drivers in DSS2 display driver. They are similar and a generic DPI panel driver can support all them with specific panel configuration. And new DPI panel driver can be easily supported by adding panel configurations into generic panel DPI driver. This patchset introduces a generic panel DPI driver, remove 3 panel drivers and enable generic panel DPI driver in board files. And it is based on 2.6.37-rc2. Building with omap2plus_defconfig is successful. Keep sharp_ls_panel, since it contains blacklight control code which will be moved out later. Bryan Wu (3): OMAP: DSS2: Add generic DPI panel display driver OMAP: use generic DPI panel driver in board files OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers Thanks, looks good. This is now applied to my tree. Thanks a lot for making this happen, -:)) Are you also interested in solving the backlight issue? =) Yeah, can I start with drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c. I plan to move the blacklight code to drivers/video/blacklight/ and let sharp_ls to use panel-generic-dpi.c driver. -Bryan -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #7)
There are 4 duplicated DPI panel drivers in DSS2 display driver. They are similar and a generic DPI panel driver can support all them with specific panel configuration. And new DPI panel driver can be easily supported by adding panel configurations into generic panel DPI driver. This patchset introduces a generic panel DPI driver, remove 3 panel drivers and enable generic panel DPI driver in board files. And it is based on 2.6.37-rc2. Building with omap2plus_defconfig is successful. Keep sharp_ls_panel, since it contains blacklight control code which will be moved out later. Bryan Wu (3): OMAP: DSS2: Add generic DPI panel display driver OMAP: use generic DPI panel driver in board files OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers arch/arm/mach-omap2/board-3430sdp.c| 12 +- arch/arm/mach-omap2/board-am3517evm.c | 23 +- arch/arm/mach-omap2/board-cm-t35.c | 23 +- arch/arm/mach-omap2/board-devkit8000.c | 26 +- arch/arm/mach-omap2/board-igep0020.c | 12 +- arch/arm/mach-omap2/board-omap3beagle.c| 12 +- arch/arm/mach-omap2/board-omap3evm.c | 12 +- arch/arm/mach-omap2/board-omap3stalker.c | 23 +- .../arm/plat-omap/include/plat/panel-generic-dpi.h | 37 ++ drivers/video/omap2/displays/Kconfig | 22 +- drivers/video/omap2/displays/Makefile |4 +- drivers/video/omap2/displays/panel-generic-dpi.c | 348 drivers/video/omap2/displays/panel-generic.c | 174 -- .../video/omap2/displays/panel-sharp-lq043t1dg01.c | 165 - .../video/omap2/displays/panel-toppoly-tdo35s.c| 164 - 15 files changed, 497 insertions(+), 560 deletions(-) create mode 100644 arch/arm/plat-omap/include/plat/panel-generic-dpi.h create mode 100644 drivers/video/omap2/displays/panel-generic-dpi.c delete mode 100644 drivers/video/omap2/displays/panel-generic.c delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c delete mode 100644 drivers/video/omap2/displays/panel-toppoly-tdo35s.c -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/3] OMAP: DSS2: Add generic DPI panel display driver
Generic DPI panel driver includes the driver and 4 similar panel configurations. It will match the panel name which is passed from platform data and setup the right configurations. With generic DPI panel driver, we can remove those 4 duplicated panel display drivers. In the future, it is simple for us just add new panel configuration date in panel-generic-dpi.c to support new display panel. Signed-off-by: Bryan Wu bryan...@canonical.com --- .../arm/plat-omap/include/plat/panel-generic-dpi.h | 37 ++ drivers/video/omap2/displays/Kconfig |8 + drivers/video/omap2/displays/Makefile |1 + drivers/video/omap2/displays/panel-generic-dpi.c | 348 4 files changed, 394 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-omap/include/plat/panel-generic-dpi.h create mode 100644 drivers/video/omap2/displays/panel-generic-dpi.c diff --git a/arch/arm/plat-omap/include/plat/panel-generic-dpi.h b/arch/arm/plat-omap/include/plat/panel-generic-dpi.h new file mode 100644 index 000..7906197 --- /dev/null +++ b/arch/arm/plat-omap/include/plat/panel-generic-dpi.h @@ -0,0 +1,37 @@ +/* + * Header for generic DPI panel driver + * + * Copyright (C) 2010 Canonical Ltd. + * Author: Bryan Wu bryan...@canonical.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see http://www.gnu.org/licenses/. + */ + +#ifndef __ARCH_ARM_PLAT_OMAP_PANEL_GENERIC_DPI_H +#define __ARCH_ARM_PLAT_OMAP_PANEL_GENERIC_DPI_H + +#include display.h + +/** + * struct panel_generic_dpi_data - panel driver configuration data + * @name: panel name + * @platform_enable: platform specific panel enable function + * @platform_disable: platform specific panel disable function + */ +struct panel_generic_dpi_data { + const char *name; + int (*platform_enable)(struct omap_dss_device *dssdev); + void (*platform_disable)(struct omap_dss_device *dssdev); +}; + +#endif /* __ARCH_ARM_PLAT_OMAP_PANEL_GENERIC_DPI_H */ diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig index 12327bb..cb3e339 100644 --- a/drivers/video/omap2/displays/Kconfig +++ b/drivers/video/omap2/displays/Kconfig @@ -1,6 +1,14 @@ menu OMAP2/3 Display Device Drivers depends on OMAP2_DSS +config PANEL_GENERIC_DPI +tristate Generic DPI Panel +help + Generic DPI panel driver. + Supports DVI output for Beagle and OMAP3 SDP. + Supports LCD Panel used in TI SDP3430 and EVM boards, + OMAP3517 EVM boards and CM-T35. + config PANEL_GENERIC tristate Generic Panel help diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile index aa38609..022058c 100644 --- a/drivers/video/omap2/displays/Makefile +++ b/drivers/video/omap2/displays/Makefile @@ -1,3 +1,4 @@ +obj-$(CONFIG_PANEL_GENERIC_DPI) += panel-generic-dpi.o obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c new file mode 100644 index 000..1f208e3 --- /dev/null +++ b/drivers/video/omap2/displays/panel-generic-dpi.c @@ -0,0 +1,348 @@ +/* + * Generic DPI Panels support + * + * Copyright (C) 2010 Canonical Ltd. + * Author: Bryan Wu bryan...@canonical.com + * + * Copyright (C) 2008 Nokia Corporation + * Author: Tomi Valkeinen tomi.valkei...@nokia.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see http://www.gnu.org/licenses/. + */ + +#include linux/module.h +#include linux/delay.h +#include linux/slab.h + +#include plat/panel-generic-dpi.h + +struct panel_config { + struct omap_video_timings timings; + + int acbi; /* ac-bias pin transitions per interrupt */ + /* Unit: line clocks */ + int acb;/* ac-bias pin frequency
[PATCH 2/3] OMAP: use generic DPI panel driver in board files
Still keep sharp_ls_panel, since the sharp_ls_panel driver contains blacklight control driver code which will be moved out later. Then we can use generic DPI driver for sharp_ls_panel. Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-omap2/board-3430sdp.c | 12 +--- arch/arm/mach-omap2/board-am3517evm.c| 23 +-- arch/arm/mach-omap2/board-cm-t35.c | 23 +-- arch/arm/mach-omap2/board-devkit8000.c | 26 ++ arch/arm/mach-omap2/board-igep0020.c | 12 +--- arch/arm/mach-omap2/board-omap3beagle.c | 12 +--- arch/arm/mach-omap2/board-omap3evm.c | 12 +--- arch/arm/mach-omap2/board-omap3stalker.c | 23 +-- 8 files changed, 105 insertions(+), 38 deletions(-) diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 4e3742c..1ca0156 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -38,6 +38,7 @@ #include plat/dma.h #include plat/gpmc.h #include plat/display.h +#include plat/panel-generic-dpi.h #include plat/gpmc-smc91x.h @@ -270,13 +271,18 @@ static struct omap_dss_device sdp3430_lcd_device = { .platform_disable = sdp3430_panel_disable_lcd, }; +static struct panel_generic_dpi_data dvi_panel = { + .name = generic, + .platform_enable= sdp3430_panel_enable_dvi, + .platform_disable = sdp3430_panel_disable_dvi, +}; + static struct omap_dss_device sdp3430_dvi_device = { .name = dvi, - .driver_name= generic_panel, .type = OMAP_DISPLAY_TYPE_DPI, + .driver_name= generic_dpi_panel, + .data = dvi_panel, .phy.dpi.data_lines = 24, - .platform_enable= sdp3430_panel_enable_dvi, - .platform_disable = sdp3430_panel_disable_dvi, }; static struct omap_dss_device sdp3430_tv_device = { diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index 0739950..851683f 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c @@ -35,6 +35,7 @@ #include plat/common.h #include plat/usb.h #include plat/display.h +#include plat/panel-generic-dpi.h #include mux.h #include control.h @@ -303,13 +304,18 @@ static void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev) lcd_enabled = 0; } +static struct panel_generic_dpi_data lcd_panel = { + .name = sharp_lq, + .platform_enable= am3517_evm_panel_enable_lcd, + .platform_disable = am3517_evm_panel_disable_lcd, +}; + static struct omap_dss_device am3517_evm_lcd_device = { .type = OMAP_DISPLAY_TYPE_DPI, .name = lcd, - .driver_name= sharp_lq_panel, + .driver_name= generic_dpi_panel, + .data = lcd_panel, .phy.dpi.data_lines = 16, - .platform_enable= am3517_evm_panel_enable_lcd, - .platform_disable = am3517_evm_panel_disable_lcd, }; static int am3517_evm_panel_enable_tv(struct omap_dss_device *dssdev) @@ -346,13 +352,18 @@ static void am3517_evm_panel_disable_dvi(struct omap_dss_device *dssdev) dvi_enabled = 0; } +static struct panel_generic_dpi_data dvi_panel = { + .name = generic, + .platform_enable= am3517_evm_panel_enable_dvi, + .platform_disable = am3517_evm_panel_disable_dvi, +}; + static struct omap_dss_device am3517_evm_dvi_device = { .type = OMAP_DISPLAY_TYPE_DPI, .name = dvi, - .driver_name= generic_panel, + .driver_name= generic_dpi_panel, + .data = dvi_panel, .phy.dpi.data_lines = 24, - .platform_enable= am3517_evm_panel_enable_dvi, - .platform_disable = am3517_evm_panel_disable_dvi, }; static struct omap_dss_device *am3517_evm_dss_devices[] = { diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 63f764e..e91c986 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c @@ -46,6 +46,7 @@ #include plat/gpmc.h #include plat/usb.h #include plat/display.h +#include plat/panel-generic-dpi.h #include plat/mcspi.h #include mach/hardware.h @@ -351,22 +352,32 @@ static void cm_t35_panel_disable_tv(struct omap_dss_device *dssdev) { } +static struct panel_generic_dpi_data lcd_panel = { + .name = toppoly_tdo35s, + .platform_enable= cm_t35_panel_enable_lcd, + .platform_disable = cm_t35_panel_disable_lcd, +}; + static struct omap_dss_device cm_t35_lcd_device = { .name
[PATCH 3/3] OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers
Still keep sharp_ls_panel driver, because it contains blacklight control driver. Signed-off-by: Bryan Wu bryan...@canonical.com --- drivers/video/omap2/displays/Kconfig | 18 -- drivers/video/omap2/displays/Makefile |3 - drivers/video/omap2/displays/panel-generic.c | 174 .../video/omap2/displays/panel-sharp-lq043t1dg01.c | 165 --- .../video/omap2/displays/panel-toppoly-tdo35s.c| 164 -- 5 files changed, 0 insertions(+), 524 deletions(-) delete mode 100644 drivers/video/omap2/displays/panel-generic.c delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c delete mode 100644 drivers/video/omap2/displays/panel-toppoly-tdo35s.c diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig index cb3e339..9c09afd 100644 --- a/drivers/video/omap2/displays/Kconfig +++ b/drivers/video/omap2/displays/Kconfig @@ -9,12 +9,6 @@ config PANEL_GENERIC_DPI Supports LCD Panel used in TI SDP3430 and EVM boards, OMAP3517 EVM boards and CM-T35. -config PANEL_GENERIC -tristate Generic Panel -help - Generic panel driver. - Used for DVI output for Beagle and OMAP3 SDP. - config PANEL_SHARP_LS037V7DW01 tristate Sharp LS037V7DW01 LCD Panel depends on OMAP2_DSS @@ -22,24 +16,12 @@ config PANEL_SHARP_LS037V7DW01 help LCD Panel used in TI's SDP3430 and EVM boards -config PANEL_SHARP_LQ043T1DG01 -tristate Sharp LQ043T1DG01 LCD Panel -depends on OMAP2_DSS -help - LCD Panel used in TI's OMAP3517 EVM boards - config PANEL_TAAL tristate Taal DSI Panel depends on OMAP2_DSS_DSI help Taal DSI command mode panel from TPO. -config PANEL_TOPPOLY_TDO35S -tristate Toppoly TDO35S LCD Panel support -depends on OMAP2_DSS -help - LCD Panel used in CM-T35 - config PANEL_TPO_TD043MTEA1 tristate TPO TD043MTEA1 LCD Panel depends on OMAP2_DSS SPI diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile index 022058c..3bebe4d 100644 --- a/drivers/video/omap2/displays/Makefile +++ b/drivers/video/omap2/displays/Makefile @@ -1,9 +1,6 @@ obj-$(CONFIG_PANEL_GENERIC_DPI) += panel-generic-dpi.o -obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o -obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o obj-$(CONFIG_PANEL_TAAL) += panel-taal.o -obj-$(CONFIG_PANEL_TOPPOLY_TDO35S) += panel-toppoly-tdo35s.o obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o diff --git a/drivers/video/omap2/displays/panel-generic.c b/drivers/video/omap2/displays/panel-generic.c deleted file mode 100644 index 395a68d..000 --- a/drivers/video/omap2/displays/panel-generic.c +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Generic panel support - * - * Copyright (C) 2008 Nokia Corporation - * Author: Tomi Valkeinen tomi.valkei...@nokia.com - * - * 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. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see http://www.gnu.org/licenses/. - */ - -#include linux/module.h -#include linux/delay.h - -#include plat/display.h - -static struct omap_video_timings generic_panel_timings = { - /* 640 x 480 @ 60 Hz Reduced blanking VESA CVT 0.31M3-R */ - .x_res = 640, - .y_res = 480, - .pixel_clock= 23500, - .hfp= 48, - .hsw= 32, - .hbp= 80, - .vfp= 3, - .vsw= 4, - .vbp= 7, -}; - -static int generic_panel_power_on(struct omap_dss_device *dssdev) -{ - int r; - - if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE) - return 0; - - r = omapdss_dpi_display_enable(dssdev); - if (r) - goto err0; - - if (dssdev-platform_enable) { - r = dssdev-platform_enable(dssdev); - if (r) - goto err1; - } - - return 0; -err1: - omapdss_dpi_display_disable(dssdev); -err0: - return r; -} - -static void generic_panel_power_off(struct omap_dss_device *dssdev) -{ - if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE) - return; - - if (dssdev-platform_disable) - dssdev-platform_disable(dssdev
Re: [PATCH 1/3] OMAP: DSS2: Add generic DPI panel display driver
On Tue, Nov 16, 2010 at 11:21 PM, Tomi Valkeinen tomi.valkei...@nokia.com wrote: Hi, On Tue, 2010-11-16 at 05:17 +0100, ext Bryan Wu wrote: Generic DPI panel driver includes the driver and 4 similar panel configurations. It will match the panel name which is passed from platform data and setup the right configurations. With generic DPI panel driver, we can remove those 4 duplicated panel display drivers. In the future, it is simple for us just add new panel configuration date in panel-generic-dpi.c to support new display panel. Signed-off-by: Bryan Wu bryan...@canonical.com --- .../arm/plat-omap/include/plat/panel-generic-dpi.h | 37 +++ [snip] + +static power_on_delay = 0; + +static power_off_delay = 0; This is not right. There may be multiple panels in a single board, and these would be shared by both of the panels. What you need to do is have a struct, which contains pointer to the panel configuration used with that particular dssdev, and set the struct with dev_set_drvdata(). Check panel-taal.c for an example. There's struct taal_data, which contains also quite a bit other data, but also a pointer to the panel config. Exactly, I just fixed it and sent the updated patchset. Thanks, -- Bryan Wu bryan...@canonical.com Kernel Developer +86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #6)
There are 4 duplicated DPI panel drivers in DSS2 display driver. They are similar and a generic DPI panel driver can support all them with specific panel configuration. And new DPI panel driver can be easily supported by adding panel configurations into generic panel DPI driver. This patchset introduces a generic panel DPI driver, remove 3 panel drivers and enable generic panel DPI driver in board files. And it is based on 2.6.37-rc1. Building with omap2plus_defconfig is successful. Keep sharp_ls_panel, since it contains blacklight control code which will be moved out later. Bryan Wu (3): OMAP: DSS2: Add generic DPI panel display driver OMAP: use generic DPI panel driver in board files OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers arch/arm/mach-omap2/board-3430sdp.c| 12 +- arch/arm/mach-omap2/board-am3517evm.c | 23 +- arch/arm/mach-omap2/board-cm-t35.c | 23 +- arch/arm/mach-omap2/board-devkit8000.c | 26 +- arch/arm/mach-omap2/board-igep0020.c | 12 +- arch/arm/mach-omap2/board-omap3beagle.c| 12 +- arch/arm/mach-omap2/board-omap3evm.c | 12 +- arch/arm/mach-omap2/board-omap3stalker.c | 23 +- .../arm/plat-omap/include/plat/panel-generic-dpi.h | 37 +++ drivers/video/omap2/displays/Kconfig | 22 +- drivers/video/omap2/displays/Makefile |4 +- drivers/video/omap2/displays/panel-generic-dpi.c | 333 drivers/video/omap2/displays/panel-generic.c | 174 -- .../video/omap2/displays/panel-sharp-lq043t1dg01.c | 165 -- .../video/omap2/displays/panel-toppoly-tdo35s.c| 164 -- 15 files changed, 482 insertions(+), 560 deletions(-) create mode 100644 arch/arm/plat-omap/include/plat/panel-generic-dpi.h create mode 100644 drivers/video/omap2/displays/panel-generic-dpi.c delete mode 100644 drivers/video/omap2/displays/panel-generic.c delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c delete mode 100644 drivers/video/omap2/displays/panel-toppoly-tdo35s.c -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/3] OMAP: DSS2: Add generic DPI panel display driver
Generic DPI panel driver includes the driver and 4 similar panel configurations. It will match the panel name which is passed from platform data and setup the right configurations. With generic DPI panel driver, we can remove those 4 duplicated panel display drivers. In the future, it is simple for us just add new panel configuration date in panel-generic-dpi.c to support new display panel. Signed-off-by: Bryan Wu bryan...@canonical.com --- .../arm/plat-omap/include/plat/panel-generic-dpi.h | 37 +++ drivers/video/omap2/displays/Kconfig |8 + drivers/video/omap2/displays/Makefile |1 + drivers/video/omap2/displays/panel-generic-dpi.c | 333 4 files changed, 379 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-omap/include/plat/panel-generic-dpi.h create mode 100644 drivers/video/omap2/displays/panel-generic-dpi.c diff --git a/arch/arm/plat-omap/include/plat/panel-generic-dpi.h b/arch/arm/plat-omap/include/plat/panel-generic-dpi.h new file mode 100644 index 000..7906197 --- /dev/null +++ b/arch/arm/plat-omap/include/plat/panel-generic-dpi.h @@ -0,0 +1,37 @@ +/* + * Header for generic DPI panel driver + * + * Copyright (C) 2010 Canonical Ltd. + * Author: Bryan Wu bryan...@canonical.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see http://www.gnu.org/licenses/. + */ + +#ifndef __ARCH_ARM_PLAT_OMAP_PANEL_GENERIC_DPI_H +#define __ARCH_ARM_PLAT_OMAP_PANEL_GENERIC_DPI_H + +#include display.h + +/** + * struct panel_generic_dpi_data - panel driver configuration data + * @name: panel name + * @platform_enable: platform specific panel enable function + * @platform_disable: platform specific panel disable function + */ +struct panel_generic_dpi_data { + const char *name; + int (*platform_enable)(struct omap_dss_device *dssdev); + void (*platform_disable)(struct omap_dss_device *dssdev); +}; + +#endif /* __ARCH_ARM_PLAT_OMAP_PANEL_GENERIC_DPI_H */ diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig index 12327bb..cb3e339 100644 --- a/drivers/video/omap2/displays/Kconfig +++ b/drivers/video/omap2/displays/Kconfig @@ -1,6 +1,14 @@ menu OMAP2/3 Display Device Drivers depends on OMAP2_DSS +config PANEL_GENERIC_DPI +tristate Generic DPI Panel +help + Generic DPI panel driver. + Supports DVI output for Beagle and OMAP3 SDP. + Supports LCD Panel used in TI SDP3430 and EVM boards, + OMAP3517 EVM boards and CM-T35. + config PANEL_GENERIC tristate Generic Panel help diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile index aa38609..022058c 100644 --- a/drivers/video/omap2/displays/Makefile +++ b/drivers/video/omap2/displays/Makefile @@ -1,3 +1,4 @@ +obj-$(CONFIG_PANEL_GENERIC_DPI) += panel-generic-dpi.o obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c new file mode 100644 index 000..c3fff9e --- /dev/null +++ b/drivers/video/omap2/displays/panel-generic-dpi.c @@ -0,0 +1,333 @@ +/* + * Generic DPI Panels support + * + * Copyright (C) 2010 Canonical Ltd. + * Author: Bryan Wu bryan...@canonical.com + * + * Copyright (C) 2008 Nokia Corporation + * Author: Tomi Valkeinen tomi.valkei...@nokia.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see http://www.gnu.org/licenses/. + */ + +#include linux/module.h +#include linux/delay.h + +#include plat/panel-generic-dpi.h + +struct panel_config { + struct omap_video_timings timings; + + int acbi; /* ac-bias pin transitions per interrupt */ + /* Unit: line clocks */ + int acb;/* ac-bias pin frequency */ + + enum omap_panel_config
[PATCH 2/3] OMAP: use generic DPI panel driver in board files
Still keep sharp_ls_panel, since the sharp_ls_panel driver contains blacklight control driver code which will be moved out later. Then we can use generic DPI driver for sharp_ls_panel. Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-omap2/board-3430sdp.c | 12 +--- arch/arm/mach-omap2/board-am3517evm.c| 23 +-- arch/arm/mach-omap2/board-cm-t35.c | 23 +-- arch/arm/mach-omap2/board-devkit8000.c | 26 ++ arch/arm/mach-omap2/board-igep0020.c | 12 +--- arch/arm/mach-omap2/board-omap3beagle.c | 12 +--- arch/arm/mach-omap2/board-omap3evm.c | 12 +--- arch/arm/mach-omap2/board-omap3stalker.c | 23 +-- 8 files changed, 105 insertions(+), 38 deletions(-) diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 4e3742c..1ca0156 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -38,6 +38,7 @@ #include plat/dma.h #include plat/gpmc.h #include plat/display.h +#include plat/panel-generic-dpi.h #include plat/gpmc-smc91x.h @@ -270,13 +271,18 @@ static struct omap_dss_device sdp3430_lcd_device = { .platform_disable = sdp3430_panel_disable_lcd, }; +static struct panel_generic_dpi_data dvi_panel = { + .name = generic, + .platform_enable= sdp3430_panel_enable_dvi, + .platform_disable = sdp3430_panel_disable_dvi, +}; + static struct omap_dss_device sdp3430_dvi_device = { .name = dvi, - .driver_name= generic_panel, .type = OMAP_DISPLAY_TYPE_DPI, + .driver_name= generic_dpi_panel, + .data = dvi_panel, .phy.dpi.data_lines = 24, - .platform_enable= sdp3430_panel_enable_dvi, - .platform_disable = sdp3430_panel_disable_dvi, }; static struct omap_dss_device sdp3430_tv_device = { diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index 0739950..851683f 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c @@ -35,6 +35,7 @@ #include plat/common.h #include plat/usb.h #include plat/display.h +#include plat/panel-generic-dpi.h #include mux.h #include control.h @@ -303,13 +304,18 @@ static void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev) lcd_enabled = 0; } +static struct panel_generic_dpi_data lcd_panel = { + .name = sharp_lq, + .platform_enable= am3517_evm_panel_enable_lcd, + .platform_disable = am3517_evm_panel_disable_lcd, +}; + static struct omap_dss_device am3517_evm_lcd_device = { .type = OMAP_DISPLAY_TYPE_DPI, .name = lcd, - .driver_name= sharp_lq_panel, + .driver_name= generic_dpi_panel, + .data = lcd_panel, .phy.dpi.data_lines = 16, - .platform_enable= am3517_evm_panel_enable_lcd, - .platform_disable = am3517_evm_panel_disable_lcd, }; static int am3517_evm_panel_enable_tv(struct omap_dss_device *dssdev) @@ -346,13 +352,18 @@ static void am3517_evm_panel_disable_dvi(struct omap_dss_device *dssdev) dvi_enabled = 0; } +static struct panel_generic_dpi_data dvi_panel = { + .name = generic, + .platform_enable= am3517_evm_panel_enable_dvi, + .platform_disable = am3517_evm_panel_disable_dvi, +}; + static struct omap_dss_device am3517_evm_dvi_device = { .type = OMAP_DISPLAY_TYPE_DPI, .name = dvi, - .driver_name= generic_panel, + .driver_name= generic_dpi_panel, + .data = dvi_panel, .phy.dpi.data_lines = 24, - .platform_enable= am3517_evm_panel_enable_dvi, - .platform_disable = am3517_evm_panel_disable_dvi, }; static struct omap_dss_device *am3517_evm_dss_devices[] = { diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 63f764e..e91c986 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c @@ -46,6 +46,7 @@ #include plat/gpmc.h #include plat/usb.h #include plat/display.h +#include plat/panel-generic-dpi.h #include plat/mcspi.h #include mach/hardware.h @@ -351,22 +352,32 @@ static void cm_t35_panel_disable_tv(struct omap_dss_device *dssdev) { } +static struct panel_generic_dpi_data lcd_panel = { + .name = toppoly_tdo35s, + .platform_enable= cm_t35_panel_enable_lcd, + .platform_disable = cm_t35_panel_disable_lcd, +}; + static struct omap_dss_device cm_t35_lcd_device = { .name
[PATCH 3/3] OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers
Still keep sharp_ls_panel driver, because it contains blacklight control driver. Signed-off-by: Bryan Wu bryan...@canonical.com --- drivers/video/omap2/displays/Kconfig | 18 -- drivers/video/omap2/displays/Makefile |3 - drivers/video/omap2/displays/panel-generic.c | 174 .../video/omap2/displays/panel-sharp-lq043t1dg01.c | 165 --- .../video/omap2/displays/panel-toppoly-tdo35s.c| 164 -- 5 files changed, 0 insertions(+), 524 deletions(-) delete mode 100644 drivers/video/omap2/displays/panel-generic.c delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c delete mode 100644 drivers/video/omap2/displays/panel-toppoly-tdo35s.c diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig index cb3e339..9c09afd 100644 --- a/drivers/video/omap2/displays/Kconfig +++ b/drivers/video/omap2/displays/Kconfig @@ -9,12 +9,6 @@ config PANEL_GENERIC_DPI Supports LCD Panel used in TI SDP3430 and EVM boards, OMAP3517 EVM boards and CM-T35. -config PANEL_GENERIC -tristate Generic Panel -help - Generic panel driver. - Used for DVI output for Beagle and OMAP3 SDP. - config PANEL_SHARP_LS037V7DW01 tristate Sharp LS037V7DW01 LCD Panel depends on OMAP2_DSS @@ -22,24 +16,12 @@ config PANEL_SHARP_LS037V7DW01 help LCD Panel used in TI's SDP3430 and EVM boards -config PANEL_SHARP_LQ043T1DG01 -tristate Sharp LQ043T1DG01 LCD Panel -depends on OMAP2_DSS -help - LCD Panel used in TI's OMAP3517 EVM boards - config PANEL_TAAL tristate Taal DSI Panel depends on OMAP2_DSS_DSI help Taal DSI command mode panel from TPO. -config PANEL_TOPPOLY_TDO35S -tristate Toppoly TDO35S LCD Panel support -depends on OMAP2_DSS -help - LCD Panel used in CM-T35 - config PANEL_TPO_TD043MTEA1 tristate TPO TD043MTEA1 LCD Panel depends on OMAP2_DSS SPI diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile index 022058c..3bebe4d 100644 --- a/drivers/video/omap2/displays/Makefile +++ b/drivers/video/omap2/displays/Makefile @@ -1,9 +1,6 @@ obj-$(CONFIG_PANEL_GENERIC_DPI) += panel-generic-dpi.o -obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o -obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o obj-$(CONFIG_PANEL_TAAL) += panel-taal.o -obj-$(CONFIG_PANEL_TOPPOLY_TDO35S) += panel-toppoly-tdo35s.o obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o diff --git a/drivers/video/omap2/displays/panel-generic.c b/drivers/video/omap2/displays/panel-generic.c deleted file mode 100644 index 395a68d..000 --- a/drivers/video/omap2/displays/panel-generic.c +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Generic panel support - * - * Copyright (C) 2008 Nokia Corporation - * Author: Tomi Valkeinen tomi.valkei...@nokia.com - * - * 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. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see http://www.gnu.org/licenses/. - */ - -#include linux/module.h -#include linux/delay.h - -#include plat/display.h - -static struct omap_video_timings generic_panel_timings = { - /* 640 x 480 @ 60 Hz Reduced blanking VESA CVT 0.31M3-R */ - .x_res = 640, - .y_res = 480, - .pixel_clock= 23500, - .hfp= 48, - .hsw= 32, - .hbp= 80, - .vfp= 3, - .vsw= 4, - .vbp= 7, -}; - -static int generic_panel_power_on(struct omap_dss_device *dssdev) -{ - int r; - - if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE) - return 0; - - r = omapdss_dpi_display_enable(dssdev); - if (r) - goto err0; - - if (dssdev-platform_enable) { - r = dssdev-platform_enable(dssdev); - if (r) - goto err1; - } - - return 0; -err1: - omapdss_dpi_display_disable(dssdev); -err0: - return r; -} - -static void generic_panel_power_off(struct omap_dss_device *dssdev) -{ - if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE) - return; - - if (dssdev-platform_disable) - dssdev-platform_disable(dssdev
Re: [PATCH 1/3] OMAP: DSS2: Add generic DPI panel display driver
On Mon, Nov 15, 2010 at 12:05 PM, Taneja, Archit arc...@ti.com wrote: Hi, bryan...@canonical.com wrote: On Wed, Nov 10, 2010 at 10:35 PM, Tomi Valkeinen [snip] For both panel power on and off some panels require some sleep times: when powering on, the video interface has to be enabled for some time before the panel can be enabled, and similarly when powering off the video interface needs to be on for some time after the panel has been disabled. Actually, in my previous version patches, I introduced .power_on_delay and .power_off_delay in panel_configs, which contains the sleep value for msleep(). But Archit told me this is not necessary, so I removed that. I had asked you to remove it from omap_dss_device to a more specific struct for the generic dpi driver :) Yeah, no problem. It should be in the 'panel_generic_dpi_data' struct now. I think the delay value is related to panel, which can be found in sharp_ls and sharp_lq drivers. So it might be in the panel_configs struct? Thanks, -Bryan -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] OMAP: DSS2: Add generic DPI panel display driver
On Wed, Nov 10, 2010 at 10:35 PM, Tomi Valkeinen tomi.valkei...@nokia.com wrote: Hi, On Tue, 2010-11-09 at 18:12 +0100, ext Bryan Wu wrote: Generic DPI panel driver includes the driver and 4 similar panel configurations. It will match the panel name which is passed from platform data and setup the right configurations. With generic DPI panel driver, we can remove those 4 duplicated panel display drivers. In the future, it is simple for us just add new panel configuration date in panel-generic-dpi.c to support new display panel. This is looking good, but still a couple of comments inline: Signed-off-by: Bryan Wu bryan...@canonical.com --- .../arm/plat-omap/include/plat/panel-generic-dpi.h | 37 +++ drivers/video/omap2/displays/Kconfig | 8 + drivers/video/omap2/displays/Makefile | 1 + drivers/video/omap2/displays/panel-generic-dpi.c | 309 4 files changed, 355 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-omap/include/plat/panel-generic-dpi.h create mode 100644 drivers/video/omap2/displays/panel-generic-dpi.c diff --git a/arch/arm/plat-omap/include/plat/panel-generic-dpi.h b/arch/arm/plat-omap/include/plat/panel-generic-dpi.h new file mode 100644 index 000..7906197 --- /dev/null +++ b/arch/arm/plat-omap/include/plat/panel-generic-dpi.h @@ -0,0 +1,37 @@ +/* + * Header for generic DPI panel driver + * + * Copyright (C) 2010 Canonical Ltd. + * Author: Bryan Wu bryan...@canonical.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see http://www.gnu.org/licenses/. + */ + +#ifndef __ARCH_ARM_PLAT_OMAP_PANEL_GENERIC_DPI_H +#define __ARCH_ARM_PLAT_OMAP_PANEL_GENERIC_DPI_H + +#include display.h + +/** + * struct panel_generic_dpi_data - panel driver configuration data + * @name: panel name + * @platform_enable: platform specific panel enable function + * @platform_disable: platform specific panel disable function + */ +struct panel_generic_dpi_data { + const char *name; + int (*platform_enable)(struct omap_dss_device *dssdev); + void (*platform_disable)(struct omap_dss_device *dssdev); +}; + +#endif /* __ARCH_ARM_PLAT_OMAP_PANEL_GENERIC_DPI_H */ diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig index 12327bb..cb3e339 100644 --- a/drivers/video/omap2/displays/Kconfig +++ b/drivers/video/omap2/displays/Kconfig @@ -1,6 +1,14 @@ menu OMAP2/3 Display Device Drivers depends on OMAP2_DSS +config PANEL_GENERIC_DPI + tristate Generic DPI Panel + help + Generic DPI panel driver. + Supports DVI output for Beagle and OMAP3 SDP. + Supports LCD Panel used in TI SDP3430 and EVM boards, + OMAP3517 EVM boards and CM-T35. + config PANEL_GENERIC tristate Generic Panel help diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile index aa38609..022058c 100644 --- a/drivers/video/omap2/displays/Makefile +++ b/drivers/video/omap2/displays/Makefile @@ -1,3 +1,4 @@ +obj-$(CONFIG_PANEL_GENERIC_DPI) += panel-generic-dpi.o obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c new file mode 100644 index 000..7ddd631 --- /dev/null +++ b/drivers/video/omap2/displays/panel-generic-dpi.c @@ -0,0 +1,309 @@ +/* + * Generic DPI Panels support + * + * Copyright (C) 2010 Canonical Ltd. + * Author: Bryan Wu bryan...@canonical.com + * + * Copyright (C) 2008 Nokia Corporation + * Author: Tomi Valkeinen tomi.valkei...@nokia.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see http://www.gnu.org/licenses/. + */ + +#include linux
[PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #5)
There are 4 duplicated DPI panel drivers in DSS2 display driver. They are similar and a generic DPI panel driver can support all them with specific panel configuration. And new DPI panel driver can be easily supported by adding panel configurations into generic panel DPI driver. This patchset introduces a generic panel DPI driver, remove 3 panel drivers and enable generic panel DPI driver in board files. And it is based on 2.6.37-rc1. Building with omap2plus_defconfig is successful. Keep sharp_ls_panel, since it contains blacklight control code which will be moved out later. Bryan Wu (3): OMAP: DSS2: Add generic DPI panel display driver OMAP: use generic DPI panel driver in board files OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers arch/arm/mach-omap2/board-3430sdp.c| 13 +- arch/arm/mach-omap2/board-am3517evm.c | 25 +- arch/arm/mach-omap2/board-cm-t35.c | 25 +- arch/arm/mach-omap2/board-devkit8000.c | 28 ++- arch/arm/mach-omap2/board-igep0020.c | 13 +- arch/arm/mach-omap2/board-omap3beagle.c| 13 +- arch/arm/mach-omap2/board-omap3evm.c | 13 +- arch/arm/mach-omap2/board-omap3stalker.c | 25 +- .../arm/plat-omap/include/plat/panel-generic-dpi.h | 37 +++ drivers/video/omap2/displays/Kconfig | 22 +- drivers/video/omap2/displays/Makefile |4 +- drivers/video/omap2/displays/panel-generic-dpi.c | 309 drivers/video/omap2/displays/panel-generic.c | 174 --- .../video/omap2/displays/panel-sharp-lq043t1dg01.c | 165 --- .../video/omap2/displays/panel-toppoly-tdo35s.c| 164 --- 15 files changed, 458 insertions(+), 572 deletions(-) create mode 100644 arch/arm/plat-omap/include/plat/panel-generic-dpi.h create mode 100644 drivers/video/omap2/displays/panel-generic-dpi.c delete mode 100644 drivers/video/omap2/displays/panel-generic.c delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c delete mode 100644 drivers/video/omap2/displays/panel-toppoly-tdo35s.c -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/3] OMAP: DSS2: Add generic DPI panel display driver
Generic DPI panel driver includes the driver and 4 similar panel configurations. It will match the panel name which is passed from platform data and setup the right configurations. With generic DPI panel driver, we can remove those 4 duplicated panel display drivers. In the future, it is simple for us just add new panel configuration date in panel-generic-dpi.c to support new display panel. Signed-off-by: Bryan Wu bryan...@canonical.com --- .../arm/plat-omap/include/plat/panel-generic-dpi.h | 37 +++ drivers/video/omap2/displays/Kconfig |8 + drivers/video/omap2/displays/Makefile |1 + drivers/video/omap2/displays/panel-generic-dpi.c | 309 4 files changed, 355 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-omap/include/plat/panel-generic-dpi.h create mode 100644 drivers/video/omap2/displays/panel-generic-dpi.c diff --git a/arch/arm/plat-omap/include/plat/panel-generic-dpi.h b/arch/arm/plat-omap/include/plat/panel-generic-dpi.h new file mode 100644 index 000..7906197 --- /dev/null +++ b/arch/arm/plat-omap/include/plat/panel-generic-dpi.h @@ -0,0 +1,37 @@ +/* + * Header for generic DPI panel driver + * + * Copyright (C) 2010 Canonical Ltd. + * Author: Bryan Wu bryan...@canonical.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see http://www.gnu.org/licenses/. + */ + +#ifndef __ARCH_ARM_PLAT_OMAP_PANEL_GENERIC_DPI_H +#define __ARCH_ARM_PLAT_OMAP_PANEL_GENERIC_DPI_H + +#include display.h + +/** + * struct panel_generic_dpi_data - panel driver configuration data + * @name: panel name + * @platform_enable: platform specific panel enable function + * @platform_disable: platform specific panel disable function + */ +struct panel_generic_dpi_data { + const char *name; + int (*platform_enable)(struct omap_dss_device *dssdev); + void (*platform_disable)(struct omap_dss_device *dssdev); +}; + +#endif /* __ARCH_ARM_PLAT_OMAP_PANEL_GENERIC_DPI_H */ diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig index 12327bb..cb3e339 100644 --- a/drivers/video/omap2/displays/Kconfig +++ b/drivers/video/omap2/displays/Kconfig @@ -1,6 +1,14 @@ menu OMAP2/3 Display Device Drivers depends on OMAP2_DSS +config PANEL_GENERIC_DPI +tristate Generic DPI Panel +help + Generic DPI panel driver. + Supports DVI output for Beagle and OMAP3 SDP. + Supports LCD Panel used in TI SDP3430 and EVM boards, + OMAP3517 EVM boards and CM-T35. + config PANEL_GENERIC tristate Generic Panel help diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile index aa38609..022058c 100644 --- a/drivers/video/omap2/displays/Makefile +++ b/drivers/video/omap2/displays/Makefile @@ -1,3 +1,4 @@ +obj-$(CONFIG_PANEL_GENERIC_DPI) += panel-generic-dpi.o obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c new file mode 100644 index 000..7ddd631 --- /dev/null +++ b/drivers/video/omap2/displays/panel-generic-dpi.c @@ -0,0 +1,309 @@ +/* + * Generic DPI Panels support + * + * Copyright (C) 2010 Canonical Ltd. + * Author: Bryan Wu bryan...@canonical.com + * + * Copyright (C) 2008 Nokia Corporation + * Author: Tomi Valkeinen tomi.valkei...@nokia.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see http://www.gnu.org/licenses/. + */ + +#include linux/module.h +#include linux/delay.h + +#include plat/panel-generic-dpi.h + +struct panel_config { + struct omap_video_timings timings; + + int acbi; /* ac-bias pin transitions per interrupt */ + /* Unit: line clocks */ + int acb;/* ac-bias pin frequency */ + + enum omap_panel_config
[PATCH 2/3] OMAP: use generic DPI panel driver in board files
Still keep sharp_ls_panel, since the sharp_ls_panel driver contains blacklight control driver code which will be moved out later. Then we can use generic DPI driver for sharp_ls_panel. Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-omap2/board-3430sdp.c | 13 + arch/arm/mach-omap2/board-am3517evm.c| 25 + arch/arm/mach-omap2/board-cm-t35.c | 25 + arch/arm/mach-omap2/board-devkit8000.c | 28 ++-- arch/arm/mach-omap2/board-igep0020.c | 13 + arch/arm/mach-omap2/board-omap3beagle.c | 13 + arch/arm/mach-omap2/board-omap3evm.c | 13 + arch/arm/mach-omap2/board-omap3stalker.c | 25 + 8 files changed, 105 insertions(+), 50 deletions(-) diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 4e3742c..4bafdd7 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -38,6 +38,7 @@ #include plat/dma.h #include plat/gpmc.h #include plat/display.h +#include plat/panel-generic-dpi.h #include plat/gpmc-smc91x.h @@ -270,13 +271,17 @@ static struct omap_dss_device sdp3430_lcd_device = { .platform_disable = sdp3430_panel_disable_lcd, }; +static struct panel_generic_dpi_data dvi_panel = { + .name = generic, + .platform_enable= sdp3430_panel_enable_dvi, + .platform_disable = sdp3430_panel_disable_dvi, +}; + static struct omap_dss_device sdp3430_dvi_device = { .name = dvi, - .driver_name= generic_panel, - .type = OMAP_DISPLAY_TYPE_DPI, + .driver_name= generic_dpi_panel, + .data = dvi_panel, .phy.dpi.data_lines = 24, - .platform_enable= sdp3430_panel_enable_dvi, - .platform_disable = sdp3430_panel_disable_dvi, }; static struct omap_dss_device sdp3430_tv_device = { diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index 0739950..3534a23 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c @@ -35,6 +35,7 @@ #include plat/common.h #include plat/usb.h #include plat/display.h +#include plat/panel-generic-dpi.h #include mux.h #include control.h @@ -303,13 +304,17 @@ static void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev) lcd_enabled = 0; } +static struct panel_generic_dpi_data lcd_panel = { + .name = sharp_lq, + .platform_enable= am3517_evm_panel_enable_lcd, + .platform_disable = am3517_evm_panel_disable_lcd, +}; + static struct omap_dss_device am3517_evm_lcd_device = { - .type = OMAP_DISPLAY_TYPE_DPI, .name = lcd, - .driver_name= sharp_lq_panel, + .driver_name= generic_dpi_panel, + .data = lcd_panel, .phy.dpi.data_lines = 16, - .platform_enable= am3517_evm_panel_enable_lcd, - .platform_disable = am3517_evm_panel_disable_lcd, }; static int am3517_evm_panel_enable_tv(struct omap_dss_device *dssdev) @@ -346,13 +351,17 @@ static void am3517_evm_panel_disable_dvi(struct omap_dss_device *dssdev) dvi_enabled = 0; } +static struct panel_generic_dpi_data dvi_panel = { + .name = generic, + .platform_enable= am3517_evm_panel_enable_dvi, + .platform_disable = am3517_evm_panel_disable_dvi, +}; + static struct omap_dss_device am3517_evm_dvi_device = { - .type = OMAP_DISPLAY_TYPE_DPI, .name = dvi, - .driver_name= generic_panel, + .driver_name= generic_dpi_panel, + .data = dvi_panel, .phy.dpi.data_lines = 24, - .platform_enable= am3517_evm_panel_enable_dvi, - .platform_disable = am3517_evm_panel_disable_dvi, }; static struct omap_dss_device *am3517_evm_dss_devices[] = { diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 63f764e..1a69d32 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c @@ -46,6 +46,7 @@ #include plat/gpmc.h #include plat/usb.h #include plat/display.h +#include plat/panel-generic-dpi.h #include plat/mcspi.h #include mach/hardware.h @@ -351,22 +352,30 @@ static void cm_t35_panel_disable_tv(struct omap_dss_device *dssdev) { } +static struct panel_generic_dpi_data lcd_panel = { + .name = toppoly_tdo35s, + .platform_enable= cm_t35_panel_enable_lcd, + .platform_disable = cm_t35_panel_disable_lcd, +}; + static struct omap_dss_device cm_t35_lcd_device = { .name
[PATCH 3/3] OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers
Still keep sharp_ls_panel driver, because it contains blacklight control driver. Signed-off-by: Bryan Wu bryan...@canonical.com --- drivers/video/omap2/displays/Kconfig | 18 -- drivers/video/omap2/displays/Makefile |3 - drivers/video/omap2/displays/panel-generic.c | 174 .../video/omap2/displays/panel-sharp-lq043t1dg01.c | 165 --- .../video/omap2/displays/panel-toppoly-tdo35s.c| 164 -- 5 files changed, 0 insertions(+), 524 deletions(-) delete mode 100644 drivers/video/omap2/displays/panel-generic.c delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c delete mode 100644 drivers/video/omap2/displays/panel-toppoly-tdo35s.c diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig index cb3e339..9c09afd 100644 --- a/drivers/video/omap2/displays/Kconfig +++ b/drivers/video/omap2/displays/Kconfig @@ -9,12 +9,6 @@ config PANEL_GENERIC_DPI Supports LCD Panel used in TI SDP3430 and EVM boards, OMAP3517 EVM boards and CM-T35. -config PANEL_GENERIC -tristate Generic Panel -help - Generic panel driver. - Used for DVI output for Beagle and OMAP3 SDP. - config PANEL_SHARP_LS037V7DW01 tristate Sharp LS037V7DW01 LCD Panel depends on OMAP2_DSS @@ -22,24 +16,12 @@ config PANEL_SHARP_LS037V7DW01 help LCD Panel used in TI's SDP3430 and EVM boards -config PANEL_SHARP_LQ043T1DG01 -tristate Sharp LQ043T1DG01 LCD Panel -depends on OMAP2_DSS -help - LCD Panel used in TI's OMAP3517 EVM boards - config PANEL_TAAL tristate Taal DSI Panel depends on OMAP2_DSS_DSI help Taal DSI command mode panel from TPO. -config PANEL_TOPPOLY_TDO35S -tristate Toppoly TDO35S LCD Panel support -depends on OMAP2_DSS -help - LCD Panel used in CM-T35 - config PANEL_TPO_TD043MTEA1 tristate TPO TD043MTEA1 LCD Panel depends on OMAP2_DSS SPI diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile index 022058c..3bebe4d 100644 --- a/drivers/video/omap2/displays/Makefile +++ b/drivers/video/omap2/displays/Makefile @@ -1,9 +1,6 @@ obj-$(CONFIG_PANEL_GENERIC_DPI) += panel-generic-dpi.o -obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o -obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o obj-$(CONFIG_PANEL_TAAL) += panel-taal.o -obj-$(CONFIG_PANEL_TOPPOLY_TDO35S) += panel-toppoly-tdo35s.o obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o diff --git a/drivers/video/omap2/displays/panel-generic.c b/drivers/video/omap2/displays/panel-generic.c deleted file mode 100644 index 395a68d..000 --- a/drivers/video/omap2/displays/panel-generic.c +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Generic panel support - * - * Copyright (C) 2008 Nokia Corporation - * Author: Tomi Valkeinen tomi.valkei...@nokia.com - * - * 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. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see http://www.gnu.org/licenses/. - */ - -#include linux/module.h -#include linux/delay.h - -#include plat/display.h - -static struct omap_video_timings generic_panel_timings = { - /* 640 x 480 @ 60 Hz Reduced blanking VESA CVT 0.31M3-R */ - .x_res = 640, - .y_res = 480, - .pixel_clock= 23500, - .hfp= 48, - .hsw= 32, - .hbp= 80, - .vfp= 3, - .vsw= 4, - .vbp= 7, -}; - -static int generic_panel_power_on(struct omap_dss_device *dssdev) -{ - int r; - - if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE) - return 0; - - r = omapdss_dpi_display_enable(dssdev); - if (r) - goto err0; - - if (dssdev-platform_enable) { - r = dssdev-platform_enable(dssdev); - if (r) - goto err1; - } - - return 0; -err1: - omapdss_dpi_display_disable(dssdev); -err0: - return r; -} - -static void generic_panel_power_off(struct omap_dss_device *dssdev) -{ - if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE) - return; - - if (dssdev-platform_disable) - dssdev-platform_disable(dssdev
Re: [PATCH 1/3] OMAP: use generic panel data in board files
On Mon, Nov 8, 2010 at 7:26 AM, Tomi Valkeinen tomi.valkei...@nokia.com wrote: Hi, On Fri, 2010-11-05 at 20:43 +0100, ext Bryan Wu wrote: Introduce struct panel config data in panel.h, which will be used to match the right panel configurations in generic DPI panel driver and other future dsi panel drivers. Still keep sharp_ls_panel, since the sharp_ls_panel driver contains blacklight control driver code which will be moved out later. Then we can use generic DPI driver for sharp_ls_panel. As mentioned in the other mail, don't touch panel-taal or nokia-dsi-panel.h. They are not related to this change. Got it. I just found nokia-dsi-panel.h is some kind of confusing and tried to unify them. Obviously I should not touch them in this patchset. I will remove them in next version. The panel.h file should be spesific for the generic panel driver, so name the .c and .h files similarly. (yes, panel-taal.c and nokia-dsi-panel.h are not good examples for this, but I have a patch fixing it, I just haven't had time to push it forward =). OK, I got it. Actually I did that, but wanna unify the nokia-dis-panel.h somehow. I will change back. And remember that the kernel should compile and work after each individual patch in the patch set. In this patch you set the boards to use dvi_panel driver, but there is no dvi_panel driver yet. Got it. I will fold some patches together. Also some comments inline. Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-omap2/board-3430sdp.c | 10 +++- arch/arm/mach-omap2/board-am3517evm.c | 19 +-- arch/arm/mach-omap2/board-cm-t35.c | 19 +-- arch/arm/mach-omap2/board-devkit8000.c | 22 +--- arch/arm/mach-omap2/board-igep0020.c | 10 +++- arch/arm/mach-omap2/board-omap3beagle.c | 10 +++- arch/arm/mach-omap2/board-omap3evm.c | 10 +++- arch/arm/mach-omap2/board-omap3stalker.c | 19 +-- arch/arm/plat-omap/include/plat/nokia-dsi-panel.h | 31 --- arch/arm/plat-omap/include/plat/panel.h | 57 + drivers/video/omap2/displays/panel-taal.c | 26 -- 11 files changed, 148 insertions(+), 85 deletions(-) delete mode 100644 arch/arm/plat-omap/include/plat/nokia-dsi-panel.h create mode 100644 arch/arm/plat-omap/include/plat/panel.h diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 4e3742c..859b4e5 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -38,6 +38,7 @@ #include plat/dma.h #include plat/gpmc.h #include plat/display.h +#include plat/panel.h #include plat/gpmc-smc91x.h @@ -270,11 +271,14 @@ static struct omap_dss_device sdp3430_lcd_device = { .platform_disable = sdp3430_panel_disable_lcd, }; +static struct panel_data dvi_panel = { + .name = generic, +}; + static struct omap_dss_device sdp3430_dvi_device = { .name = dvi, - .driver_name = generic_panel, - .type = OMAP_DISPLAY_TYPE_DPI, - .phy.dpi.data_lines = 24, Why do you remove type and datalines configuration? You do this for the other panels also. I found this is common in all the generic dpi panel, but the value depends on the specific panel. I move this to the panel configuration data and will set this value in panel-dpi driver. Do you think need I keep them here? Actually I found all of them are 24 for generic one. 16 or 18 for others. -- Bryan Wu bryan...@canonical.com Kernel Developer +86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] OMAP: use generic panel data in board files
On Mon, Nov 8, 2010 at 7:19 AM, Tomi Valkeinen tomi.valkei...@nokia.com wrote: Hi, On Fri, 2010-11-05 at 22:17 +0100, ext Taneja, Archit wrote: Hi, linux-omap-ow...@vger.kernel.org wrote: Introduce struct panel config data in panel.h, which will be used to match the right panel configurations in generic DPI panel driver and other future dsi panel drivers. Still keep sharp_ls_panel, since the sharp_ls_panel driver contains blacklight control driver code which will be moved out later. Then we can use generic DPI driver for sharp_ls_panel. Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-omap2/board-3430sdp.c | 10 +++- arch/arm/mach-omap2/board-am3517evm.c | 19 +-- arch/arm/mach-omap2/board-cm-t35.c | 19 +-- arch/arm/mach-omap2/board-devkit8000.c | 22 +--- arch/arm/mach-omap2/board-igep0020.c | 10 +++- arch/arm/mach-omap2/board-omap3beagle.c | 10 +++- arch/arm/mach-omap2/board-omap3evm.c | 10 +++- arch/arm/mach-omap2/board-omap3stalker.c | 19 +-- arch/arm/plat-omap/include/plat/nokia-dsi-panel.h | 31 --- arch/arm/plat-omap/include/plat/panel.h | 57 + drivers/video/omap2/displays/panel-taal.c | 26 -- 11 files changed, 148 insertions(+), 85 deletions(-) delete mode 100644 arch/arm/plat-omap/include/plat/nokia-dsi-panel.h create mode 100644 arch/arm/plat-omap/include/plat/panel.h I am not totally sure about the need of removal of nokia-dsi-panel.h and the addition of a generic panel.h. I guess the reason why nokia-dsi-panel.h was introduced (and others that will be introduced in future) was to easily represent panel-specific data across different boards that use the same panel. Right. Don't touch panel-taal.c or nokia-dsi-panel.h, they are not related to this DPI panel stuff. For example, if there is a new panel which for some reson uses 2 pins, one for switching off and one for switching on the panel, then it would make sense to introduce a structure for this panel having members on_gpio and off_gpio, this struct could then be passed and accessed through dssdev-data in the panel's probe giving us the option to have different gpio numbers for different boards but finally being accessed in the same way by the driver. So, there isn't a need to generalize this struct and the corresponding header file for all panels and make it available for all board files. As far as the dummy panels are concerned, since the name is the only criteria to differentiate the panel, I think passing the name to the data member of omap_dss_device should itself be enough for the generic dpi driver to handle things. I think it's a bit confusing to just put a string to the void *data member, but fortunately we don't need to ponder about that: the generic DPI panel should be told about reset_gpio, max_backlight_level, platform_enable/disable and set/get_backlight, which need to be passed in a struct. So a header and a struct is needed for this generic DPI driver. Yeah, so we just put a name field in a struct such as generic-dpi-panel-data in generic-dpi-panel.h And our driver file will be panel-generic-dpi.c? Thanks, -- Bryan Wu bryan...@canonical.com Kernel Developer +86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #4)
There are 4 duplicated DPI panel drivers in DSS2 display driver. They are similar and a generic DPI panel driver can support all them with specific panel configuration. And new DPI panel driver can be easily supported by adding panel configurations into generic panel DPI driver. This patchset introduces a generic panel DPI driver, remove 3 panel drivers and enable generic panel DPI driver in board files. And it is based on 2.6.37-rc1. Building with omap2plus_defconfig is successful. Keep sharp_ls_panel, since it contains blacklight control code which will be moved out later. Bryan Wu (3): OMAP: DSS2: Add generic DPI panel display driver OMAP: use generic DPI panel driver in board files OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers arch/arm/mach-omap2/board-3430sdp.c| 10 +- arch/arm/mach-omap2/board-am3517evm.c | 19 +- arch/arm/mach-omap2/board-cm-t35.c | 19 +- arch/arm/mach-omap2/board-devkit8000.c | 22 +- arch/arm/mach-omap2/board-igep0020.c | 10 +- arch/arm/mach-omap2/board-omap3beagle.c| 10 +- arch/arm/mach-omap2/board-omap3evm.c | 10 +- arch/arm/mach-omap2/board-omap3stalker.c | 19 +- .../arm/plat-omap/include/plat/panel-generic-dpi.h | 31 ++ drivers/video/omap2/displays/Kconfig | 22 +- drivers/video/omap2/displays/Makefile |4 +- drivers/video/omap2/displays/panel-generic-dpi.c | 314 drivers/video/omap2/displays/panel-generic.c | 174 --- .../video/omap2/displays/panel-sharp-lq043t1dg01.c | 165 -- .../video/omap2/displays/panel-toppoly-tdo35s.c| 164 -- 15 files changed, 433 insertions(+), 560 deletions(-) create mode 100644 arch/arm/plat-omap/include/plat/panel-generic-dpi.h create mode 100644 drivers/video/omap2/displays/panel-generic-dpi.c delete mode 100644 drivers/video/omap2/displays/panel-generic.c delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c delete mode 100644 drivers/video/omap2/displays/panel-toppoly-tdo35s.c -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/3] OMAP: DSS2: Add generic DPI panel display driver
Generic DPI panel driver includes the driver and 4 similar panel configurations. It will match the panel name which is passed from platform data and setup the right configurations. With generic DPI panel driver, we can remove those 4 duplicated panel display drivers. In the future, it is simple for us just add new panel configuration date in panel-generic-dpi.c to support new display panel. Signed-off-by: Bryan Wu bryan...@canonical.com --- .../arm/plat-omap/include/plat/panel-generic-dpi.h | 31 ++ drivers/video/omap2/displays/Kconfig |8 + drivers/video/omap2/displays/Makefile |1 + drivers/video/omap2/displays/panel-generic-dpi.c | 314 4 files changed, 354 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-omap/include/plat/panel-generic-dpi.h create mode 100644 drivers/video/omap2/displays/panel-generic-dpi.c diff --git a/arch/arm/plat-omap/include/plat/panel-generic-dpi.h b/arch/arm/plat-omap/include/plat/panel-generic-dpi.h new file mode 100644 index 000..da50756 --- /dev/null +++ b/arch/arm/plat-omap/include/plat/panel-generic-dpi.h @@ -0,0 +1,31 @@ +/* + * Header for generic DPI panel driver + * + * Copyright (C) 2010 Canonical Ltd. + * Author: Bryan Wu bryan...@canonical.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see http://www.gnu.org/licenses/. + */ + +#ifndef __ARCH_ARM_PLAT_OMAP_GENERIC_DPI_PANEL_H +#define __ARCH_ARM_PLAT_OMAP_GENERIC_DPI_PANEL_H + +/** + * struct panel_data - panel driver configuration + * @name: panel name + */ +struct generic_dpi_panel_data { + const char *name; +}; + +#endif /* __ARCH_ARM_PLAT_OMAP_GENERIC_DPI_PANEL_H */ diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig index 12327bb..cb3e339 100644 --- a/drivers/video/omap2/displays/Kconfig +++ b/drivers/video/omap2/displays/Kconfig @@ -1,6 +1,14 @@ menu OMAP2/3 Display Device Drivers depends on OMAP2_DSS +config PANEL_GENERIC_DPI +tristate Generic DPI Panel +help + Generic DPI panel driver. + Supports DVI output for Beagle and OMAP3 SDP. + Supports LCD Panel used in TI SDP3430 and EVM boards, + OMAP3517 EVM boards and CM-T35. + config PANEL_GENERIC tristate Generic Panel help diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile index aa38609..022058c 100644 --- a/drivers/video/omap2/displays/Makefile +++ b/drivers/video/omap2/displays/Makefile @@ -1,3 +1,4 @@ +obj-$(CONFIG_PANEL_GENERIC_DPI) += panel-generic-dpi.o obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c new file mode 100644 index 000..b252e0f --- /dev/null +++ b/drivers/video/omap2/displays/panel-generic-dpi.c @@ -0,0 +1,314 @@ +/* + * Generic DPI Panels support + * + * Copyright (C) 2010 Canonical Ltd. + * Author: Bryan Wu bryan...@canonical.com + * + * Copyright (C) 2008 Nokia Corporation + * Author: Tomi Valkeinen tomi.valkei...@nokia.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see http://www.gnu.org/licenses/. + */ + +#include linux/module.h +#include linux/delay.h + +#include plat/display.h +#include plat/panel-generic-dpi.h + +struct panel_config { + struct omap_video_timings timings; + + int acbi; /* ac-bias pin transitions per interrupt */ + /* Unit: line clocks */ + int acb;/* ac-bias pin frequency */ + + enum omap_panel_config config; + + /* +* Used to match device to panel configuration +* when use generic panel driver +*/ + const char *name; + + int data_lines; +}; + +/* Panel configurations */ +static struct panel_config generic_dpi_panels
[PATCH 2/3] OMAP: use generic DPI panel driver in board files
Still keep sharp_ls_panel, since the sharp_ls_panel driver contains blacklight control driver code which will be moved out later. Then we can use generic DPI driver for sharp_ls_panel. Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-omap2/board-3430sdp.c | 10 +++--- arch/arm/mach-omap2/board-am3517evm.c| 19 +-- arch/arm/mach-omap2/board-cm-t35.c | 19 +-- arch/arm/mach-omap2/board-devkit8000.c | 22 ++ arch/arm/mach-omap2/board-igep0020.c | 10 +++--- arch/arm/mach-omap2/board-omap3beagle.c | 10 +++--- arch/arm/mach-omap2/board-omap3evm.c | 10 +++--- arch/arm/mach-omap2/board-omap3stalker.c | 19 +-- 8 files changed, 81 insertions(+), 38 deletions(-) diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 4e3742c..0561e45 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -38,6 +38,7 @@ #include plat/dma.h #include plat/gpmc.h #include plat/display.h +#include plat/panel-generic-dpi.h #include plat/gpmc-smc91x.h @@ -270,11 +271,14 @@ static struct omap_dss_device sdp3430_lcd_device = { .platform_disable = sdp3430_panel_disable_lcd, }; +static struct generic_dpi_panel_data dvi_panel = { + .name = generic, +}; + static struct omap_dss_device sdp3430_dvi_device = { .name = dvi, - .driver_name= generic_panel, - .type = OMAP_DISPLAY_TYPE_DPI, - .phy.dpi.data_lines = 24, + .driver_name= generic_dpi_panel, + .data = dvi_panel, .platform_enable= sdp3430_panel_enable_dvi, .platform_disable = sdp3430_panel_disable_dvi, }; diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index 0739950..875fab0 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c @@ -35,6 +35,7 @@ #include plat/common.h #include plat/usb.h #include plat/display.h +#include plat/panel-generic-dpi.h #include mux.h #include control.h @@ -303,11 +304,14 @@ static void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev) lcd_enabled = 0; } +static struct generic_dpi_panel_data lcd_panel = { + .name = sharp_lq, +}; + static struct omap_dss_device am3517_evm_lcd_device = { - .type = OMAP_DISPLAY_TYPE_DPI, .name = lcd, - .driver_name= sharp_lq_panel, - .phy.dpi.data_lines = 16, + .driver_name= generic_dpi_panel, + .data = lcd_panel, .platform_enable= am3517_evm_panel_enable_lcd, .platform_disable = am3517_evm_panel_disable_lcd, }; @@ -346,11 +350,14 @@ static void am3517_evm_panel_disable_dvi(struct omap_dss_device *dssdev) dvi_enabled = 0; } +static struct generic_dpi_panel_data dvi_panel = { + .name = generic, +}; + static struct omap_dss_device am3517_evm_dvi_device = { - .type = OMAP_DISPLAY_TYPE_DPI, .name = dvi, - .driver_name= generic_panel, - .phy.dpi.data_lines = 24, + .driver_name= generic_dpi_panel, + .data = dvi_panel, .platform_enable= am3517_evm_panel_enable_dvi, .platform_disable = am3517_evm_panel_disable_dvi, }; diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 63f764e..1b7748b 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c @@ -46,6 +46,7 @@ #include plat/gpmc.h #include plat/usb.h #include plat/display.h +#include plat/panel-generic-dpi.h #include plat/mcspi.h #include mach/hardware.h @@ -351,20 +352,26 @@ static void cm_t35_panel_disable_tv(struct omap_dss_device *dssdev) { } +static struct generic_dpi_panel_data lcd_panel = { + .name = toppoly_tdo35s, +}; + static struct omap_dss_device cm_t35_lcd_device = { .name = lcd, - .driver_name= toppoly_tdo35s_panel, - .type = OMAP_DISPLAY_TYPE_DPI, - .phy.dpi.data_lines = 18, + .driver_name= generic_dpi_panel, + .data = lcd_panel, .platform_enable= cm_t35_panel_enable_lcd, .platform_disable = cm_t35_panel_disable_lcd, }; +static struct generic_dpi_panel_data dvi_panel = { + .name = generic, +}; + static struct omap_dss_device cm_t35_dvi_device = { .name = dvi, - .driver_name= generic_panel, - .type = OMAP_DISPLAY_TYPE_DPI, - .phy.dpi.data_lines = 24, + .driver_name
[PATCH 3/3] OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers
Still keep sharp_ls_panel driver, because it contains blacklight control driver. Signed-off-by: Bryan Wu bryan...@canonical.com --- drivers/video/omap2/displays/Kconfig | 18 -- drivers/video/omap2/displays/Makefile |3 - drivers/video/omap2/displays/panel-generic.c | 174 .../video/omap2/displays/panel-sharp-lq043t1dg01.c | 165 --- .../video/omap2/displays/panel-toppoly-tdo35s.c| 164 -- 5 files changed, 0 insertions(+), 524 deletions(-) delete mode 100644 drivers/video/omap2/displays/panel-generic.c delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c delete mode 100644 drivers/video/omap2/displays/panel-toppoly-tdo35s.c diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig index cb3e339..9c09afd 100644 --- a/drivers/video/omap2/displays/Kconfig +++ b/drivers/video/omap2/displays/Kconfig @@ -9,12 +9,6 @@ config PANEL_GENERIC_DPI Supports LCD Panel used in TI SDP3430 and EVM boards, OMAP3517 EVM boards and CM-T35. -config PANEL_GENERIC -tristate Generic Panel -help - Generic panel driver. - Used for DVI output for Beagle and OMAP3 SDP. - config PANEL_SHARP_LS037V7DW01 tristate Sharp LS037V7DW01 LCD Panel depends on OMAP2_DSS @@ -22,24 +16,12 @@ config PANEL_SHARP_LS037V7DW01 help LCD Panel used in TI's SDP3430 and EVM boards -config PANEL_SHARP_LQ043T1DG01 -tristate Sharp LQ043T1DG01 LCD Panel -depends on OMAP2_DSS -help - LCD Panel used in TI's OMAP3517 EVM boards - config PANEL_TAAL tristate Taal DSI Panel depends on OMAP2_DSS_DSI help Taal DSI command mode panel from TPO. -config PANEL_TOPPOLY_TDO35S -tristate Toppoly TDO35S LCD Panel support -depends on OMAP2_DSS -help - LCD Panel used in CM-T35 - config PANEL_TPO_TD043MTEA1 tristate TPO TD043MTEA1 LCD Panel depends on OMAP2_DSS SPI diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile index 022058c..3bebe4d 100644 --- a/drivers/video/omap2/displays/Makefile +++ b/drivers/video/omap2/displays/Makefile @@ -1,9 +1,6 @@ obj-$(CONFIG_PANEL_GENERIC_DPI) += panel-generic-dpi.o -obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o -obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o obj-$(CONFIG_PANEL_TAAL) += panel-taal.o -obj-$(CONFIG_PANEL_TOPPOLY_TDO35S) += panel-toppoly-tdo35s.o obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o diff --git a/drivers/video/omap2/displays/panel-generic.c b/drivers/video/omap2/displays/panel-generic.c deleted file mode 100644 index 395a68d..000 --- a/drivers/video/omap2/displays/panel-generic.c +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Generic panel support - * - * Copyright (C) 2008 Nokia Corporation - * Author: Tomi Valkeinen tomi.valkei...@nokia.com - * - * 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. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see http://www.gnu.org/licenses/. - */ - -#include linux/module.h -#include linux/delay.h - -#include plat/display.h - -static struct omap_video_timings generic_panel_timings = { - /* 640 x 480 @ 60 Hz Reduced blanking VESA CVT 0.31M3-R */ - .x_res = 640, - .y_res = 480, - .pixel_clock= 23500, - .hfp= 48, - .hsw= 32, - .hbp= 80, - .vfp= 3, - .vsw= 4, - .vbp= 7, -}; - -static int generic_panel_power_on(struct omap_dss_device *dssdev) -{ - int r; - - if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE) - return 0; - - r = omapdss_dpi_display_enable(dssdev); - if (r) - goto err0; - - if (dssdev-platform_enable) { - r = dssdev-platform_enable(dssdev); - if (r) - goto err1; - } - - return 0; -err1: - omapdss_dpi_display_disable(dssdev); -err0: - return r; -} - -static void generic_panel_power_off(struct omap_dss_device *dssdev) -{ - if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE) - return; - - if (dssdev-platform_disable) - dssdev-platform_disable(dssdev
[PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #3)
There are 4 duplicated DPI panel drivers in DSS2 display driver. They are similar and a generic DPI panel driver can support all them with specific panel configuration. And new DPI panel driver can be easily supported by adding panel configurations into generic panel DPI driver. This patchset introduces a generic panel DPI driver, remove 3 panel drivers and enable generic panel DPI driver in board files. And it is based on 2.6.37-rc1. This patch use unified the panel_data struct for nokia_dsi_panel_data with DPI panel data. So panel-taal.c is updated as well. Building with omap2plus_defconfig is successful. Keep sharp_ls_panel, since it contains blacklight control code which will be moved out later. Bryan Wu (3): OMAP: use generic panel data in board files OMAP: DSS2: Add generic panel display driver OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers arch/arm/mach-omap2/board-3430sdp.c| 10 +- arch/arm/mach-omap2/board-am3517evm.c | 19 +- arch/arm/mach-omap2/board-cm-t35.c | 19 +- arch/arm/mach-omap2/board-devkit8000.c | 22 +- arch/arm/mach-omap2/board-igep0020.c | 10 +- arch/arm/mach-omap2/board-omap3beagle.c| 10 +- arch/arm/mach-omap2/board-omap3evm.c | 10 +- arch/arm/mach-omap2/board-omap3stalker.c | 19 +- arch/arm/plat-omap/include/plat/nokia-dsi-panel.h | 31 -- arch/arm/plat-omap/include/plat/panel.h| 57 drivers/video/omap2/displays/Kconfig | 22 +- drivers/video/omap2/displays/Makefile |4 +- drivers/video/omap2/displays/panel-dpi.c | 306 drivers/video/omap2/displays/panel-generic.c | 174 --- .../video/omap2/displays/panel-sharp-lq043t1dg01.c | 165 --- drivers/video/omap2/displays/panel-taal.c | 26 +- .../video/omap2/displays/panel-toppoly-tdo35s.c| 164 --- 17 files changed, 461 insertions(+), 607 deletions(-) delete mode 100644 arch/arm/plat-omap/include/plat/nokia-dsi-panel.h create mode 100644 arch/arm/plat-omap/include/plat/panel.h create mode 100644 drivers/video/omap2/displays/panel-dpi.c delete mode 100644 drivers/video/omap2/displays/panel-generic.c delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c delete mode 100644 drivers/video/omap2/displays/panel-toppoly-tdo35s.c -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/3] OMAP: use generic panel data in board files
Introduce struct panel config data in panel.h, which will be used to match the right panel configurations in generic DPI panel driver and other future dsi panel drivers. Still keep sharp_ls_panel, since the sharp_ls_panel driver contains blacklight control driver code which will be moved out later. Then we can use generic DPI driver for sharp_ls_panel. Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-omap2/board-3430sdp.c | 10 +++- arch/arm/mach-omap2/board-am3517evm.c | 19 +-- arch/arm/mach-omap2/board-cm-t35.c| 19 +-- arch/arm/mach-omap2/board-devkit8000.c| 22 +--- arch/arm/mach-omap2/board-igep0020.c | 10 +++- arch/arm/mach-omap2/board-omap3beagle.c | 10 +++- arch/arm/mach-omap2/board-omap3evm.c | 10 +++- arch/arm/mach-omap2/board-omap3stalker.c | 19 +-- arch/arm/plat-omap/include/plat/nokia-dsi-panel.h | 31 --- arch/arm/plat-omap/include/plat/panel.h | 57 + drivers/video/omap2/displays/panel-taal.c | 26 -- 11 files changed, 148 insertions(+), 85 deletions(-) delete mode 100644 arch/arm/plat-omap/include/plat/nokia-dsi-panel.h create mode 100644 arch/arm/plat-omap/include/plat/panel.h diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 4e3742c..859b4e5 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -38,6 +38,7 @@ #include plat/dma.h #include plat/gpmc.h #include plat/display.h +#include plat/panel.h #include plat/gpmc-smc91x.h @@ -270,11 +271,14 @@ static struct omap_dss_device sdp3430_lcd_device = { .platform_disable = sdp3430_panel_disable_lcd, }; +static struct panel_data dvi_panel = { + .name = generic, +}; + static struct omap_dss_device sdp3430_dvi_device = { .name = dvi, - .driver_name= generic_panel, - .type = OMAP_DISPLAY_TYPE_DPI, - .phy.dpi.data_lines = 24, + .driver_name= dpi_panel, + .data = dvi_panel, .platform_enable= sdp3430_panel_enable_dvi, .platform_disable = sdp3430_panel_disable_dvi, }; diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index 0739950..9b2b6ff 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c @@ -35,6 +35,7 @@ #include plat/common.h #include plat/usb.h #include plat/display.h +#include plat/panel.h #include mux.h #include control.h @@ -303,11 +304,14 @@ static void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev) lcd_enabled = 0; } +static struct panel_data lcd_panel = { + .name = sharp_lq, +}; + static struct omap_dss_device am3517_evm_lcd_device = { - .type = OMAP_DISPLAY_TYPE_DPI, .name = lcd, - .driver_name= sharp_lq_panel, - .phy.dpi.data_lines = 16, + .driver_name= dpi_panel, + .data = lcd_panel, .platform_enable= am3517_evm_panel_enable_lcd, .platform_disable = am3517_evm_panel_disable_lcd, }; @@ -346,11 +350,14 @@ static void am3517_evm_panel_disable_dvi(struct omap_dss_device *dssdev) dvi_enabled = 0; } +static struct panel_data dvi_panel = { + .name = generic, +}; + static struct omap_dss_device am3517_evm_dvi_device = { - .type = OMAP_DISPLAY_TYPE_DPI, .name = dvi, - .driver_name= generic_panel, - .phy.dpi.data_lines = 24, + .driver_name= dpi_panel, + .data = dvi_panel, .platform_enable= am3517_evm_panel_enable_dvi, .platform_disable = am3517_evm_panel_disable_dvi, }; diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 63f764e..326aa15 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c @@ -46,6 +46,7 @@ #include plat/gpmc.h #include plat/usb.h #include plat/display.h +#include plat/panel.h #include plat/mcspi.h #include mach/hardware.h @@ -351,20 +352,26 @@ static void cm_t35_panel_disable_tv(struct omap_dss_device *dssdev) { } +static struct panel_data lcd_panel = { + .name = toppoly_tdo35s, +}; + static struct omap_dss_device cm_t35_lcd_device = { .name = lcd, - .driver_name= toppoly_tdo35s_panel, - .type = OMAP_DISPLAY_TYPE_DPI, - .phy.dpi.data_lines = 18, + .driver_name= dpi_panel, + .data = lcd_panel, .platform_enable= cm_t35_panel_enable_lcd
[PATCH 2/3] OMAP: DSS2: Add generic panel display driver
Generic panel driver includes the driver and 4 similar panel configurations. It will match the panel name which is passed from platform data and setup the right configurations. With generic panel driver, we can remove those 4 duplicated panel display drivers. In the future, it is simple for us just add new panel configuration date in panel-generic.c to support new display panel. Signed-off-by: Bryan Wu bryan...@canonical.com --- drivers/video/omap2/displays/Kconfig |8 + drivers/video/omap2/displays/Makefile|1 + drivers/video/omap2/displays/panel-dpi.c | 306 ++ 3 files changed, 315 insertions(+), 0 deletions(-) create mode 100644 drivers/video/omap2/displays/panel-dpi.c diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig index 12327bb..9602d3f 100644 --- a/drivers/video/omap2/displays/Kconfig +++ b/drivers/video/omap2/displays/Kconfig @@ -1,6 +1,14 @@ menu OMAP2/3 Display Device Drivers depends on OMAP2_DSS +config PANEL_DPI +tristate Generic DPI Panel +help + Generic DPI panel driver. + Supports DVI output for Beagle and OMAP3 SDP. + Supports LCD Panel used in TI SDP3430 and EVM boards, + OMAP3517 EVM boards and CM-T35. + config PANEL_GENERIC tristate Generic Panel help diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile index aa38609..1265772 100644 --- a/drivers/video/omap2/displays/Makefile +++ b/drivers/video/omap2/displays/Makefile @@ -1,3 +1,4 @@ +obj-$(CONFIG_PANEL_DPI) += panel-dpi.o obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o diff --git a/drivers/video/omap2/displays/panel-dpi.c b/drivers/video/omap2/displays/panel-dpi.c new file mode 100644 index 000..1007ecb --- /dev/null +++ b/drivers/video/omap2/displays/panel-dpi.c @@ -0,0 +1,306 @@ +/* + * Generic DPI Panels support + * + * Copyright (C) 2010 Canonical Ltd. + * Author: Bryan Wu bryan...@canonical.com + * + * Copyright (C) 2008 Nokia Corporation + * Author: Tomi Valkeinen tomi.valkei...@nokia.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see http://www.gnu.org/licenses/. + */ + +#include linux/module.h +#include linux/delay.h + +#include plat/panel.h + +struct panel_config { + struct omap_video_timings timings; + + int acbi; /* ac-bias pin transitions per interrupt */ + /* Unit: line clocks */ + int acb;/* ac-bias pin frequency */ + + enum omap_panel_config config; + + /* +* Used to match device to panel configuration +* when use generic panel driver +*/ + const char *name; + + int data_lines; +}; + +/* Panel configurations */ +static struct panel_config dpi_panels[] = { + /* Generic Panel */ + { + { + .x_res = 640, + .y_res = 480, + + .pixel_clock= 23500, + + .hfp= 48, + .hsw= 32, + .hbp= 80, + + .vfp= 3, + .vsw= 4, + .vbp= 7, + }, + .acbi = 0x0, + .acb= 0x0, + .config = OMAP_DSS_LCD_TFT, + .name = generic, + .data_lines = 24, + }, + + /* Sharp LQ043T1DG01 */ + { + { + .x_res = 480, + .y_res = 272, + + .pixel_clock= 9000, + + .hsw= 42, + .hfp= 3, + .hbp= 2, + + .vsw= 11, + .vfp= 3, + .vbp= 2, + }, + .acbi = 0x0, + .acb= 0x0, + .config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS | + OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IEO, + .name
[PATCH 3/3] OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers
Still keep sharp_ls_panel driver, because it contains blacklight control driver. Signed-off-by: Bryan Wu bryan...@canonical.com --- drivers/video/omap2/displays/Kconfig | 18 -- drivers/video/omap2/displays/Makefile |3 - drivers/video/omap2/displays/panel-generic.c | 174 .../video/omap2/displays/panel-sharp-lq043t1dg01.c | 165 --- .../video/omap2/displays/panel-toppoly-tdo35s.c| 164 -- 5 files changed, 0 insertions(+), 524 deletions(-) delete mode 100644 drivers/video/omap2/displays/panel-generic.c delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c delete mode 100644 drivers/video/omap2/displays/panel-toppoly-tdo35s.c diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig index 9602d3f..aab2819 100644 --- a/drivers/video/omap2/displays/Kconfig +++ b/drivers/video/omap2/displays/Kconfig @@ -9,12 +9,6 @@ config PANEL_DPI Supports LCD Panel used in TI SDP3430 and EVM boards, OMAP3517 EVM boards and CM-T35. -config PANEL_GENERIC -tristate Generic Panel -help - Generic panel driver. - Used for DVI output for Beagle and OMAP3 SDP. - config PANEL_SHARP_LS037V7DW01 tristate Sharp LS037V7DW01 LCD Panel depends on OMAP2_DSS @@ -22,24 +16,12 @@ config PANEL_SHARP_LS037V7DW01 help LCD Panel used in TI's SDP3430 and EVM boards -config PANEL_SHARP_LQ043T1DG01 -tristate Sharp LQ043T1DG01 LCD Panel -depends on OMAP2_DSS -help - LCD Panel used in TI's OMAP3517 EVM boards - config PANEL_TAAL tristate Taal DSI Panel depends on OMAP2_DSS_DSI help Taal DSI command mode panel from TPO. -config PANEL_TOPPOLY_TDO35S -tristate Toppoly TDO35S LCD Panel support -depends on OMAP2_DSS -help - LCD Panel used in CM-T35 - config PANEL_TPO_TD043MTEA1 tristate TPO TD043MTEA1 LCD Panel depends on OMAP2_DSS SPI diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile index 1265772..f0947a7 100644 --- a/drivers/video/omap2/displays/Makefile +++ b/drivers/video/omap2/displays/Makefile @@ -1,9 +1,6 @@ obj-$(CONFIG_PANEL_DPI) += panel-dpi.o -obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o -obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o obj-$(CONFIG_PANEL_TAAL) += panel-taal.o -obj-$(CONFIG_PANEL_TOPPOLY_TDO35S) += panel-toppoly-tdo35s.o obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o diff --git a/drivers/video/omap2/displays/panel-generic.c b/drivers/video/omap2/displays/panel-generic.c deleted file mode 100644 index 395a68d..000 --- a/drivers/video/omap2/displays/panel-generic.c +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Generic panel support - * - * Copyright (C) 2008 Nokia Corporation - * Author: Tomi Valkeinen tomi.valkei...@nokia.com - * - * 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. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see http://www.gnu.org/licenses/. - */ - -#include linux/module.h -#include linux/delay.h - -#include plat/display.h - -static struct omap_video_timings generic_panel_timings = { - /* 640 x 480 @ 60 Hz Reduced blanking VESA CVT 0.31M3-R */ - .x_res = 640, - .y_res = 480, - .pixel_clock= 23500, - .hfp= 48, - .hsw= 32, - .hbp= 80, - .vfp= 3, - .vsw= 4, - .vbp= 7, -}; - -static int generic_panel_power_on(struct omap_dss_device *dssdev) -{ - int r; - - if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE) - return 0; - - r = omapdss_dpi_display_enable(dssdev); - if (r) - goto err0; - - if (dssdev-platform_enable) { - r = dssdev-platform_enable(dssdev); - if (r) - goto err1; - } - - return 0; -err1: - omapdss_dpi_display_disable(dssdev); -err0: - return r; -} - -static void generic_panel_power_off(struct omap_dss_device *dssdev) -{ - if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE) - return; - - if (dssdev-platform_disable) - dssdev-platform_disable(dssdev
Re: [PATCH 3/3] OMAP: use generic panel driver in board files
On Wed, Nov 3, 2010 at 11:08 AM, Tomi Valkeinen tomi.valkei...@nokia.com wrote: On Wed, 2010-11-03 at 13:56 +0100, ext Taneja, Archit wrote: Hi, linux-omap-ow...@vger.kernel.org wrote: Introduce some fields in struct panel, which will be used to match the right panel configurations in generic panel driver. Still keep sharp_ls_panel, since the sharp_ls_panel driver contains blacklight control driver code which will be moved out later. Then we can use generic driver for sharp_ls_panel. Signed-off-by: Bryan Wu bryan...@canonical.com [snip] diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h index c915a66..6e1fbbd 100644 --- a/arch/arm/plat-omap/include/plat/display.h +++ b/arch/arm/plat-omap/include/plat/display.h @@ -346,6 +346,24 @@ struct omap_overlay_manager { int (*disable)(struct omap_overlay_manager *mgr); }; +struct omap_display_panel { + struct omap_video_timings timings; + + int acbi; /* ac-bias pin transitions per interrupt */ + /* Unit: line clocks */ + int acb; /* ac-bias pin frequency */ + + enum omap_panel_config config; + + int power_on_delay; + int power_off_delay; + /* + * Used to match device to panel configuration + * when use generic panel driver + */ + const char *name; +}; + struct omap_dss_device { struct device dev; @@ -395,15 +413,7 @@ struct omap_dss_device { } venc; } phy; - struct { - struct omap_video_timings timings; - - int acbi; /* ac-bias pin transitions per interrupt */ - /* Unit: line clocks */ - int acb; /* ac-bias pin frequency */ - - enum omap_panel_config config; - } panel; + struct omap_display_panel panel; struct { u8 pixel_size; I don't think that changing the omap_dss_device structure is the best way to go about this. Members like power_on_delay and power_off_delay may not be required by all types of panels. Same goes for the new name member since its only used by the dummy dpi panels. I think it would be better to go with the approach taken in panel-taal.c where a struct panel_config exists to take care of extra requirements. The omap_dss_device struct should contain only those members which would be needed by the interface driver files like dsi.c, dpi.c etc. The rest should be taken care of the panel drivers internally. Yes, the configuration for the panel is panel driver specific features, and should not be in the standard structs. No need to add anything to display.h. In fact, there are things in display.h that should be removed, and this configurable panel driver could do that also. omap_dss_device contains reset_gpio, max_backlight_level, platform_enable/disable and set/get_backlight, which should actually be in panel spesific struct. After a quick study of panel-taal.c driver and board-4430sdp.c, I believe we can pass the information from *data pointer of struct omap_dss_device. And keep the all panel specific configuration in driver. I will keep the struct omap_dss_device untouched. Thanks, -Bryan -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/3] OMAP: DSS2: introduce generic panel display driver
On Wed, Nov 3, 2010 at 8:59 AM, Taneja, Archit arc...@ti.com wrote: Hi, Bryan Wu bryan...@canonical.com wrote: There are 4 duplicated panel drivers in DSS2 display driver. They are similar and generic panel driver can support all them with specific panel configuration. And new panel driver can be easily supported by adding panel configurations into generic panel driver. This patchset introduces generic panel driver, remove 3 panel drivers and enable generic panel driver in board files. And it is based on 2.6.37-rc1. Building with omap2plus_defconfig is successful. Keep sharp_ls_panel, since it contains blacklight control code which will be moved out later. Bryan Wu (3): OMAP: DSS2: Add generic panel display driver OMAP: DSS2: remove generic panel driver duplicated panel drivers OMAP: use generic panel driver in board files arch/arm/mach-omap2/board-3430sdp.c | 1 + arch/arm/mach-omap2/board-am3517evm.c | 4 +- arch/arm/mach-omap2/board-cm-t35.c | 4 +- arch/arm/mach-omap2/board-devkit8000.c | 2 + arch/arm/mach-omap2/board-igep0020.c | 1 + arch/arm/mach-omap2/board-omap3beagle.c | 1 + arch/arm/mach-omap2/board-omap3evm.c | 1 + arch/arm/mach-omap2/board-omap3stalker.c | 2 + arch/arm/plat-omap/include/plat/display.h | 28 +++- drivers/video/omap2/displays/Kconfig | 16 +-- drivers/video/omap2/displays/Makefile | 2 - drivers/video/omap2/displays/panel-generic.c | 153 -- .../video/omap2/displays/panel-sharp-lq043t1dg01.c | 165 .../video/omap2/displays/panel-toppoly-tdo35s.c | 164 --- 14 files changed, 175 insertions(+), 369 deletions(-) delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c delete mode 100644 drivers/video/omap2/displays/panel-toppoly-tdo35s.c This series will break the build if we try to compile after applying only the first or the first two patches of the series since things used by the first patch are introduced in the last patch. Archit Got it. I will try to reorder the sequence -- Bryan Wu bryan...@canonical.com Kernel Developer +86.138-1617-6545 Mobile Ubuntu Kernel Team Canonical Ltd. www.canonical.com Ubuntu - Linux for human beings | www.ubuntu.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/3] OMAP: DSS2: introduce dummy panel driver
There are 4 duplicated panel driver sin DSS2 display driver. They are similar and dummy panel driver can support all them with specific panel configuration. And new panel driver can be easily supported by adding panel configurations into dummy panel driver. This patchset introduces dummy panel driver, remove 3 panel drivers and enable dummy panel driver in board files. And it is based on 2.6.37-rc1. Building with omap2plus_defconfig is successful. Keep sharp_ls_panel, since it contains blacklight control code which will be moved out later. Bryan Wu (3): OMAP: DSS2: Add dummy panel display driver OMAP: DSS2: remove dummy panel driver duplicated panel drivers OMAP: use dummy panel driver in board files arch/arm/mach-omap2/board-3430sdp.c|3 +- arch/arm/mach-omap2/board-am3517evm.c |6 +- arch/arm/mach-omap2/board-cm-t35.c |6 +- arch/arm/mach-omap2/board-devkit8000.c |6 +- arch/arm/mach-omap2/board-igep0020.c |3 +- arch/arm/mach-omap2/board-omap3beagle.c|3 +- arch/arm/mach-omap2/board-omap3evm.c |3 +- arch/arm/mach-omap2/board-omap3stalker.c |6 +- arch/arm/plat-omap/include/plat/display.h | 28 +- drivers/video/omap2/displays/Kconfig | 22 +- drivers/video/omap2/displays/Makefile |4 +- drivers/video/omap2/displays/panel-dummy.c | 195 +++ drivers/video/omap2/displays/panel-dummy.h | 119 + drivers/video/omap2/displays/panel-generic.c | 174 --- .../video/omap2/displays/panel-sharp-lq043t1dg01.c | 165 -- .../video/omap2/displays/panel-tpo-td043mtea1.c| 535 16 files changed, 364 insertions(+), 914 deletions(-) create mode 100644 drivers/video/omap2/displays/panel-dummy.c create mode 100644 drivers/video/omap2/displays/panel-dummy.h delete mode 100644 drivers/video/omap2/displays/panel-generic.c delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c delete mode 100644 drivers/video/omap2/displays/panel-tpo-td043mtea1.c -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/3] OMAP: DSS2: remove dummy panel driver duplicated panel drivers
Still keep sharp_ls_panel driver, because it contains blacklight control driver. Signed-off-by: Bryan Wu bryan...@canonical.com --- drivers/video/omap2/displays/Kconfig | 18 - drivers/video/omap2/displays/Makefile |3 - drivers/video/omap2/displays/panel-generic.c | 174 --- .../video/omap2/displays/panel-sharp-lq043t1dg01.c | 165 -- .../video/omap2/displays/panel-tpo-td043mtea1.c| 535 5 files changed, 0 insertions(+), 895 deletions(-) delete mode 100644 drivers/video/omap2/displays/panel-generic.c delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c delete mode 100644 drivers/video/omap2/displays/panel-tpo-td043mtea1.c diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig index 4b2ed33..4a29863 100644 --- a/drivers/video/omap2/displays/Kconfig +++ b/drivers/video/omap2/displays/Kconfig @@ -9,12 +9,6 @@ config PANEL_DUMMY Supports LCD Panel used in TI SDP3430 and EVM boards, OMAP3517 EVM boards and CM-T35. -config PANEL_GENERIC -tristate Generic Panel -help - Generic panel driver. - Used for DVI output for Beagle and OMAP3 SDP. - config PANEL_SHARP_LS037V7DW01 tristate Sharp LS037V7DW01 LCD Panel depends on OMAP2_DSS @@ -22,24 +16,12 @@ config PANEL_SHARP_LS037V7DW01 help LCD Panel used in TI's SDP3430 and EVM boards -config PANEL_SHARP_LQ043T1DG01 -tristate Sharp LQ043T1DG01 LCD Panel -depends on OMAP2_DSS -help - LCD Panel used in TI's OMAP3517 EVM boards - config PANEL_TAAL tristate Taal DSI Panel depends on OMAP2_DSS_DSI help Taal DSI command mode panel from TPO. -config PANEL_TOPPOLY_TDO35S -tristate Toppoly TDO35S LCD Panel support -depends on OMAP2_DSS -help - LCD Panel used in CM-T35 - config PANEL_TPO_TD043MTEA1 tristate TPO TD043MTEA1 LCD Panel depends on OMAP2_DSS SPI diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile index 5b50036..587bef8 100644 --- a/drivers/video/omap2/displays/Makefile +++ b/drivers/video/omap2/displays/Makefile @@ -1,9 +1,6 @@ obj-$(CONFIG_PANEL_DUMMY) += panel-dummy.o -obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o -obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o obj-$(CONFIG_PANEL_TAAL) += panel-taal.o -obj-$(CONFIG_PANEL_TOPPOLY_TDO35S) += panel-toppoly-tdo35s.o obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o diff --git a/drivers/video/omap2/displays/panel-generic.c b/drivers/video/omap2/displays/panel-generic.c deleted file mode 100644 index 395a68d..000 --- a/drivers/video/omap2/displays/panel-generic.c +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Generic panel support - * - * Copyright (C) 2008 Nokia Corporation - * Author: Tomi Valkeinen tomi.valkei...@nokia.com - * - * 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. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see http://www.gnu.org/licenses/. - */ - -#include linux/module.h -#include linux/delay.h - -#include plat/display.h - -static struct omap_video_timings generic_panel_timings = { - /* 640 x 480 @ 60 Hz Reduced blanking VESA CVT 0.31M3-R */ - .x_res = 640, - .y_res = 480, - .pixel_clock= 23500, - .hfp= 48, - .hsw= 32, - .hbp= 80, - .vfp= 3, - .vsw= 4, - .vbp= 7, -}; - -static int generic_panel_power_on(struct omap_dss_device *dssdev) -{ - int r; - - if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE) - return 0; - - r = omapdss_dpi_display_enable(dssdev); - if (r) - goto err0; - - if (dssdev-platform_enable) { - r = dssdev-platform_enable(dssdev); - if (r) - goto err1; - } - - return 0; -err1: - omapdss_dpi_display_disable(dssdev); -err0: - return r; -} - -static void generic_panel_power_off(struct omap_dss_device *dssdev) -{ - if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE) - return; - - if (dssdev-platform_disable) - dssdev-platform_disable(dssdev); - - omapdss_dpi_display_disable(dssdev
[PATCH 1/3] OMAP: DSS2: Add dummy panel display driver
Dummy panel driver includes the driver and 4 similar panel configurations. It will match the panel name which is passed from platform data and setup the right configurations. With dummy panel driver, we can remove those 4 duplicated panel display drivers. In the future, it is simple for us just add new panel configuration date in panel-dummy.h to support new display panel. Signed-off-by: Bryan Wu bryan...@canonical.com --- drivers/video/omap2/displays/Kconfig |8 + drivers/video/omap2/displays/Makefile |1 + drivers/video/omap2/displays/panel-dummy.c | 195 drivers/video/omap2/displays/panel-dummy.h | 119 + 4 files changed, 323 insertions(+), 0 deletions(-) create mode 100644 drivers/video/omap2/displays/panel-dummy.c create mode 100644 drivers/video/omap2/displays/panel-dummy.h diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig index 12327bb..4b2ed33 100644 --- a/drivers/video/omap2/displays/Kconfig +++ b/drivers/video/omap2/displays/Kconfig @@ -1,6 +1,14 @@ menu OMAP2/3 Display Device Drivers depends on OMAP2_DSS +config PANEL_DUMMY +tristate Dummy Panel +help + Dummy panel driver. + Supports DVI output for Beagle and OMAP3 SDP. + Supports LCD Panel used in TI SDP3430 and EVM boards, + OMAP3517 EVM boards and CM-T35. + config PANEL_GENERIC tristate Generic Panel help diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile index aa38609..5b50036 100644 --- a/drivers/video/omap2/displays/Makefile +++ b/drivers/video/omap2/displays/Makefile @@ -1,3 +1,4 @@ +obj-$(CONFIG_PANEL_DUMMY) += panel-dummy.o obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o diff --git a/drivers/video/omap2/displays/panel-dummy.c b/drivers/video/omap2/displays/panel-dummy.c new file mode 100644 index 000..c4c387a --- /dev/null +++ b/drivers/video/omap2/displays/panel-dummy.c @@ -0,0 +1,195 @@ +/* + * Dummy Panels support + * + * Copyright (C) 2010 Canonical Ltd. + * Author: Bryan Wu bryan...@canonical.com + * + * 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. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see http://www.gnu.org/licenses/. + */ + +#include linux/module.h +#include linux/delay.h + +#include plat/display.h + +#include panel-dummy.h + +static int dummy_panel_power_on(struct omap_dss_device *dssdev) +{ + int r; + struct omap_display_panel *p = dssdev-panel; + + if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE) + return 0; + + r = omapdss_dpi_display_enable(dssdev); + if (r) + goto err0; + + /* wait couple of vsyncs until enabling the LCD */ + if (p-power_on_delay) + msleep(p-power_on_delay); + + if (dssdev-platform_enable) { + r = dssdev-platform_enable(dssdev); + if (r) + goto err1; + } + + return 0; +err1: + omapdss_dpi_display_disable(dssdev); +err0: + return r; +} + +static void dummy_panel_power_off(struct omap_dss_device *dssdev) +{ + struct omap_display_panel *p = dssdev-panel; + + if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE) + return; + + if (dssdev-platform_disable) + dssdev-platform_disable(dssdev); + + /* wait couple of vsyncs after disabling the LCD */ + if (p-power_off_delay) + msleep(p-power_off_delay); + + omapdss_dpi_display_disable(dssdev); +} + +static int dummy_panel_probe(struct omap_dss_device *dssdev) +{ + struct omap_display_panel *dp = dssdev-panel; + struct omap_display_panel *pp = NULL; + int i; + int matched = 0; + + if (dp-name == NULL) + return -ENODEV; + + /* Match for the configuration of the panel */ + for (i = 0; i ARRAY_SIZE(dummy_panels); i++) { + pp = dummy_panels[i]; + if (strcmp(pp-name, dp-name) == 0) { + matched = 1; + break; + } + } + + if (!matched) + return -ENODEV; + + memcpy(dp, pp, sizeof(struct omap_display_panel)); + + return 0; +} + +static void dummy_panel_remove(struct omap_dss_device *dssdev) +{ +} + +static int dummy_panel_enable(struct
[PATCH 3/3] OMAP: use dummy panel driver in board files
Introduce some fields in struct panel, which will be used to match the right panel configurations in dummy driver. Still keep sharp_ls_panel, since the sharp_ls_panel driver contains blacklight control driver code which will be moved out later. Then we can use dummy driver for sharp_ls_panel. Signed-off-by: Bryan Wu bryan...@canonical.com --- arch/arm/mach-omap2/board-3430sdp.c |3 ++- arch/arm/mach-omap2/board-am3517evm.c |6 -- arch/arm/mach-omap2/board-cm-t35.c|6 -- arch/arm/mach-omap2/board-devkit8000.c|6 -- arch/arm/mach-omap2/board-igep0020.c |3 ++- arch/arm/mach-omap2/board-omap3beagle.c |3 ++- arch/arm/mach-omap2/board-omap3evm.c |3 ++- arch/arm/mach-omap2/board-omap3stalker.c |6 -- arch/arm/plat-omap/include/plat/display.h | 28 +++- 9 files changed, 43 insertions(+), 21 deletions(-) diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 4e3742c..0e4598d 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -272,7 +272,8 @@ static struct omap_dss_device sdp3430_lcd_device = { static struct omap_dss_device sdp3430_dvi_device = { .name = dvi, - .driver_name= generic_panel, + .driver_name= dummy_panel, + .panel.name = generic, .type = OMAP_DISPLAY_TYPE_DPI, .phy.dpi.data_lines = 24, .platform_enable= sdp3430_panel_enable_dvi, diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index 0739950..88c9b76 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c @@ -306,7 +306,8 @@ static void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev) static struct omap_dss_device am3517_evm_lcd_device = { .type = OMAP_DISPLAY_TYPE_DPI, .name = lcd, - .driver_name= sharp_lq_panel, + .driver_name= dummy_panel, + .panel.name = sharp_lq, .phy.dpi.data_lines = 16, .platform_enable= am3517_evm_panel_enable_lcd, .platform_disable = am3517_evm_panel_disable_lcd, @@ -349,7 +350,8 @@ static void am3517_evm_panel_disable_dvi(struct omap_dss_device *dssdev) static struct omap_dss_device am3517_evm_dvi_device = { .type = OMAP_DISPLAY_TYPE_DPI, .name = dvi, - .driver_name= generic_panel, + .driver_name= dummy_panel, + .panel.name = generic, .phy.dpi.data_lines = 24, .platform_enable= am3517_evm_panel_enable_dvi, .platform_disable = am3517_evm_panel_disable_dvi, diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 63f764e..a0c555d 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c @@ -353,7 +353,8 @@ static void cm_t35_panel_disable_tv(struct omap_dss_device *dssdev) static struct omap_dss_device cm_t35_lcd_device = { .name = lcd, - .driver_name= toppoly_tdo35s_panel, + .driver_name= dummy_panel, + .panel.name = toppoly_tdo35s, .type = OMAP_DISPLAY_TYPE_DPI, .phy.dpi.data_lines = 18, .platform_enable= cm_t35_panel_enable_lcd, @@ -362,7 +363,8 @@ static struct omap_dss_device cm_t35_lcd_device = { static struct omap_dss_device cm_t35_dvi_device = { .name = dvi, - .driver_name= generic_panel, + .driver_name= dummy_panel, + .panel.name = generic, .type = OMAP_DISPLAY_TYPE_DPI, .phy.dpi.data_lines = 24, .platform_enable= cm_t35_panel_enable_dvi, diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c index 067f437..ce5be9c 100644 --- a/arch/arm/mach-omap2/board-devkit8000.c +++ b/arch/arm/mach-omap2/board-devkit8000.c @@ -151,7 +151,8 @@ static struct regulator_consumer_supply devkit8000_vio_supply = static struct omap_dss_device devkit8000_lcd_device = { .name = lcd, - .driver_name= generic_panel, + .driver_name= dummy_panel, + .panel.name = generic, .type = OMAP_DISPLAY_TYPE_DPI, .phy.dpi.data_lines = 24, .reset_gpio = -EINVAL, /* will be replaced */ @@ -160,7 +161,8 @@ static struct omap_dss_device devkit8000_lcd_device = { }; static struct omap_dss_device devkit8000_dvi_device = { .name = dvi, - .driver_name= generic_panel, + .driver_name