* Re: [PATCH 0/6] Davinci fbdev driver and enable it for DMx platform
From: Laurent Pinchart @ 2013-04-24 21:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1366804808-22720-1-git-send-email-prabhakar.csengg@gmail.com>
Hi Prabhakar,
Thank you for the patch.
On Wednesday 24 April 2013 17:30:02 Prabhakar Lad wrote:
> From: Lad, Prabhakar <prabhakar.csengg@gmail.com>
>
> This patch series adds an fbdev driver for Texas
> Instruments Davinci SoC.The display subsystem consists
> of OSD and VENC, with OSD supporting 2 RGb planes and
> 2 video planes.
> http://focus.ti.com/general/docs/lit/
> getliterature.tsp?literatureNumber=sprue37d&fileType=pdf
>
> A good amount of the OSD and VENC enabling code is
> present in the kernel, and this patch series adds the
> fbdev interface.
>
> The fbdev driver exports 4 nodes representing each
> plane to the user - from fb0 to fb3.
The obvious question is: why not a KMS driver instead ? :-)
> Lad, Prabhakar (6):
> media: davinci: vpbe: fix checkpatch warning for CamelCase
> media: davinci: vpbe: enable vpbe for fbdev addition
> davinci: vpbe: add fbdev driver
> ARM: davinci: dm355: enable fbdev driver
> ARM: davinci: dm365: enable fbdev driver
> ARM: davinci: dm644x: enable fbdev driver
>
> arch/arm/mach-davinci/dm355.c | 24 +-
> arch/arm/mach-davinci/dm365.c | 10 +
> arch/arm/mach-davinci/dm644x.c | 10 +
> drivers/media/platform/davinci/vpbe_display.c | 8 +-
> drivers/media/platform/davinci/vpbe_osd.c | 820 ++++++++-
> drivers/media/platform/davinci/vpbe_venc.c | 43 +
> drivers/video/Kconfig | 12 +
> drivers/video/Makefile | 1 +
> drivers/video/davincifb.c | 2523 ++++++++++++++++++++++
> drivers/video/davincifb.h | 194 ++
> include/media/davinci/vpbe_osd.h | 66 +-
> include/media/davinci/vpbe_venc.h | 21 +
> 12 files changed, 3702 insertions(+), 30 deletions(-)
> create mode 100644 drivers/video/davincifb.c
> create mode 100644 drivers/video/davincifb.h
--
Regards,
Laurent Pinchart
^ permalink raw reply
* Re: [PATCH] uvesafb: Correct/simplify warning message
From: Wang YanQing @ 2013-04-25 0:45 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1366380325-2038-1-git-send-email-bp@alien8.de>
On Fri, Apr 19, 2013 at 04:05:25PM +0200, Borislav Petkov wrote:
> From: Borislav Petkov <bp@suse.de>
>
> Streamline it a bit. No functional change.
>
> Signed-off-by: Borislav Petkov <bp@suse.de>
> Cc: Wang YanQing <udknight@gmail.com>
> Cc: Michal Januszewski <spock@gentoo.org>
> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
> Cc: linux-fbdev@vger.kernel.org
> ---
> drivers/video/uvesafb.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
> index d4284458377e..a309f9fabe8b 100644
> --- a/drivers/video/uvesafb.c
> +++ b/drivers/video/uvesafb.c
> @@ -819,8 +819,8 @@ static int uvesafb_vbe_init(struct fb_info *info)
> if (par->pmi_setpal || par->ypan) {
> if (__supported_pte_mask & _PAGE_NX) {
> par->pmi_setpal = par->ypan = 0;
> - printk(KERN_WARNING "uvesafb: NX protection is actively."
> - "We have better not to use the PMI.\n");
> + printk(KERN_WARNING "uvesafb: NX protection is active, "
> + "better not use the PMI.\n");
> } else {
> uvesafb_vbe_getpmi(task, par);
> }
> --
> 1.8.2.135.g7b592fa
Cc:tomi.valkeinen@ti.com
^ permalink raw reply
* Re: [PATCHv2 0/2] Add support for the Solomon SSD1306 OLED Controller
From: Maxime Ripard @ 2013-04-25 9:42 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1366624555-5616-1-git-send-email-maxime.ripard@free-electrons.com>
Hi Andrew,
Le 22/04/2013 11:55, Maxime Ripard a écrit :
> This patchset adds the needed bits to the ssd1307fb driver to support the
> very similar Solomon SSD1306 controller.
>
> Since the SSD1307 has been replaced by the SSD1306 in the latest CFA-10036
> production samples, we also need to change the device tree accordingly.
These patches have been around for more than a month and a half now,
without anyone making any comments on it.
I know that you have taken framebuffer patches in the past, especially
the driver that this patch modifies, would you consider merging it
through your tree?
I begin to have patches that depends on this one (the patchset "drivers:
video: Optimisations for the ssd1307fb driver"). I understand that we
are quite close to the 3.10 merge window opening (we even reached the
end of it for the ARM part, so the second patch will only be in 3.11),
but I'd like to make sure that this patch and the others doesn't get
silently ignored.
Thanks,
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply
* Re: [PATCH 1/2] drivers/video: Kconfig, fix mxsfb build
From: Sergei Shtylyov @ 2013-04-25 17:32 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1366791772-11133-2-git-send-email-mpa@pengutronix.de>
Hello.
On 24-04-2013 12:22, Markus Pargmann wrote:
> Kernel build fails with commit 669406534b4abb827d1bdc39bb5e2d5255818ae2
Please also specify the summary line of that commit in parens.
> This patch replaces OF_VIDEOMODE symbol by VIDEOMODE_HELPERS.
> Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
WBR, Sergei
^ permalink raw reply
* Re: [PATCH 0/6] Davinci fbdev driver and enable it for DMx platform
From: Prabhakar Lad @ 2013-04-26 5:58 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1780031.B4OAypccep@avalon>
Hi Laurent,
On Thu, Apr 25, 2013 at 2:32 AM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> Hi Prabhakar,
>
> Thank you for the patch.
>
> On Wednesday 24 April 2013 17:30:02 Prabhakar Lad wrote:
>> From: Lad, Prabhakar <prabhakar.csengg@gmail.com>
>>
>> This patch series adds an fbdev driver for Texas
>> Instruments Davinci SoC.The display subsystem consists
>> of OSD and VENC, with OSD supporting 2 RGb planes and
>> 2 video planes.
>> http://focus.ti.com/general/docs/lit/
>> getliterature.tsp?literatureNumber=sprue37d&fileType=pdf
>>
>> A good amount of the OSD and VENC enabling code is
>> present in the kernel, and this patch series adds the
>> fbdev interface.
>>
>> The fbdev driver exports 4 nodes representing each
>> plane to the user - from fb0 to fb3.
>
> The obvious question is: why not a KMS driver instead ? :-)
>
I did go through the KMS model (thanks for pointing to your work and the video)
and it looks like this would require a fair amount of development, at this point
of time I would go with the current implementation and revisit on KMS model
at later point of time.
Regards,
--Prabhakar
^ permalink raw reply
* [PATCH 1/1] backlight: add default brightness value option for tps65217-bl driver
From: Matus Ujhelyi @ 2013-04-26 9:15 UTC (permalink / raw)
To: grant.likely, rob.herring, rob, rpurdie, FlorianSchandinat
Cc: devicetree-discuss, linux-doc, linux-fbdev, linux-kernel,
marek.belisko, zonque, ujhelyi.m, Matus Ujhelyi
Signed-off-by: Matus Ujhelyi <matus.ujhelyi@streamunlimited.com>
---
.../video/backlight/tps65217-backlight.txt | 2 ++
drivers/video/backlight/tps65217_bl.c | 15 ++++++++++++++-
include/linux/mfd/tps65217.h | 1 +
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/video/backlight/tps65217-backlight.txt b/Documentation/devicetree/bindings/video/backlight/tps65217-backlight.txt
index cc4ee25..5fb9279 100644
--- a/Documentation/devicetree/bindings/video/backlight/tps65217-backlight.txt
+++ b/Documentation/devicetree/bindings/video/backlight/tps65217-backlight.txt
@@ -9,6 +9,7 @@ Required properties:
- backlight: node for specifying WLED1 and WLED2 lines in TPS65217
- isel: selection bit, valid values: 1 for ISEL1 (low-level) and 2 for ISEL2 (high-level)
- fdim: PWM dimming frequency, valid values: 100, 200, 500, 1000
+- default-brightness: valid values: 0-100
Each regulator is defined using the standard binding for regulators.
@@ -20,6 +21,7 @@ Example:
backlight {
isel = <1>; /* 1 - ISET1, 2 ISET2 */
fdim = <100>; /* TPS65217_BL_FDIM_100HZ */
+ default-brightness = <50>;
};
};
diff --git a/drivers/video/backlight/tps65217_bl.c b/drivers/video/backlight/tps65217_bl.c
index 7088163..0578231 100644
--- a/drivers/video/backlight/tps65217_bl.c
+++ b/drivers/video/backlight/tps65217_bl.c
@@ -245,6 +245,18 @@ tps65217_bl_parse_dt(struct platform_device *pdev)
}
}
+ if (!of_property_read_u32(node, "default-brightness", &val)) {
+ if (val < 0 ||
+ val > 100) {
+ dev_err(&pdev->dev,
+ "invalid 'default-brightness' value in the device tree\n");
+ err = ERR_PTR(-EINVAL);
+ goto err;
+ }
+
+ pdata->dft_brightness = val;
+ }
+
of_node_put(node);
return pdata;
@@ -311,7 +323,8 @@ static int tps65217_bl_probe(struct platform_device *pdev)
return PTR_ERR(tps65217_bl->bl);
}
- tps65217_bl->bl->props.brightness = 0;
+ tps65217_bl->bl->props.brightness = pdata->dft_brightness;
+ backlight_update_status(tps65217_bl->bl);
platform_set_drvdata(pdev, tps65217_bl);
return 0;
diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h
index 290762f..29eab2b 100644
--- a/include/linux/mfd/tps65217.h
+++ b/include/linux/mfd/tps65217.h
@@ -228,6 +228,7 @@ enum tps65217_bl_fdim {
struct tps65217_bl_pdata {
enum tps65217_bl_isel isel;
enum tps65217_bl_fdim fdim;
+ int dft_brightness;
};
/**
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH v8 0/3] Runtime Interpreted Power Sequences
From: Anton Vorontsov @ 2013-04-26 18:30 UTC (permalink / raw)
To: Simon Glass
Cc: Alexandre Courbot, Stephen Warren, Thierry Reding, Mark Zhang,
Grant Likely, Rob Herring, Mark Brown, David Woodhouse,
Arnd Bergmann, Leela Krishna Amudala,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, lk,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Devicetree Discuss, linux-pm-u79uwXL29TY76Z2rM5mHXA,
Alexandre Courbot
In-Reply-To: <CAPnjgZ1P6dmRB0sO2qBUtd=WBiNcY339NAit2faaotAfEqQDeQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Fri, Apr 26, 2013 at 11:55:35AM -0700, Simon Glass wrote:
> On Thu, Nov 15, 2012 at 10:38 PM, Alexandre Courbot <acourbot@nvidia.com> wrote:
> > Hopefully the final series before the feature gets merged. Anton Vorontsov
> > kindly accepted to take it into his tree, so this series is mostly a call for
> > acks, tests and reviews notices before the merge window for 3.8 opens. If you
> > are interested in seeing this feature, please add your name.
> >
> > This series also adds an entry for the subsystem into MAINTAINERS, setting me as
> > the person in charge.
> >
> > Changes from v7:
> > - fix bug reported by Tony Prisk
> > - add MAINTAINERS entry
> >
> > Alexandre Courbot (3):
> > Runtime Interpreted Power Sequences
> > pwm_backlight: use power sequences
> > Take maintainership of power sequences
>
> Did this actually land?
At least not through my tree. I saw a huge discussion, and I am not sure
how it ended and whether there was a consensus.
Thanks,
Anton
^ permalink raw reply
* Re: [PATCH v8 0/3] Runtime Interpreted Power Sequences
From: Simon Glass @ 2013-04-26 18:55 UTC (permalink / raw)
To: Alexandre Courbot
Cc: Anton Vorontsov, Stephen Warren, Thierry Reding, Mark Zhang,
Grant Likely, Rob Herring, Mark Brown, David Woodhouse,
Arnd Bergmann, Leela Krishna Amudala, linux-tegra@vger.kernel.org,
lk, linux-fbdev@vger.kernel.org, Devicetree Discuss, linux-pm,
Alexandre Courbot
In-Reply-To: <1353047903-14363-1-git-send-email-acourbot@nvidia.com>
Hi,
On Thu, Nov 15, 2012 at 10:38 PM, Alexandre Courbot <acourbot@nvidia.com> wrote:
> Hopefully the final series before the feature gets merged. Anton Vorontsov
> kindly accepted to take it into his tree, so this series is mostly a call for
> acks, tests and reviews notices before the merge window for 3.8 opens. If you
> are interested in seeing this feature, please add your name.
>
> This series also adds an entry for the subsystem into MAINTAINERS, setting me as
> the person in charge.
>
> Changes from v7:
> - fix bug reported by Tony Prisk
> - add MAINTAINERS entry
>
> Alexandre Courbot (3):
> Runtime Interpreted Power Sequences
> pwm_backlight: use power sequences
> Take maintainership of power sequences
Did this actually land? I can't see it in linux-next.
Regards,
Simon
^ permalink raw reply
* [PATCH 0/9] s3c24xx LCD controller driver cleanup
From: Sylwester Nawrocki @ 2013-04-26 20:02 UTC (permalink / raw)
To: linux-arm-kernel
This patch series moves the s3c2410fb driver header files from
arch/arm/mach-s3c24xx to the driver specific directories. It
also includes couple cleanups to the driver itself and a patch
actually enabling the display during initialization, so it works
with FRAMEBUFFER_CONSOLE disabled.
Patches 6...9 have no dependencies on rest of the series.
The whole series is also available at:
git://github.com/snawrocki/linux.git cleanup/s3c2410fb
It has been tested on the Micro2440 board.
Sylwester Nawrocki (9):
s3c2410fb: Move platform data declarations to
include/linux/platform_data
s3c2410fb: Make most of register definitions local
ARM: S3C24XX: Remove include/mach/regs-lcd.h header file
s3c2410fb: Register single platform driver
s3c2410fb: Use dev_pm_ops
s3c2410fb: Enable display by default
s3c2410fb: Use devm_ioremap_resource()
s3c2410fb: Remove redundant platform_set_drvdata()
s3c2410fb: Use module parameter instead of a sysfs entry
arch/arm/mach-s3c24xx/dma-s3c2410.c | 1 -
arch/arm/mach-s3c24xx/dma-s3c2412.c | 1 -
arch/arm/mach-s3c24xx/dma-s3c2440.c | 1 -
arch/arm/mach-s3c24xx/dma-s3c2443.c | 1 -
arch/arm/mach-s3c24xx/include/mach/fb.h | 1 -
arch/arm/mach-s3c24xx/include/mach/regs-lcd.h | 162 ----------------------
arch/arm/mach-s3c24xx/mach-anubis.c | 1 -
arch/arm/mach-s3c24xx/mach-at2440evb.c | 3 +-
arch/arm/mach-s3c24xx/mach-bast.c | 3 +-
arch/arm/mach-s3c24xx/mach-gta02.c | 2 +-
arch/arm/mach-s3c24xx/mach-h1940.c | 3 +-
arch/arm/mach-s3c24xx/mach-jive.c | 3 +-
arch/arm/mach-s3c24xx/mach-mini2440.c | 3 +-
arch/arm/mach-s3c24xx/mach-n30.c | 3 +-
arch/arm/mach-s3c24xx/mach-osiris.c | 1 -
arch/arm/mach-s3c24xx/mach-qt2410.c | 3 +-
arch/arm/mach-s3c24xx/mach-rx1950.c | 3 +-
arch/arm/mach-s3c24xx/mach-smdk2413.c | 3 +-
arch/arm/mach-s3c24xx/mach-smdk2416.c | 1 -
arch/arm/mach-s3c24xx/mach-smdk2440.c | 3 +-
arch/arm/mach-s3c24xx/mach-smdk2443.c | 3 +-
arch/arm/mach-s3c24xx/mach-vstms.c | 4 +-
arch/arm/plat-samsung/devs.c | 2 +-
arch/arm/plat-samsung/include/plat/fb-s3c2410.h | 72 ----------
drivers/video/s3c2410fb.c | 165 ++++++-----------------
drivers/video/s3c2410fb.h | 114 +++++++++++++++-
include/linux/platform_data/fb-s3c2410.h | 106 +++++++++++++++
27 files changed, 272 insertions(+), 396 deletions(-)
delete mode 100644 arch/arm/mach-s3c24xx/include/mach/fb.h
delete mode 100644 arch/arm/mach-s3c24xx/include/mach/regs-lcd.h
delete mode 100644 arch/arm/plat-samsung/include/plat/fb-s3c2410.h
create mode 100644 include/linux/platform_data/fb-s3c2410.h
--
1.7.4.1
^ permalink raw reply
* [PATCH 1/9] s3c2410fb: Move platform data declarations to include/linux/platform_data
From: Sylwester Nawrocki @ 2013-04-26 20:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1367006543-5458-1-git-send-email-sylvester.nawrocki@gmail.com>
Move the platform data structure declarations to include/linux/platform_data
where it's supposed to be placed, rather than in platform specific directories.
Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
---
arch/arm/mach-s3c24xx/include/mach/fb.h | 1 -
arch/arm/mach-s3c24xx/mach-at2440evb.c | 2 +-
arch/arm/mach-s3c24xx/mach-bast.c | 2 +-
arch/arm/mach-s3c24xx/mach-gta02.c | 2 +-
arch/arm/mach-s3c24xx/mach-h1940.c | 2 +-
arch/arm/mach-s3c24xx/mach-jive.c | 2 +-
arch/arm/mach-s3c24xx/mach-mini2440.c | 2 +-
arch/arm/mach-s3c24xx/mach-n30.c | 2 +-
arch/arm/mach-s3c24xx/mach-qt2410.c | 2 +-
arch/arm/mach-s3c24xx/mach-rx1950.c | 2 +-
arch/arm/mach-s3c24xx/mach-smdk2413.c | 2 +-
arch/arm/mach-s3c24xx/mach-smdk2440.c | 2 +-
arch/arm/mach-s3c24xx/mach-smdk2443.c | 2 +-
arch/arm/mach-s3c24xx/mach-vstms.c | 3 +-
arch/arm/plat-samsung/devs.c | 2 +-
arch/arm/plat-samsung/include/plat/fb-s3c2410.h | 72 -----------------------
drivers/video/s3c2410fb.c | 2 +-
include/linux/platform_data/fb-s3c2410.h | 72 +++++++++++++++++++++++
18 files changed, 87 insertions(+), 89 deletions(-)
delete mode 100644 arch/arm/mach-s3c24xx/include/mach/fb.h
delete mode 100644 arch/arm/plat-samsung/include/plat/fb-s3c2410.h
create mode 100644 include/linux/platform_data/fb-s3c2410.h
diff --git a/arch/arm/mach-s3c24xx/include/mach/fb.h b/arch/arm/mach-s3c24xx/include/mach/fb.h
deleted file mode 100644
index a957bc8e..0000000
--- a/arch/arm/mach-s3c24xx/include/mach/fb.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <plat/fb-s3c2410.h>
diff --git a/arch/arm/mach-s3c24xx/mach-at2440evb.c b/arch/arm/mach-s3c24xx/mach-at2440evb.c
index 6dfeeb7..e4d71d5 100644
--- a/arch/arm/mach-s3c24xx/mach-at2440evb.c
+++ b/arch/arm/mach-s3c24xx/mach-at2440evb.c
@@ -29,7 +29,7 @@
#include <asm/mach/irq.h>
#include <mach/hardware.h>
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
#include <asm/irq.h>
#include <asm/mach-types.h>
diff --git a/arch/arm/mach-s3c24xx/mach-bast.c b/arch/arm/mach-s3c24xx/mach-bast.c
index 22d6ae9..4402741 100644
--- a/arch/arm/mach-s3c24xx/mach-bast.c
+++ b/arch/arm/mach-s3c24xx/mach-bast.c
@@ -44,7 +44,7 @@
#include <asm/mach/irq.h>
#include <asm/mach-types.h>
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
#include <mach/hardware.h>
#include <mach/regs-gpio.h>
#include <mach/regs-lcd.h>
diff --git a/arch/arm/mach-s3c24xx/mach-gta02.c b/arch/arm/mach-s3c24xx/mach-gta02.c
index 13d8d07..cdad542 100644
--- a/arch/arm/mach-s3c24xx/mach-gta02.c
+++ b/arch/arm/mach-s3c24xx/mach-gta02.c
@@ -71,7 +71,7 @@
#include <linux/platform_data/usb-ohci-s3c2410.h>
#include <linux/platform_data/usb-s3c2410_udc.h>
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
#include <mach/hardware.h>
#include <mach/regs-gpio.h>
#include <mach/regs-irq.h>
diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c
index af4334d..39ce53a 100644
--- a/arch/arm/mach-s3c24xx/mach-h1940.c
+++ b/arch/arm/mach-s3c24xx/mach-h1940.c
@@ -49,7 +49,7 @@
#include <sound/uda1380.h>
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
#include <mach/hardware.h>
#include <mach/regs-clock.h>
#include <mach/regs-gpio.h>
diff --git a/arch/arm/mach-s3c24xx/mach-jive.c b/arch/arm/mach-s3c24xx/mach-jive.c
index a45fcd8..81e8e8c 100644
--- a/arch/arm/mach-s3c24xx/mach-jive.c
+++ b/arch/arm/mach-s3c24xx/mach-jive.c
@@ -37,7 +37,7 @@
#include <mach/regs-gpio.h>
#include <mach/regs-lcd.h>
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
#include <asm/mach-types.h>
diff --git a/arch/arm/mach-s3c24xx/mach-mini2440.c b/arch/arm/mach-s3c24xx/mach-mini2440.c
index a83db46..aa59f48 100644
--- a/arch/arm/mach-s3c24xx/mach-mini2440.c
+++ b/arch/arm/mach-s3c24xx/mach-mini2440.c
@@ -34,7 +34,7 @@
#include <asm/mach/map.h>
#include <mach/hardware.h>
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
#include <asm/mach-types.h>
#include <plat/regs-serial.h>
diff --git a/arch/arm/mach-s3c24xx/mach-n30.c b/arch/arm/mach-s3c24xx/mach-n30.c
index 2cb46c3..3a32a75 100644
--- a/arch/arm/mach-s3c24xx/mach-n30.c
+++ b/arch/arm/mach-s3c24xx/mach-n30.c
@@ -32,7 +32,7 @@
#include <asm/irq.h>
#include <asm/mach-types.h>
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
#include <linux/platform_data/leds-s3c24xx.h>
#include <mach/regs-gpio.h>
#include <mach/regs-lcd.h>
diff --git a/arch/arm/mach-s3c24xx/mach-qt2410.c b/arch/arm/mach-s3c24xx/mach-qt2410.c
index f8feaea..65be582 100644
--- a/arch/arm/mach-s3c24xx/mach-qt2410.c
+++ b/arch/arm/mach-s3c24xx/mach-qt2410.c
@@ -50,7 +50,7 @@
#include <linux/platform_data/leds-s3c24xx.h>
#include <mach/regs-lcd.h>
#include <plat/regs-serial.h>
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
#include <linux/platform_data/mtd-nand-s3c2410.h>
#include <linux/platform_data/usb-s3c2410_udc.h>
#include <linux/platform_data/i2c-s3c2410.h>
diff --git a/arch/arm/mach-s3c24xx/mach-rx1950.c b/arch/arm/mach-s3c24xx/mach-rx1950.c
index e4d67a3..17fad4b 100644
--- a/arch/arm/mach-s3c24xx/mach-rx1950.c
+++ b/arch/arm/mach-s3c24xx/mach-rx1950.c
@@ -48,7 +48,7 @@
#include <sound/uda1380.h>
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
#include <mach/regs-gpio.h>
#include <mach/regs-lcd.h>
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2413.c b/arch/arm/mach-s3c24xx/mach-smdk2413.c
index 8146e92..d504272 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2413.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2413.c
@@ -39,7 +39,7 @@
#include <linux/platform_data/usb-s3c2410_udc.h>
#include <linux/platform_data/i2c-s3c2410.h>
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
#include <plat/clock.h>
#include <plat/devs.h>
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2440.c b/arch/arm/mach-s3c24xx/mach-smdk2440.c
index de2e5d3..8546941 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2440.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2440.c
@@ -35,7 +35,7 @@
#include <mach/regs-gpio.h>
#include <mach/regs-lcd.h>
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
#include <linux/platform_data/i2c-s3c2410.h>
#include <plat/clock.h>
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2443.c b/arch/arm/mach-s3c24xx/mach-smdk2443.c
index 9435c3b..5baa2e2 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2443.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2443.c
@@ -35,7 +35,7 @@
#include <mach/regs-gpio.h>
#include <mach/regs-lcd.h>
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
#include <linux/platform_data/i2c-s3c2410.h>
#include <plat/clock.h>
diff --git a/arch/arm/mach-s3c24xx/mach-vstms.c b/arch/arm/mach-s3c24xx/mach-vstms.c
index b665884..86c9199 100644
--- a/arch/arm/mach-s3c24xx/mach-vstms.c
+++ b/arch/arm/mach-s3c24xx/mach-vstms.c
@@ -36,8 +36,7 @@
#include <mach/regs-gpio.h>
#include <mach/regs-lcd.h>
-#include <mach/fb.h>
-
+#include <linux/platform_data/fb-s3c2410.h>
#include <linux/platform_data/i2c-s3c2410.h>
#include <linux/platform_data/mtd-nand-s3c2410.h>
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index e1124d9..33c39bb 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -50,7 +50,7 @@
#include <linux/platform_data/ata-samsung_cf.h>
#include <linux/platform_data/usb-ehci-s5p.h>
#include <plat/fb.h>
-#include <plat/fb-s3c2410.h>
+#include <linux/platform_data/fb-s3c2410.h>
#include <plat/hdmi.h>
#include <linux/platform_data/hwmon-s3c.h>
#include <linux/platform_data/i2c-s3c2410.h>
diff --git a/arch/arm/plat-samsung/include/plat/fb-s3c2410.h b/arch/arm/plat-samsung/include/plat/fb-s3c2410.h
deleted file mode 100644
index 4e5d958..0000000
--- a/arch/arm/plat-samsung/include/plat/fb-s3c2410.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* arch/arm/plat-samsung/include/plat/fb-s3c2410.h
- *
- * Copyright (c) 2004 Arnaud Patard <arnaud.patard@rtp-net.org>
- *
- * Inspired by pxafb.h
- *
- * 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.
-*/
-
-#ifndef __ASM_PLAT_FB_S3C2410_H
-#define __ASM_PLAT_FB_S3C2410_H __FILE__
-
-struct s3c2410fb_hw {
- unsigned long lcdcon1;
- unsigned long lcdcon2;
- unsigned long lcdcon3;
- unsigned long lcdcon4;
- unsigned long lcdcon5;
-};
-
-/* LCD description */
-struct s3c2410fb_display {
- /* LCD type */
- unsigned type;
-
- /* Screen size */
- unsigned short width;
- unsigned short height;
-
- /* Screen info */
- unsigned short xres;
- unsigned short yres;
- unsigned short bpp;
-
- unsigned pixclock; /* pixclock in picoseconds */
- unsigned short left_margin; /* value in pixels (TFT) or HCLKs (STN) */
- unsigned short right_margin; /* value in pixels (TFT) or HCLKs (STN) */
- unsigned short hsync_len; /* value in pixels (TFT) or HCLKs (STN) */
- unsigned short upper_margin; /* value in lines (TFT) or 0 (STN) */
- unsigned short lower_margin; /* value in lines (TFT) or 0 (STN) */
- unsigned short vsync_len; /* value in lines (TFT) or 0 (STN) */
-
- /* lcd configuration registers */
- unsigned long lcdcon5;
-};
-
-struct s3c2410fb_mach_info {
-
- struct s3c2410fb_display *displays; /* attached diplays info */
- unsigned num_displays; /* number of defined displays */
- unsigned default_display;
-
- /* GPIOs */
-
- unsigned long gpcup;
- unsigned long gpcup_mask;
- unsigned long gpccon;
- unsigned long gpccon_mask;
- unsigned long gpdup;
- unsigned long gpdup_mask;
- unsigned long gpdcon;
- unsigned long gpdcon_mask;
-
- /* lpc3600 control register */
- unsigned long lpcsel;
-};
-
-extern void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *);
-
-#endif /* __ASM_PLAT_FB_S3C2410_H */
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index 76a0e7f..dc10dbe 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -32,10 +32,10 @@
#include <asm/div64.h>
+#include <linux/platform_data/fb-s3c2410.h>
#include <asm/mach/map.h>
#include <mach/regs-lcd.h>
#include <mach/regs-gpio.h>
-#include <mach/fb.h>
#ifdef CONFIG_PM
#include <linux/pm.h>
diff --git a/include/linux/platform_data/fb-s3c2410.h b/include/linux/platform_data/fb-s3c2410.h
new file mode 100644
index 0000000..dbebc62
--- /dev/null
+++ b/include/linux/platform_data/fb-s3c2410.h
@@ -0,0 +1,72 @@
+/* arch/arm/plat-samsung/include/plat/fb-s3c2410.h
+ *
+ * Copyright (c) 2004 Arnaud Patard <arnaud.patard@rtp-net.org>
+ *
+ * Inspired by pxafb.h
+ *
+ * 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.
+*/
+
+#ifndef __FB_S3C2410_H
+#define __FB_S3C2410_H __FILE__
+
+struct s3c2410fb_hw {
+ unsigned long lcdcon1;
+ unsigned long lcdcon2;
+ unsigned long lcdcon3;
+ unsigned long lcdcon4;
+ unsigned long lcdcon5;
+};
+
+/* LCD description */
+struct s3c2410fb_display {
+ /* LCD type */
+ unsigned type;
+
+ /* Screen size */
+ unsigned short width;
+ unsigned short height;
+
+ /* Screen info */
+ unsigned short xres;
+ unsigned short yres;
+ unsigned short bpp;
+
+ unsigned pixclock; /* pixclock in picoseconds */
+ unsigned short left_margin; /* value in pixels (TFT) or HCLKs (STN) */
+ unsigned short right_margin; /* value in pixels (TFT) or HCLKs (STN) */
+ unsigned short hsync_len; /* value in pixels (TFT) or HCLKs (STN) */
+ unsigned short upper_margin; /* value in lines (TFT) or 0 (STN) */
+ unsigned short lower_margin; /* value in lines (TFT) or 0 (STN) */
+ unsigned short vsync_len; /* value in lines (TFT) or 0 (STN) */
+
+ /* lcd configuration registers */
+ unsigned long lcdcon5;
+};
+
+struct s3c2410fb_mach_info {
+
+ struct s3c2410fb_display *displays; /* attached diplays info */
+ unsigned num_displays; /* number of defined displays */
+ unsigned default_display;
+
+ /* GPIOs */
+
+ unsigned long gpcup;
+ unsigned long gpcup_mask;
+ unsigned long gpccon;
+ unsigned long gpccon_mask;
+ unsigned long gpdup;
+ unsigned long gpdup_mask;
+ unsigned long gpdcon;
+ unsigned long gpdcon_mask;
+
+ /* lpc3600 control register */
+ unsigned long lpcsel;
+};
+
+extern void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *);
+
+#endif /* __FB_S3C2410_H */
--
1.7.4.1
^ permalink raw reply related
* [PATCH 2/9] s3c2410fb: Make most of register definitions local
From: Sylwester Nawrocki @ 2013-04-26 20:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1367006543-5458-1-git-send-email-sylvester.nawrocki@gmail.com>
Move most of the register definitions to the driver's private header file.
Some of the register bit field definitions are used in the platform data
structure and will be moved to include/linux/platform_data/fb-s3c2410.h
in subsequent patch.
Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
---
arch/arm/mach-s3c24xx/include/mach/regs-lcd.h | 110 ------------------------
drivers/video/s3c2410fb.h | 114 ++++++++++++++++++++++++-
2 files changed, 112 insertions(+), 112 deletions(-)
diff --git a/arch/arm/mach-s3c24xx/include/mach/regs-lcd.h b/arch/arm/mach-s3c24xx/include/mach/regs-lcd.h
index ee8f040..369511f 100644
--- a/arch/arm/mach-s3c24xx/include/mach/regs-lcd.h
+++ b/arch/arm/mach-s3c24xx/include/mach/regs-lcd.h
@@ -12,16 +12,6 @@
#ifndef ___ASM_ARCH_REGS_LCD_H
#define ___ASM_ARCH_REGS_LCD_H
-#define S3C2410_LCDREG(x) (x)
-
-/* LCD control registers */
-#define S3C2410_LCDCON1 S3C2410_LCDREG(0x00)
-#define S3C2410_LCDCON2 S3C2410_LCDREG(0x04)
-#define S3C2410_LCDCON3 S3C2410_LCDREG(0x08)
-#define S3C2410_LCDCON4 S3C2410_LCDREG(0x0C)
-#define S3C2410_LCDCON5 S3C2410_LCDREG(0x10)
-
-#define S3C2410_LCDCON1_CLKVAL(x) ((x) << 8)
#define S3C2410_LCDCON1_MMODE (1<<7)
#define S3C2410_LCDCON1_DSCAN4 (0<<5)
#define S3C2410_LCDCON1_STN4 (1<<5)
@@ -45,32 +35,6 @@
#define S3C2410_LCDCON1_MODEMASK 0x1E
-#define S3C2410_LCDCON2_VBPD(x) ((x) << 24)
-#define S3C2410_LCDCON2_LINEVAL(x) ((x) << 14)
-#define S3C2410_LCDCON2_VFPD(x) ((x) << 6)
-#define S3C2410_LCDCON2_VSPW(x) ((x) << 0)
-
-#define S3C2410_LCDCON2_GET_VBPD(x) ( ((x) >> 24) & 0xFF)
-#define S3C2410_LCDCON2_GET_VFPD(x) ( ((x) >> 6) & 0xFF)
-#define S3C2410_LCDCON2_GET_VSPW(x) ( ((x) >> 0) & 0x3F)
-
-#define S3C2410_LCDCON3_HBPD(x) ((x) << 19)
-#define S3C2410_LCDCON3_WDLY(x) ((x) << 19)
-#define S3C2410_LCDCON3_HOZVAL(x) ((x) << 8)
-#define S3C2410_LCDCON3_HFPD(x) ((x) << 0)
-#define S3C2410_LCDCON3_LINEBLANK(x)((x) << 0)
-
-#define S3C2410_LCDCON3_GET_HBPD(x) ( ((x) >> 19) & 0x7F)
-#define S3C2410_LCDCON3_GET_HFPD(x) ( ((x) >> 0) & 0xFF)
-
-/* LDCCON4 changes for STN mode on the S3C2412 */
-
-#define S3C2410_LCDCON4_MVAL(x) ((x) << 8)
-#define S3C2410_LCDCON4_HSPW(x) ((x) << 0)
-#define S3C2410_LCDCON4_WLH(x) ((x) << 0)
-
-#define S3C2410_LCDCON4_GET_HSPW(x) ( ((x) >> 0) & 0xFF)
-
#define S3C2410_LCDCON5_BPP24BL (1<<12)
#define S3C2410_LCDCON5_FRM565 (1<<11)
#define S3C2410_LCDCON5_INVVCLK (1<<10)
@@ -85,78 +49,4 @@
#define S3C2410_LCDCON5_BSWP (1<<1)
#define S3C2410_LCDCON5_HWSWP (1<<0)
-/* framebuffer start addressed */
-#define S3C2410_LCDSADDR1 S3C2410_LCDREG(0x14)
-#define S3C2410_LCDSADDR2 S3C2410_LCDREG(0x18)
-#define S3C2410_LCDSADDR3 S3C2410_LCDREG(0x1C)
-
-#define S3C2410_LCDBANK(x) ((x) << 21)
-#define S3C2410_LCDBASEU(x) (x)
-
-#define S3C2410_OFFSIZE(x) ((x) << 11)
-#define S3C2410_PAGEWIDTH(x) (x)
-
-/* colour lookup and miscellaneous controls */
-
-#define S3C2410_REDLUT S3C2410_LCDREG(0x20)
-#define S3C2410_GREENLUT S3C2410_LCDREG(0x24)
-#define S3C2410_BLUELUT S3C2410_LCDREG(0x28)
-
-#define S3C2410_DITHMODE S3C2410_LCDREG(0x4C)
-#define S3C2410_TPAL S3C2410_LCDREG(0x50)
-
-#define S3C2410_TPAL_EN (1<<24)
-
-/* interrupt info */
-#define S3C2410_LCDINTPND S3C2410_LCDREG(0x54)
-#define S3C2410_LCDSRCPND S3C2410_LCDREG(0x58)
-#define S3C2410_LCDINTMSK S3C2410_LCDREG(0x5C)
-#define S3C2410_LCDINT_FIWSEL (1<<2)
-#define S3C2410_LCDINT_FRSYNC (1<<1)
-#define S3C2410_LCDINT_FICNT (1<<0)
-
-/* s3c2442 extra stn registers */
-
-#define S3C2442_REDLUT S3C2410_LCDREG(0x20)
-#define S3C2442_GREENLUT S3C2410_LCDREG(0x24)
-#define S3C2442_BLUELUT S3C2410_LCDREG(0x28)
-#define S3C2442_DITHMODE S3C2410_LCDREG(0x20)
-
-#define S3C2410_LPCSEL S3C2410_LCDREG(0x60)
-
-#define S3C2410_TFTPAL(x) S3C2410_LCDREG((0x400 + (x)*4))
-
-/* S3C2412 registers */
-
-#define S3C2412_TPAL S3C2410_LCDREG(0x20)
-
-#define S3C2412_LCDINTPND S3C2410_LCDREG(0x24)
-#define S3C2412_LCDSRCPND S3C2410_LCDREG(0x28)
-#define S3C2412_LCDINTMSK S3C2410_LCDREG(0x2C)
-
-#define S3C2412_TCONSEL S3C2410_LCDREG(0x30)
-
-#define S3C2412_LCDCON6 S3C2410_LCDREG(0x34)
-#define S3C2412_LCDCON7 S3C2410_LCDREG(0x38)
-#define S3C2412_LCDCON8 S3C2410_LCDREG(0x3C)
-#define S3C2412_LCDCON9 S3C2410_LCDREG(0x40)
-
-#define S3C2412_REDLUT(x) S3C2410_LCDREG(0x44 + ((x)*4))
-#define S3C2412_GREENLUT(x) S3C2410_LCDREG(0x60 + ((x)*4))
-#define S3C2412_BLUELUT(x) S3C2410_LCDREG(0x98 + ((x)*4))
-
-#define S3C2412_FRCPAT(x) S3C2410_LCDREG(0xB4 + ((x)*4))
-
-/* general registers */
-
-/* base of the LCD registers, where INTPND, INTSRC and then INTMSK
- * are available. */
-
-#define S3C2410_LCDINTBASE S3C2410_LCDREG(0x54)
-#define S3C2412_LCDINTBASE S3C2410_LCDREG(0x24)
-
-#define S3C24XX_LCDINTPND (0x00)
-#define S3C24XX_LCDSRCPND (0x04)
-#define S3C24XX_LCDINTMSK (0x08)
-
#endif /* ___ASM_ARCH_REGS_LCD_H */
diff --git a/drivers/video/s3c2410fb.h b/drivers/video/s3c2410fb.h
index 47a17bd..4e56b77 100644
--- a/drivers/video/s3c2410fb.h
+++ b/drivers/video/s3c2410fb.h
@@ -7,12 +7,122 @@
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive for
* more details.
- *
-*/
+ */
#ifndef __S3C2410FB_H
#define __S3C2410FB_H
+/* LCD control registers */
+#define S3C2410_LCDCON1 0x00
+#define S3C2410_LCDCON1_CLKVAL(x) ((x) << 8)
+#define S3C2410_LCDCON1_ENVID 1
+#define S3C2410_LCDCON1_MODEMASK 0x1e
+#define S3C2410_LCDCON1_MMODE (1 << 7)
+
+#define S3C2410_LCDCON2 0x04
+#define S3C2410_LCDCON2_VBPD(x) ((x) << 24)
+#define S3C2410_LCDCON2_LINEVAL(x) ((x) << 14)
+#define S3C2410_LCDCON2_VFPD(x) ((x) << 6)
+#define S3C2410_LCDCON2_VSPW(x) ((x) << 0)
+
+#define S3C2410_LCDCON2_GET_VBPD(x) (((x) >> 24) & 0xff)
+#define S3C2410_LCDCON2_GET_VFPD(x) (((x) >> 6) & 0xff)
+#define S3C2410_LCDCON2_GET_VSPW(x) (((x) >> 0) & 0x3f)
+
+#define S3C2410_LCDCON3 0x08
+#define S3C2410_LCDCON3_HBPD(x) ((x) << 19)
+#define S3C2410_LCDCON3_WDLY(x) ((x) << 19)
+#define S3C2410_LCDCON3_HOZVAL(x) ((x) << 8)
+#define S3C2410_LCDCON3_HFPD(x) ((x) << 0)
+#define S3C2410_LCDCON3_LINEBLANK(x) ((x) << 0)
+
+#define S3C2410_LCDCON3_GET_HBPD(x) (((x) >> 19) & 0x7f)
+#define S3C2410_LCDCON3_GET_HFPD(x) (((x) >> 0) & 0xff)
+
+/* LDCCON4 changes for STN mode on the S3C2412 */
+
+#define S3C2410_LCDCON4 0x0c
+#define S3C2410_LCDCON4_MVAL(x) ((x) << 8)
+#define S3C2410_LCDCON4_HSPW(x) ((x) << 0)
+#define S3C2410_LCDCON4_WLH(x) ((x) << 0)
+#define S3C2410_LCDCON4_GET_HSPW(x) (((x) >> 0) & 0xff)
+
+#define S3C2410_LCDCON5 0x10
+
+/* framebuffer start addressed */
+#define S3C2410_LCDSADDR1 0x14
+#define S3C2410_LCDSADDR2 0x18
+#define S3C2410_LCDSADDR3 0x1c
+
+#define S3C2410_LCDBANK(x) ((x) << 21)
+#define S3C2410_LCDBASEU(x) (x)
+
+#define S3C2410_OFFSIZE(x) ((x) << 11)
+#define S3C2410_PAGEWIDTH(x) (x)
+
+/* colour lookup and miscellaneous controls */
+
+#define S3C2410_REDLUT 0x20
+#define S3C2410_GREENLUT 0x24
+#define S3C2410_BLUELUT 0x28
+
+#define S3C2410_DITHMODE 0x4c
+#define S3C2410_TPAL 0x50
+
+#define S3C2410_TPAL_EN (1 << 24)
+
+/* interrupt info */
+#define S3C2410_LCDINTPND 0x54
+#define S3C2410_LCDSRCPND 0x58
+#define S3C2410_LCDINTMSK 0x5c
+#define S3C2410_LCDINT_FIWSEL (1 << 2)
+#define S3C2410_LCDINT_FRSYNC (1 << 1)
+#define S3C2410_LCDINT_FICNT (1 << 0)
+
+/* s3c2442 extra stn registers */
+
+#define S3C2442_REDLUT 0x20
+#define S3C2442_GREENLUT 0x24
+#define S3C2442_BLUELUT 0x28
+#define S3C2442_DITHMODE 0x20
+
+#define S3C2410_LPCSEL 0x60
+
+#define S3C2410_TFTPAL(x) (0x400 + ((x) * 4))
+
+/* S3C2412 registers */
+
+#define S3C2412_TPAL 0x20
+
+#define S3C2412_LCDINTPND 0x24
+#define S3C2412_LCDSRCPND 0x28
+#define S3C2412_LCDINTMSK 0x2c
+#define S3C2412_TCONSEL 0x30
+#define S3C2412_LCDCON6 0x34
+#define S3C2412_LCDCON7 0x38
+#define S3C2412_LCDCON8 0x3c
+#define S3C2412_LCDCON9 0x40
+
+#define S3C2412_REDLUT(x) (0x44 + ((x) * 4))
+#define S3C2412_GREENLUT(x) (0x60 + ((x) * 4))
+#define S3C2412_BLUELUT(x) (0x98 + ((x) * 4))
+
+#define S3C2412_FRCPAT(x) (0xb4 + ((x)*4))
+
+/* General registers. */
+
+/*
+ * Base of the LCD registers, where INTPND, INTSRC and then INTMSK
+ * are available.
+ */
+#define S3C2410_LCDINTBASE 0x54
+#define S3C2412_LCDINTBASE 0x24
+
+#define S3C24XX_LCDINTPND 0x00
+#define S3C24XX_LCDSRCPND 0x04
+#define S3C24XX_LCDINTMSK 0x08
+
+
enum s3c_drv_type {
DRV_S3C2410,
DRV_S3C2412,
--
1.7.4.1
^ permalink raw reply related
* [PATCH 3/9] ARM: S3C24XX: Remove include/mach/regs-lcd.h header file
From: Sylwester Nawrocki @ 2013-04-26 20:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1367006543-5458-1-git-send-email-sylvester.nawrocki@gmail.com>
Move remaining s3c2410 LCD controller register bit field definitions
to the platform data header. Now the regs-lcd.h header can be removed
and inclusion of the mach specific header dropped from the driver.
Next step could be to redefine platform data structure, so register
specific definitions are private to the driver. Another possibility
is to add DT support, however these platforms will likely use ATAGS
for some time yet.
Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
---
arch/arm/mach-s3c24xx/dma-s3c2410.c | 1 -
arch/arm/mach-s3c24xx/dma-s3c2412.c | 1 -
arch/arm/mach-s3c24xx/dma-s3c2440.c | 1 -
arch/arm/mach-s3c24xx/dma-s3c2443.c | 1 -
arch/arm/mach-s3c24xx/include/mach/regs-lcd.h | 52 -------------------------
arch/arm/mach-s3c24xx/mach-anubis.c | 1 -
arch/arm/mach-s3c24xx/mach-at2440evb.c | 1 -
arch/arm/mach-s3c24xx/mach-bast.c | 1 -
arch/arm/mach-s3c24xx/mach-h1940.c | 1 -
arch/arm/mach-s3c24xx/mach-jive.c | 1 -
arch/arm/mach-s3c24xx/mach-mini2440.c | 1 -
arch/arm/mach-s3c24xx/mach-n30.c | 1 -
arch/arm/mach-s3c24xx/mach-osiris.c | 1 -
arch/arm/mach-s3c24xx/mach-qt2410.c | 1 -
arch/arm/mach-s3c24xx/mach-rx1950.c | 1 -
arch/arm/mach-s3c24xx/mach-smdk2413.c | 1 -
arch/arm/mach-s3c24xx/mach-smdk2416.c | 1 -
arch/arm/mach-s3c24xx/mach-smdk2440.c | 1 -
arch/arm/mach-s3c24xx/mach-smdk2443.c | 1 -
arch/arm/mach-s3c24xx/mach-vstms.c | 1 -
drivers/video/s3c2410fb.c | 1 -
include/linux/platform_data/fb-s3c2410.h | 34 ++++++++++++++++
22 files changed, 34 insertions(+), 72 deletions(-)
delete mode 100644 arch/arm/mach-s3c24xx/include/mach/regs-lcd.h
diff --git a/arch/arm/mach-s3c24xx/dma-s3c2410.c b/arch/arm/mach-s3c24xx/dma-s3c2410.c
index a6c94b8..764556a 100644
--- a/arch/arm/mach-s3c24xx/dma-s3c2410.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2410.c
@@ -27,7 +27,6 @@
#include <mach/regs-gpio.h>
#include <plat/regs-ac97.h>
#include <plat/regs-dma.h>
-#include <mach/regs-lcd.h>
#include <plat/regs-iis.h>
#include <plat/regs-spi.h>
diff --git a/arch/arm/mach-s3c24xx/dma-s3c2412.c b/arch/arm/mach-s3c24xx/dma-s3c2412.c
index c0e8c3f..f02fc3c 100644
--- a/arch/arm/mach-s3c24xx/dma-s3c2412.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2412.c
@@ -27,7 +27,6 @@
#include <mach/regs-gpio.h>
#include <plat/regs-ac97.h>
#include <plat/regs-dma.h>
-#include <mach/regs-lcd.h>
#include <plat/regs-iis.h>
#include <plat/regs-spi.h>
diff --git a/arch/arm/mach-s3c24xx/dma-s3c2440.c b/arch/arm/mach-s3c24xx/dma-s3c2440.c
index 1c08eccd..b621563 100644
--- a/arch/arm/mach-s3c24xx/dma-s3c2440.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2440.c
@@ -27,7 +27,6 @@
#include <mach/regs-gpio.h>
#include <plat/regs-ac97.h>
#include <plat/regs-dma.h>
-#include <mach/regs-lcd.h>
#include <plat/regs-iis.h>
#include <plat/regs-spi.h>
diff --git a/arch/arm/mach-s3c24xx/dma-s3c2443.c b/arch/arm/mach-s3c24xx/dma-s3c2443.c
index 000e4c6..095e841 100644
--- a/arch/arm/mach-s3c24xx/dma-s3c2443.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2443.c
@@ -27,7 +27,6 @@
#include <mach/regs-gpio.h>
#include <plat/regs-ac97.h>
#include <plat/regs-dma.h>
-#include <mach/regs-lcd.h>
#include <plat/regs-iis.h>
#include <plat/regs-spi.h>
diff --git a/arch/arm/mach-s3c24xx/include/mach/regs-lcd.h b/arch/arm/mach-s3c24xx/include/mach/regs-lcd.h
deleted file mode 100644
index 369511f..0000000
--- a/arch/arm/mach-s3c24xx/include/mach/regs-lcd.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* arch/arm/mach-s3c2410/include/mach/regs-lcd.h
- *
- * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
- * http://www.simtec.co.uk/products/SWLINUX/
- *
- * 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.
-*/
-
-
-#ifndef ___ASM_ARCH_REGS_LCD_H
-#define ___ASM_ARCH_REGS_LCD_H
-
-#define S3C2410_LCDCON1_MMODE (1<<7)
-#define S3C2410_LCDCON1_DSCAN4 (0<<5)
-#define S3C2410_LCDCON1_STN4 (1<<5)
-#define S3C2410_LCDCON1_STN8 (2<<5)
-#define S3C2410_LCDCON1_TFT (3<<5)
-
-#define S3C2410_LCDCON1_STN1BPP (0<<1)
-#define S3C2410_LCDCON1_STN2GREY (1<<1)
-#define S3C2410_LCDCON1_STN4GREY (2<<1)
-#define S3C2410_LCDCON1_STN8BPP (3<<1)
-#define S3C2410_LCDCON1_STN12BPP (4<<1)
-
-#define S3C2410_LCDCON1_TFT1BPP (8<<1)
-#define S3C2410_LCDCON1_TFT2BPP (9<<1)
-#define S3C2410_LCDCON1_TFT4BPP (10<<1)
-#define S3C2410_LCDCON1_TFT8BPP (11<<1)
-#define S3C2410_LCDCON1_TFT16BPP (12<<1)
-#define S3C2410_LCDCON1_TFT24BPP (13<<1)
-
-#define S3C2410_LCDCON1_ENVID (1)
-
-#define S3C2410_LCDCON1_MODEMASK 0x1E
-
-#define S3C2410_LCDCON5_BPP24BL (1<<12)
-#define S3C2410_LCDCON5_FRM565 (1<<11)
-#define S3C2410_LCDCON5_INVVCLK (1<<10)
-#define S3C2410_LCDCON5_INVVLINE (1<<9)
-#define S3C2410_LCDCON5_INVVFRAME (1<<8)
-#define S3C2410_LCDCON5_INVVD (1<<7)
-#define S3C2410_LCDCON5_INVVDEN (1<<6)
-#define S3C2410_LCDCON5_INVPWREN (1<<5)
-#define S3C2410_LCDCON5_INVLEND (1<<4)
-#define S3C2410_LCDCON5_PWREN (1<<3)
-#define S3C2410_LCDCON5_ENLEND (1<<2)
-#define S3C2410_LCDCON5_BSWP (1<<1)
-#define S3C2410_LCDCON5_HWSWP (1<<0)
-
-#endif /* ___ASM_ARCH_REGS_LCD_H */
diff --git a/arch/arm/mach-s3c24xx/mach-anubis.c b/arch/arm/mach-s3c24xx/mach-anubis.c
index c1fb6c3..d5e8cad 100644
--- a/arch/arm/mach-s3c24xx/mach-anubis.c
+++ b/arch/arm/mach-s3c24xx/mach-anubis.c
@@ -34,7 +34,6 @@
#include <plat/regs-serial.h>
#include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
#include <linux/platform_data/mtd-nand-s3c2410.h>
#include <linux/platform_data/i2c-s3c2410.h>
diff --git a/arch/arm/mach-s3c24xx/mach-at2440evb.c b/arch/arm/mach-s3c24xx/mach-at2440evb.c
index e4d71d5..f151bf7 100644
--- a/arch/arm/mach-s3c24xx/mach-at2440evb.c
+++ b/arch/arm/mach-s3c24xx/mach-at2440evb.c
@@ -35,7 +35,6 @@
#include <plat/regs-serial.h>
#include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
#include <linux/platform_data/mtd-nand-s3c2410.h>
#include <linux/platform_data/i2c-s3c2410.h>
diff --git a/arch/arm/mach-s3c24xx/mach-bast.c b/arch/arm/mach-s3c24xx/mach-bast.c
index 4402741..a500b21 100644
--- a/arch/arm/mach-s3c24xx/mach-bast.c
+++ b/arch/arm/mach-s3c24xx/mach-bast.c
@@ -47,7 +47,6 @@
#include <linux/platform_data/fb-s3c2410.h>
#include <mach/hardware.h>
#include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
#include <plat/clock.h>
#include <plat/cpu.h>
diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c
index 39ce53a..0236201 100644
--- a/arch/arm/mach-s3c24xx/mach-h1940.c
+++ b/arch/arm/mach-s3c24xx/mach-h1940.c
@@ -53,7 +53,6 @@
#include <mach/hardware.h>
#include <mach/regs-clock.h>
#include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
#include <plat/clock.h>
#include <plat/cpu.h>
diff --git a/arch/arm/mach-s3c24xx/mach-jive.c b/arch/arm/mach-s3c24xx/mach-jive.c
index 81e8e8c..d1347ec 100644
--- a/arch/arm/mach-s3c24xx/mach-jive.c
+++ b/arch/arm/mach-s3c24xx/mach-jive.c
@@ -36,7 +36,6 @@
#include <linux/platform_data/i2c-s3c2410.h>
#include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
#include <linux/platform_data/fb-s3c2410.h>
#include <asm/mach-types.h>
diff --git a/arch/arm/mach-s3c24xx/mach-mini2440.c b/arch/arm/mach-s3c24xx/mach-mini2440.c
index aa59f48..d0f25a4 100644
--- a/arch/arm/mach-s3c24xx/mach-mini2440.c
+++ b/arch/arm/mach-s3c24xx/mach-mini2440.c
@@ -40,7 +40,6 @@
#include <plat/regs-serial.h>
#include <mach/regs-gpio.h>
#include <linux/platform_data/leds-s3c24xx.h>
-#include <mach/regs-lcd.h>
#include <mach/irqs.h>
#include <linux/platform_data/mtd-nand-s3c2410.h>
#include <linux/platform_data/i2c-s3c2410.h>
diff --git a/arch/arm/mach-s3c24xx/mach-n30.c b/arch/arm/mach-s3c24xx/mach-n30.c
index 3a32a75..8b956b7 100644
--- a/arch/arm/mach-s3c24xx/mach-n30.c
+++ b/arch/arm/mach-s3c24xx/mach-n30.c
@@ -35,7 +35,6 @@
#include <linux/platform_data/fb-s3c2410.h>
#include <linux/platform_data/leds-s3c24xx.h>
#include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
#include <asm/mach/arch.h>
#include <asm/mach/irq.h>
diff --git a/arch/arm/mach-s3c24xx/mach-osiris.c b/arch/arm/mach-s3c24xx/mach-osiris.c
index 58d6fbe..eeca631 100644
--- a/arch/arm/mach-s3c24xx/mach-osiris.c
+++ b/arch/arm/mach-s3c24xx/mach-osiris.c
@@ -49,7 +49,6 @@
#include <mach/hardware.h>
#include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
#include "common.h"
#include "osiris.h"
diff --git a/arch/arm/mach-s3c24xx/mach-qt2410.c b/arch/arm/mach-s3c24xx/mach-qt2410.c
index 65be582..7e11373 100644
--- a/arch/arm/mach-s3c24xx/mach-qt2410.c
+++ b/arch/arm/mach-s3c24xx/mach-qt2410.c
@@ -48,7 +48,6 @@
#include <asm/mach-types.h>
#include <linux/platform_data/leds-s3c24xx.h>
-#include <mach/regs-lcd.h>
#include <plat/regs-serial.h>
#include <linux/platform_data/fb-s3c2410.h>
#include <linux/platform_data/mtd-nand-s3c2410.h>
diff --git a/arch/arm/mach-s3c24xx/mach-rx1950.c b/arch/arm/mach-s3c24xx/mach-rx1950.c
index 17fad4b..1ea1ce8 100644
--- a/arch/arm/mach-s3c24xx/mach-rx1950.c
+++ b/arch/arm/mach-s3c24xx/mach-rx1950.c
@@ -50,7 +50,6 @@
#include <linux/platform_data/fb-s3c2410.h>
#include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
#include <plat/clock.h>
#include <plat/cpu.h>
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2413.c b/arch/arm/mach-s3c24xx/mach-smdk2413.c
index d504272..9b473cb 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2413.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2413.c
@@ -35,7 +35,6 @@
//#include <asm/debug-ll.h>
#include <plat/regs-serial.h>
#include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
#include <linux/platform_data/usb-s3c2410_udc.h>
#include <linux/platform_data/i2c-s3c2410.h>
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2416.c b/arch/arm/mach-s3c24xx/mach-smdk2416.c
index cb46847..5630d51 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2416.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2416.c
@@ -36,7 +36,6 @@
#include <plat/regs-serial.h>
#include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
#include <mach/regs-s3c2443-clock.h>
#include <linux/platform_data/leds-s3c24xx.h>
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2440.c b/arch/arm/mach-s3c24xx/mach-smdk2440.c
index 8546941..040e39b 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2440.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2440.c
@@ -33,7 +33,6 @@
#include <plat/regs-serial.h>
#include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
#include <linux/platform_data/fb-s3c2410.h>
#include <linux/platform_data/i2c-s3c2410.h>
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2443.c b/arch/arm/mach-s3c24xx/mach-smdk2443.c
index 5baa2e2..99a5c34 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2443.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2443.c
@@ -33,7 +33,6 @@
#include <plat/regs-serial.h>
#include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
#include <linux/platform_data/fb-s3c2410.h>
#include <linux/platform_data/i2c-s3c2410.h>
diff --git a/arch/arm/mach-s3c24xx/mach-vstms.c b/arch/arm/mach-s3c24xx/mach-vstms.c
index 86c9199..92cd9ec 100644
--- a/arch/arm/mach-s3c24xx/mach-vstms.c
+++ b/arch/arm/mach-s3c24xx/mach-vstms.c
@@ -34,7 +34,6 @@
#include <plat/regs-serial.h>
#include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
#include <linux/platform_data/fb-s3c2410.h>
#include <linux/platform_data/i2c-s3c2410.h>
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index dc10dbe..12ac94e 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -34,7 +34,6 @@
#include <linux/platform_data/fb-s3c2410.h>
#include <asm/mach/map.h>
-#include <mach/regs-lcd.h>
#include <mach/regs-gpio.h>
#ifdef CONFIG_PM
diff --git a/include/linux/platform_data/fb-s3c2410.h b/include/linux/platform_data/fb-s3c2410.h
index dbebc62..8e04d49 100644
--- a/include/linux/platform_data/fb-s3c2410.h
+++ b/include/linux/platform_data/fb-s3c2410.h
@@ -12,6 +12,40 @@
#ifndef __FB_S3C2410_H
#define __FB_S3C2410_H __FILE__
+#define S3C2410_LCDCON1_DSCAN4 (0 << 5)
+#define S3C2410_LCDCON1_STN4 (1 << 5)
+#define S3C2410_LCDCON1_STN8 (2 << 5)
+#define S3C2410_LCDCON1_TFT (3 << 5)
+
+#define S3C2410_LCDCON1_STN1BPP (0 << 1)
+#define S3C2410_LCDCON1_STN2GREY (1 << 1)
+#define S3C2410_LCDCON1_STN4GREY (2 << 1)
+#define S3C2410_LCDCON1_STN8BPP (3 << 1)
+#define S3C2410_LCDCON1_STN12BPP (4 << 1)
+
+#define S3C2410_LCDCON1_TFT1BPP (8 << 1)
+#define S3C2410_LCDCON1_TFT2BPP (9 << 1)
+#define S3C2410_LCDCON1_TFT4BPP (10 << 1)
+#define S3C2410_LCDCON1_TFT8BPP (11 << 1)
+#define S3C2410_LCDCON1_TFT16BPP (12 << 1)
+#define S3C2410_LCDCON1_TFT24BPP (13 << 1)
+
+
+#define S3C2410_LCDCON5_BPP24BL (1 << 12)
+#define S3C2410_LCDCON5_FRM565 (1 << 11)
+#define S3C2410_LCDCON5_INVVCLK (1 << 10)
+#define S3C2410_LCDCON5_INVVLINE (1 << 9)
+#define S3C2410_LCDCON5_INVVFRAME (1 << 8)
+#define S3C2410_LCDCON5_INVVD (1 << 7)
+#define S3C2410_LCDCON5_INVVDEN (1 << 6)
+#define S3C2410_LCDCON5_INVPWREN (1 << 5)
+#define S3C2410_LCDCON5_INVLEND (1 << 4)
+#define S3C2410_LCDCON5_PWREN (1 << 3)
+#define S3C2410_LCDCON5_ENLEND (1 << 2)
+#define S3C2410_LCDCON5_BSWP (1 << 1)
+#define S3C2410_LCDCON5_HWSWP (1 << 0)
+
+
struct s3c2410fb_hw {
unsigned long lcdcon1;
unsigned long lcdcon2;
--
1.7.4.1
^ permalink raw reply related
* [PATCH 4/9] s3c2410fb: Register single platform driver
From: Sylwester Nawrocki @ 2013-04-26 20:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1367006543-5458-1-git-send-email-sylvester.nawrocki@gmail.com>
Use the id_table instead of registering two separate platform drivers.
This allows then to declare the driver with module_platform_driver().
Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
---
drivers/video/s3c2410fb.c | 59 +++++++++++---------------------------------
1 files changed, 15 insertions(+), 44 deletions(-)
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index 12ac94e..d6706f7 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -818,8 +818,7 @@ static inline void s3c2410fb_cpufreq_deregister(struct s3c2410fb_info *info)
static const char driver_name[] = "s3c2410fb";
-static int s3c24xxfb_probe(struct platform_device *pdev,
- enum s3c_drv_type drv_type)
+static int s3c2410fb_probe(struct platform_device *pdev)
{
struct s3c2410fb_info *info;
struct s3c2410fb_display *display;
@@ -861,7 +860,7 @@ static int s3c24xxfb_probe(struct platform_device *pdev,
info = fbinfo->par;
info->dev = &pdev->dev;
- info->drv_type = drv_type;
+ info->drv_type = platform_get_device_id(pdev)->driver_data;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res = NULL) {
@@ -885,7 +884,7 @@ static int s3c24xxfb_probe(struct platform_device *pdev,
goto release_mem;
}
- if (drv_type = DRV_S3C2412)
+ if (info->drv_type = DRV_S3C2412)
info->irq_base = info->io + S3C2412_LCDINTBASE;
else
info->irq_base = info->io + S3C2410_LCDINTBASE;
@@ -1009,17 +1008,6 @@ dealloc_fb:
return ret;
}
-static int s3c2410fb_probe(struct platform_device *pdev)
-{
- return s3c24xxfb_probe(pdev, DRV_S3C2410);
-}
-
-static int s3c2412fb_probe(struct platform_device *pdev)
-{
- return s3c24xxfb_probe(pdev, DRV_S3C2412);
-}
-
-
/*
* Cleanup
*/
@@ -1098,46 +1086,29 @@ static int s3c2410fb_resume(struct platform_device *dev)
#define s3c2410fb_resume NULL
#endif
-static struct platform_driver s3c2410fb_driver = {
- .probe = s3c2410fb_probe,
- .remove = s3c2410fb_remove,
- .suspend = s3c2410fb_suspend,
- .resume = s3c2410fb_resume,
- .driver = {
- .name = "s3c2410-lcd",
- .owner = THIS_MODULE,
+static struct platform_device_id s3c2410fb_driver_ids[] = {
+ {
+ .name = "s3c2410-lcd",
+ .driver_data = (unsigned long)DRV_S3C2410,
+ }, {
+ .name = "s3c2412-lcd",
+ .driver_data = (unsigned long)DRV_S3C2412,
},
};
-static struct platform_driver s3c2412fb_driver = {
- .probe = s3c2412fb_probe,
+static struct platform_driver s3c2410fb_driver = {
+ .probe = s3c2410fb_probe,
.remove = s3c2410fb_remove,
.suspend = s3c2410fb_suspend,
.resume = s3c2410fb_resume,
+ .id_table = s3c2410fb_driver_ids,
.driver = {
- .name = "s3c2412-lcd",
+ .name = "s3c2410-lcd",
.owner = THIS_MODULE,
},
};
-int __init s3c2410fb_init(void)
-{
- int ret = platform_driver_register(&s3c2410fb_driver);
-
- if (ret = 0)
- ret = platform_driver_register(&s3c2412fb_driver);
-
- return ret;
-}
-
-static void __exit s3c2410fb_cleanup(void)
-{
- platform_driver_unregister(&s3c2410fb_driver);
- platform_driver_unregister(&s3c2412fb_driver);
-}
-
-module_init(s3c2410fb_init);
-module_exit(s3c2410fb_cleanup);
+module_platform_driver(s3c2410fb_driver);
MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>");
MODULE_AUTHOR("Ben Dooks <ben-linux@fluff.org>");
--
1.7.4.1
^ permalink raw reply related
* [PATCH 5/9] s3c2410fb: Use dev_pm_ops
From: Sylwester Nawrocki @ 2013-04-26 20:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1367006543-5458-1-git-send-email-sylvester.nawrocki@gmail.com>
Use the driver PM ops rather than legacy suspend/resume callbacks.
Also use CONFIG_PM_SLEEP switch to compile in the system sleep
code instead of CONFIG_PM.
Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
---
drivers/video/s3c2410fb.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index d6706f7..479ab45 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -26,6 +26,7 @@
#include <linux/dma-mapping.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
+#include <linux/pm.h>
#include <linux/clk.h>
#include <linux/cpufreq.h>
#include <linux/io.h>
@@ -36,10 +37,6 @@
#include <asm/mach/map.h>
#include <mach/regs-gpio.h>
-#ifdef CONFIG_PM
-#include <linux/pm.h>
-#endif
-
#include "s3c2410fb.h"
/* Debugging stuff */
@@ -1044,8 +1041,7 @@ static int s3c2410fb_remove(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM
-
+#ifdef CONFIG_PM_SLEEP
/* suspend and resume support for the lcd controller */
static int s3c2410fb_suspend(struct platform_device *dev, pm_message_t state)
{
@@ -1081,9 +1077,14 @@ static int s3c2410fb_resume(struct platform_device *dev)
return 0;
}
+static const struct dev_pm_ops s3c2410fb_pm_ops = {
+ .resume = s3c2410fb_resume,
+ .suspend = s3c2410fb_suspend,
+};
+
+#define S3C2410FB_PM_OPS (&s3c2410fb_pm_ops)
#else
-#define s3c2410fb_suspend NULL
-#define s3c2410fb_resume NULL
+#define S3C2410FB_PM_OPS (NULL)
#endif
static struct platform_device_id s3c2410fb_driver_ids[] = {
@@ -1099,12 +1100,11 @@ static struct platform_device_id s3c2410fb_driver_ids[] = {
static struct platform_driver s3c2410fb_driver = {
.probe = s3c2410fb_probe,
.remove = s3c2410fb_remove,
- .suspend = s3c2410fb_suspend,
- .resume = s3c2410fb_resume,
.id_table = s3c2410fb_driver_ids,
.driver = {
.name = "s3c2410-lcd",
.owner = THIS_MODULE,
+ .pm = S3C2410FB_PM_OPS,
},
};
--
1.7.4.1
^ permalink raw reply related
* [PATCH 6/9] s3c2410fb: Enable display by default
From: Sylwester Nawrocki @ 2013-04-26 20:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1367006543-5458-1-git-send-email-sylvester.nawrocki@gmail.com>
Enable the display with default configuration at system start up.
This ensures the display is activated also when FRAMBUFFER_CONSOLE
is not set.
Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
---
drivers/video/s3c2410fb.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index 479ab45..da8b6c2 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -969,6 +969,8 @@ static int s3c2410fb_probe(struct platform_device *pdev)
goto free_video_memory;
}
+ s3c2410fb_set_par(fbinfo);
+
ret = register_framebuffer(fbinfo);
if (ret < 0) {
dev_err(&pdev->dev, "Failed to register framebuffer device: %d\n",
--
1.7.4.1
^ permalink raw reply related
* [PATCH 7/9] s3c2410fb: Use devm_ioremap_resource()
From: Sylwester Nawrocki @ 2013-04-26 20:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1367006543-5458-1-git-send-email-sylvester.nawrocki@gmail.com>
Use devm_ioremap_resource instead of reques_mem_region()/ioremap().
This ensures more consistent error values and simplifies error paths.
Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
---
drivers/video/s3c2410fb.c | 32 ++++----------------------------
1 files changed, 4 insertions(+), 28 deletions(-)
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index da8b6c2..11f98ca 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -825,7 +825,6 @@ static int s3c2410fb_probe(struct platform_device *pdev)
int ret;
int irq;
int i;
- int size;
u32 lcdcon1;
mach_info = pdev->dev.platform_data;
@@ -860,27 +859,12 @@ static int s3c2410fb_probe(struct platform_device *pdev)
info->drv_type = platform_get_device_id(pdev)->driver_data;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (res = NULL) {
- dev_err(&pdev->dev, "failed to get memory registers\n");
- ret = -ENXIO;
+ info->io = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(info->io)) {
+ ret = PTR_ERR(info->io);
goto dealloc_fb;
}
- size = resource_size(res);
- info->mem = request_mem_region(res->start, size, pdev->name);
- if (info->mem = NULL) {
- dev_err(&pdev->dev, "failed to get memory region\n");
- ret = -ENOENT;
- goto dealloc_fb;
- }
-
- info->io = ioremap(res->start, size);
- if (info->io = NULL) {
- dev_err(&pdev->dev, "ioremap() of registers failed\n");
- ret = -ENXIO;
- goto release_mem;
- }
-
if (info->drv_type = DRV_S3C2412)
info->irq_base = info->io + S3C2412_LCDINTBASE;
else
@@ -917,7 +901,7 @@ static int s3c2410fb_probe(struct platform_device *pdev)
if (ret) {
dev_err(&pdev->dev, "cannot get irq %d - err %d\n", irq, ret);
ret = -EBUSY;
- goto release_regs;
+ goto dealloc_fb;
}
info->clk = clk_get(NULL, "lcd");
@@ -997,10 +981,6 @@ release_clock:
clk_put(info->clk);
release_irq:
free_irq(irq, info);
-release_regs:
- iounmap(info->io);
-release_mem:
- release_mem_region(res->start, size);
dealloc_fb:
platform_set_drvdata(pdev, NULL);
framebuffer_release(fbinfo);
@@ -1033,10 +1013,6 @@ static int s3c2410fb_remove(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0);
free_irq(irq, info);
- iounmap(info->io);
-
- release_mem_region(info->mem->start, resource_size(info->mem));
-
platform_set_drvdata(pdev, NULL);
framebuffer_release(fbinfo);
--
1.7.4.1
^ permalink raw reply related
* [PATCH 8/9] s3c2410fb: Remove redundant platform_set_drvdata()
From: Sylwester Nawrocki @ 2013-04-26 20:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1367006543-5458-1-git-send-email-sylvester.nawrocki@gmail.com>
driver_data field is being cleared by the driver core since
commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
device-core: Ensure drvdata = NULL when no driver is bound
hence there is no need to do it in the driver's remove() callback.
Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
---
drivers/video/s3c2410fb.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index 11f98ca..0439ed0 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -1013,7 +1013,6 @@ static int s3c2410fb_remove(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0);
free_irq(irq, info);
- platform_set_drvdata(pdev, NULL);
framebuffer_release(fbinfo);
return 0;
--
1.7.4.1
^ permalink raw reply related
* [PATCH 9/9] s3c2410fb: Use module parameter instead of a sysfs entry
From: Sylwester Nawrocki @ 2013-04-26 20:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1367006543-5458-1-git-send-email-sylvester.nawrocki@gmail.com>
Use module parameter to set debug level instead of a sysfs
entry. Replace pr_debug() with pr_info() so we can actually
control the debug traces without DYNAMIC_PRINTK. This fixes
a sort of regression introduced in commit 81c1655811e941af2
video: s3c2410: Use pr_* and dev_* instead of printk
Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
---
drivers/video/s3c2410fb.c | 48 +++++++-------------------------------------
1 files changed, 8 insertions(+), 40 deletions(-)
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index 0439ed0..c2ee75a 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -46,10 +46,13 @@ static int debug = 1;
static int debug;
#endif
-#define dprintk(msg...) \
-do { \
- if (debug) \
- pr_debug(msg); \
+module_param(debug, int, 0644);
+MODULE_PARM_DESC(debug, "Debug level (0-1)");
+
+#define dprintk(msg...) \
+do { \
+ if (debug) \
+ pr_info(msg); \
} while (0)
/* useful functions */
@@ -584,36 +587,6 @@ static int s3c2410fb_blank(int blank_mode, struct fb_info *info)
return 0;
}
-static int s3c2410fb_debug_show(struct device *dev,
- struct device_attribute *attr, char *buf)
-{
- return snprintf(buf, PAGE_SIZE, "%s\n", debug ? "on" : "off");
-}
-
-static int s3c2410fb_debug_store(struct device *dev,
- struct device_attribute *attr,
- const char *buf, size_t len)
-{
- if (len < 1)
- return -EINVAL;
-
- if (strnicmp(buf, "on", 2) = 0 ||
- strnicmp(buf, "1", 1) = 0) {
- debug = 1;
- dev_dbg(dev, "s3c2410fb: Debug On");
- } else if (strnicmp(buf, "off", 3) = 0 ||
- strnicmp(buf, "0", 1) = 0) {
- debug = 0;
- dev_dbg(dev, "s3c2410fb: Debug Off");
- } else {
- return -EINVAL;
- }
-
- return len;
-}
-
-static DEVICE_ATTR(debug, 0666, s3c2410fb_debug_show, s3c2410fb_debug_store);
-
static struct fb_ops s3c2410fb_ops = {
.owner = THIS_MODULE,
.fb_check_var = s3c2410fb_check_var,
@@ -962,17 +935,12 @@ static int s3c2410fb_probe(struct platform_device *pdev)
goto free_cpufreq;
}
- /* create device files */
- ret = device_create_file(&pdev->dev, &dev_attr_debug);
- if (ret)
- dev_err(&pdev->dev, "failed to add debug attribute\n");
-
dev_info(&pdev->dev, "fb%d: %s frame buffer device\n",
fbinfo->node, fbinfo->fix.id);
return 0;
- free_cpufreq:
+free_cpufreq:
s3c2410fb_cpufreq_deregister(info);
free_video_memory:
s3c2410fb_unmap_video_memory(fbinfo);
--
1.7.4.1
^ permalink raw reply related
* Re: [PATCH v8 0/3] Runtime Interpreted Power Sequences
From: Alexandre Courbot @ 2013-04-27 15:36 UTC (permalink / raw)
To: Simon Glass
Cc: Alexandre Courbot, Anton Vorontsov, Stephen Warren,
Thierry Reding, Mark Zhang, Grant Likely, Rob Herring, Mark Brown,
David Woodhouse, Arnd Bergmann, Leela Krishna Amudala,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, lk,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Devicetree Discuss,
linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <CAPnjgZ1P6dmRB0sO2qBUtd=WBiNcY339NAit2faaotAfEqQDeQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Hi Simon,
On Sat, Apr 27, 2013 at 3:55 AM, Simon Glass <sjg@chromium.org> wrote:
> Hi,
>
> On Thu, Nov 15, 2012 at 10:38 PM, Alexandre Courbot <acourbot@nvidia.com> wrote:
>> Hopefully the final series before the feature gets merged. Anton Vorontsov
>> kindly accepted to take it into his tree, so this series is mostly a call for
>> acks, tests and reviews notices before the merge window for 3.8 opens. If you
>> are interested in seeing this feature, please add your name.
>>
>> This series also adds an entry for the subsystem into MAINTAINERS, setting me as
>> the person in charge.
>>
>> Changes from v7:
>> - fix bug reported by Tony Prisk
>> - add MAINTAINERS entry
>>
>> Alexandre Courbot (3):
>> Runtime Interpreted Power Sequences
>> pwm_backlight: use power sequences
>> Take maintainership of power sequences
>
> Did this actually land? I can't see it in linux-next.
It has not landed yet, and will not land in the form that I proposed
initially. There were some obvious issues with describing the
sequences in the device tree, and I decided to rethink the whole
thing, study the state of the art some more (especially ACPI) and
start again from a blank page.
The v2 idea is almost ready to be shared, but it needs a cleaner way
to manage GPIOs, which itself requires gpiolib to be refactored and
the GENERIC_GPIO option to be removed. These last two items will land
in 3.10, so I hope to have both the gpiod interface *and* the new
power seqs ready and approved for 3.11. Then my $@?*^! panel backlight
will maybe finally switch on (no kidding - that's really what this
whole thing is about).
The new power seqs will fundamentally work in a similar fashion to v1
(a simple bytecode that controls power-related items), but will not be
encoded through the DT. Instead, I'd like to have small power control
objects that can be referenced by the platform data of pseq-enabled
drivers, or fetched and associated to the driver through the
compatible property of the DT. These objects will have, as before,
power resources they need to request, and power methods that the
driver can call as needed.
I hate to give dates, but my wish is to come with a first version of
the code by the time the merge window closes. And yes, I still plan to
use Anton as a trojan horse to get this in. ;)
Thanks,
Alex.
^ permalink raw reply
* Re: [PATCH v5 2/2] video: imxfb: Add DT support
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-04-28 10:48 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1366810751-26860-3-git-send-email-mpa@pengutronix.de>
On 15:39 Wed 24 Apr , Markus Pargmann wrote:
> Add devicetree support for imx framebuffer driver. It uses the generic
> display bindings and helper functions.
>
> Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Best Regards,
J.
> ---
>
> Notes:
> Changed in v5:
> - Fix compatible property of the example
> - Rename property fsl,bpp to bits-per-pixel
> - Add selects for FB_MODE_HELPERS and VIDEOMODE_HELPERS to Kconfig FB_IMX
>
> Changes in v4:
> - Remove eukrea specific dmacr property.
> - Add optional dmacr property. If not present, the dmacr reset value is not
> changed.
>
> Changes in v3:
> - Fix returncodes of of_read_mode function and print error messages
> - Introduce a lower bound check for bits per pixel
> - Calculate correct bytes per pixel value before using it for the calculation of
> memory size
> - Change DT property names
>
> Changes in v2:
> - Removed pwmr register property
> - Cleanup of devicetree binding documentation
> - Use default values for pwmr and lscr1
>
> .../devicetree/bindings/video/fsl,imx-fb.txt | 51 ++++++
> drivers/video/Kconfig | 2 +
> drivers/video/imxfb.c | 194 +++++++++++++++++----
> 3 files changed, 212 insertions(+), 35 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/video/fsl,imx-fb.txt
>
> diff --git a/Documentation/devicetree/bindings/video/fsl,imx-fb.txt b/Documentation/devicetree/bindings/video/fsl,imx-fb.txt
> new file mode 100644
> index 0000000..46da08d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/video/fsl,imx-fb.txt
> @@ -0,0 +1,51 @@
> +Freescale imx21 Framebuffer
> +
> +This framebuffer driver supports devices imx1, imx21, imx25, and imx27.
> +
> +Required properties:
> +- compatible : "fsl,<chip>-fb", chip should be imx1 or imx21
> +- reg : Should contain 1 register ranges(address and length)
> +- interrupts : One interrupt of the fb dev
> +
> +Required nodes:
> +- display: Phandle to a display node as described in
> + Documentation/devicetree/bindings/video/display-timing.txt
> + Additional, the display node has to define properties:
> + - bits-per-pixel: Bits per pixel
> + - fsl,pcr: LCDC PCR value
> +
> +Optional properties:
> +- fsl,dmacr: DMA Control Register value. This is optional. By default, the
> + register is not modified as recommended by the datasheet.
> +- fsl,lscr1: LCDC Sharp Configuration Register value.
> +
> +Example:
> +
> + imxfb: fb@10021000 {
> + compatible = "fsl,imx21-fb";
> + interrupts = <61>;
> + reg = <0x10021000 0x1000>;
> + display = <&display0>;
> + };
> +
> + ...
> +
> + display0: display0 {
> + model = "Primeview-PD050VL1";
> + native-mode = <&timing_disp0>;
> + bits-per-pixel = <16>;
> + fsl,pcr = <0xf0c88080>; /* non-standard but required */
> + display-timings {
> + timing_disp0: 640x480 {
> + hactive = <640>;
> + vactive = <480>;
> + hback-porch = <112>;
> + hfront-porch = <36>;
> + hsync-len = <32>;
> + vback-porch = <33>;
> + vfront-porch = <33>;
> + vsync-len = <2>;
> + clock-frequency = <25000000>;
> + };
> + };
> + };
> diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
> index 4c1546f..44b1af4 100644
> --- a/drivers/video/Kconfig
> +++ b/drivers/video/Kconfig
> @@ -391,6 +391,8 @@ config FB_IMX
> select FB_CFB_FILLRECT
> select FB_CFB_COPYAREA
> select FB_CFB_IMAGEBLIT
> + select FB_MODE_HELPERS
> + select VIDEOMODE_HELPERS
>
> config FB_CYBER2000
> tristate "CyberPro 2000/2010/5000 support"
> diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
> index ef2b587..7bb3728 100644
> --- a/drivers/video/imxfb.c
> +++ b/drivers/video/imxfb.c
> @@ -32,6 +32,12 @@
> #include <linux/io.h>
> #include <linux/math64.h>
> #include <linux/uaccess.h>
> +#include <linux/of.h>
> +#include <linux/of_device.h>
> +
> +#include <video/of_display_timing.h>
> +#include <video/of_videomode.h>
> +#include <video/videomode.h>
>
> #include <linux/platform_data/video-imxfb.h>
>
> @@ -117,10 +123,11 @@
> #define LGWCR_GWAV(alpha) (((alpha) & 0xff) << 24)
> #define LGWCR_GWE (1 << 22)
>
> +#define IMXFB_LSCR1_DEFAULT 0x00120300
> +
> /* Used fb-mode. Can be set on kernel command line, therefore file-static. */
> static const char *fb_mode;
>
> -
> /*
> * These are the bitfields for each
> * display depth that we support.
> @@ -192,6 +199,19 @@ static struct platform_device_id imxfb_devtype[] = {
> };
> MODULE_DEVICE_TABLE(platform, imxfb_devtype);
>
> +static struct of_device_id imxfb_of_dev_id[] = {
> + {
> + .compatible = "fsl,imx1-fb",
> + .data = &imxfb_devtype[IMX1_FB],
> + }, {
> + .compatible = "fsl,imx21-fb",
> + .data = &imxfb_devtype[IMX21_FB],
> + }, {
> + /* sentinel */
> + }
> +};
> +MODULE_DEVICE_TABLE(of, imxfb_of_dev_id);
> +
> static inline int is_imx1_fb(struct imxfb_info *fbi)
> {
> return fbi->devtype = IMX1_FB;
> @@ -324,6 +344,9 @@ static const struct imx_fb_videomode *imxfb_find_mode(struct imxfb_info *fbi)
> struct imx_fb_videomode *m;
> int i;
>
> + if (!fb_mode)
> + return &fbi->mode[0];
> +
> for (i = 0, m = &fbi->mode[0]; i < fbi->num_modes; i++, m++) {
> if (!strcmp(m->mode.name, fb_mode))
> return m;
> @@ -479,6 +502,9 @@ static int imxfb_bl_update_status(struct backlight_device *bl)
> struct imxfb_info *fbi = bl_get_data(bl);
> int brightness = bl->props.brightness;
>
> + if (!fbi->pwmr)
> + return 0;
> +
> if (bl->props.power != FB_BLANK_UNBLANK)
> brightness = 0;
> if (bl->props.fb_blank != FB_BLANK_UNBLANK)
> @@ -719,10 +745,14 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
>
> writel(fbi->pcr, fbi->regs + LCDC_PCR);
> #ifndef PWMR_BACKLIGHT_AVAILABLE
> - writel(fbi->pwmr, fbi->regs + LCDC_PWMR);
> + if (fbi->pwmr)
> + writel(fbi->pwmr, fbi->regs + LCDC_PWMR);
> #endif
> writel(fbi->lscr1, fbi->regs + LCDC_LSCR1);
> - writel(fbi->dmacr, fbi->regs + LCDC_DMACR);
> +
> + /* dmacr = 0 is no valid value, as we need DMA control marks. */
> + if (fbi->dmacr)
> + writel(fbi->dmacr, fbi->regs + LCDC_DMACR);
>
> return 0;
> }
> @@ -758,13 +788,12 @@ static int imxfb_resume(struct platform_device *dev)
> #define imxfb_resume NULL
> #endif
>
> -static int __init imxfb_init_fbinfo(struct platform_device *pdev)
> +static int imxfb_init_fbinfo(struct platform_device *pdev)
> {
> struct imx_fb_platform_data *pdata = pdev->dev.platform_data;
> struct fb_info *info = dev_get_drvdata(&pdev->dev);
> struct imxfb_info *fbi = info->par;
> - struct imx_fb_videomode *m;
> - int i;
> + struct device_node *np;
>
> pr_debug("%s\n",__func__);
>
> @@ -795,41 +824,95 @@ static int __init imxfb_init_fbinfo(struct platform_device *pdev)
> info->fbops = &imxfb_ops;
> info->flags = FBINFO_FLAG_DEFAULT |
> FBINFO_READS_FAST;
> - info->var.grayscale = pdata->cmap_greyscale;
> - fbi->cmap_inverse = pdata->cmap_inverse;
> - fbi->cmap_static = pdata->cmap_static;
> - fbi->lscr1 = pdata->lscr1;
> - fbi->dmacr = pdata->dmacr;
> - fbi->pwmr = pdata->pwmr;
> - fbi->lcd_power = pdata->lcd_power;
> - fbi->backlight_power = pdata->backlight_power;
> -
> - for (i = 0, m = &pdata->mode[0]; i < pdata->num_modes; i++, m++)
> - info->fix.smem_len = max_t(size_t, info->fix.smem_len,
> - m->mode.xres * m->mode.yres * m->bpp / 8);
> + if (pdata) {
> + info->var.grayscale = pdata->cmap_greyscale;
> + fbi->cmap_inverse = pdata->cmap_inverse;
> + fbi->cmap_static = pdata->cmap_static;
> + fbi->lscr1 = pdata->lscr1;
> + fbi->dmacr = pdata->dmacr;
> + fbi->pwmr = pdata->pwmr;
> + fbi->lcd_power = pdata->lcd_power;
> + fbi->backlight_power = pdata->backlight_power;
> + } else {
> + np = pdev->dev.of_node;
> + info->var.grayscale = of_property_read_bool(np,
> + "cmap-greyscale");
> + fbi->cmap_inverse = of_property_read_bool(np, "cmap-inverse");
> + fbi->cmap_static = of_property_read_bool(np, "cmap-static");
> +
> + fbi->lscr1 = IMXFB_LSCR1_DEFAULT;
> + of_property_read_u32(np, "fsl,lscr1", &fbi->lscr1);
> +
> + of_property_read_u32(np, "fsl,dmacr", &fbi->dmacr);
> +
> + /* These two function pointers could be used by some specific
> + * platforms. */
> + fbi->lcd_power = NULL;
> + fbi->backlight_power = NULL;
> + }
> +
> + return 0;
> +}
> +
> +static int imxfb_of_read_mode(struct device *dev, struct device_node *np,
> + struct imx_fb_videomode *imxfb_mode)
> +{
> + int ret;
> + struct fb_videomode *of_mode = &imxfb_mode->mode;
> + u32 bpp;
> + u32 pcr;
> +
> + ret = of_property_read_string(np, "model", &of_mode->name);
> + if (ret)
> + of_mode->name = NULL;
> +
> + ret = of_get_fb_videomode(np, of_mode, OF_USE_NATIVE_MODE);
> + if (ret) {
> + dev_err(dev, "Failed to get videomode from DT\n");
> + return ret;
> + }
> +
> + ret = of_property_read_u32(np, "bits-per-pixel", &bpp);
> + ret |= of_property_read_u32(np, "fsl,pcr", &pcr);
> +
> + if (ret) {
> + dev_err(dev, "Failed to read bpp and pcr from DT\n");
> + return -EINVAL;
> + }
> +
> + if (bpp < 1 || bpp > 255) {
> + dev_err(dev, "Bits per pixel have to be between 1 and 255\n");
> + return -EINVAL;
> + }
> +
> + imxfb_mode->bpp = bpp;
> + imxfb_mode->pcr = pcr;
>
> return 0;
> }
>
> -static int __init imxfb_probe(struct platform_device *pdev)
> +static int imxfb_probe(struct platform_device *pdev)
> {
> struct imxfb_info *fbi;
> struct fb_info *info;
> struct imx_fb_platform_data *pdata;
> struct resource *res;
> + struct imx_fb_videomode *m;
> + const struct of_device_id *of_id;
> int ret, i;
> + int bytes_per_pixel;
>
> dev_info(&pdev->dev, "i.MX Framebuffer driver\n");
>
> + of_id = of_match_device(imxfb_of_dev_id, &pdev->dev);
> + if (of_id)
> + pdev->id_entry = of_id->data;
> +
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> if (!res)
> return -ENODEV;
>
> pdata = pdev->dev.platform_data;
> - if (!pdata) {
> - dev_err(&pdev->dev,"No platform_data available\n");
> - return -ENOMEM;
> - }
>
> info = framebuffer_alloc(sizeof(struct imxfb_info), &pdev->dev);
> if (!info)
> @@ -837,15 +920,55 @@ static int __init imxfb_probe(struct platform_device *pdev)
>
> fbi = info->par;
>
> - if (!fb_mode)
> - fb_mode = pdata->mode[0].mode.name;
> -
> platform_set_drvdata(pdev, info);
>
> ret = imxfb_init_fbinfo(pdev);
> if (ret < 0)
> goto failed_init;
>
> + if (pdata) {
> + if (!fb_mode)
> + fb_mode = pdata->mode[0].mode.name;
> +
> + fbi->mode = pdata->mode;
> + fbi->num_modes = pdata->num_modes;
> + } else {
> + struct device_node *display_np;
> + fb_mode = NULL;
> +
> + display_np = of_parse_phandle(pdev->dev.of_node, "display", 0);
> + if (!display_np) {
> + dev_err(&pdev->dev, "No display defined in devicetree\n");
> + ret = -EINVAL;
> + goto failed_of_parse;
> + }
> +
> + /*
> + * imxfb does not support more modes, we choose only the native
> + * mode.
> + */
> + fbi->num_modes = 1;
> +
> + fbi->mode = devm_kzalloc(&pdev->dev,
> + sizeof(struct imx_fb_videomode), GFP_KERNEL);
> + if (!fbi->mode) {
> + ret = -ENOMEM;
> + goto failed_of_parse;
> + }
> +
> + ret = imxfb_of_read_mode(&pdev->dev, display_np, fbi->mode);
> + if (ret)
> + goto failed_of_parse;
> + }
> +
> + /* Calculate maximum bytes used per pixel. In most cases this should
> + * be the same as m->bpp/8 */
> + m = &fbi->mode[0];
> + bytes_per_pixel = (m->bpp + 7) / 8;
> + for (i = 0; i < fbi->num_modes; i++, m++)
> + info->fix.smem_len = max_t(size_t, info->fix.smem_len,
> + m->mode.xres * m->mode.yres * bytes_per_pixel);
> +
> res = request_mem_region(res->start, resource_size(res),
> DRIVER_NAME);
> if (!res) {
> @@ -878,7 +1001,8 @@ static int __init imxfb_probe(struct platform_device *pdev)
> goto failed_ioremap;
> }
>
> - if (!pdata->fixed_screen_cpu) {
> + /* Seems not being used by anyone, so no support for oftree */
> + if (!pdata || !pdata->fixed_screen_cpu) {
> fbi->map_size = PAGE_ALIGN(info->fix.smem_len);
> fbi->map_cpu = dma_alloc_writecombine(&pdev->dev,
> fbi->map_size, &fbi->map_dma, GFP_KERNEL);
> @@ -903,18 +1027,16 @@ static int __init imxfb_probe(struct platform_device *pdev)
> info->fix.smem_start = fbi->screen_dma;
> }
>
> - if (pdata->init) {
> + if (pdata && pdata->init) {
> ret = pdata->init(fbi->pdev);
> if (ret)
> goto failed_platform_init;
> }
>
> - fbi->mode = pdata->mode;
> - fbi->num_modes = pdata->num_modes;
>
> INIT_LIST_HEAD(&info->modelist);
> - for (i = 0; i < pdata->num_modes; i++)
> - fb_add_videomode(&pdata->mode[i].mode, &info->modelist);
> + for (i = 0; i < fbi->num_modes; i++)
> + fb_add_videomode(&fbi->mode[i].mode, &info->modelist);
>
> /*
> * This makes sure that our colour bitfield
> @@ -944,10 +1066,10 @@ static int __init imxfb_probe(struct platform_device *pdev)
> failed_register:
> fb_dealloc_cmap(&info->cmap);
> failed_cmap:
> - if (pdata->exit)
> + if (pdata && pdata->exit)
> pdata->exit(fbi->pdev);
> failed_platform_init:
> - if (!pdata->fixed_screen_cpu)
> + if (pdata && !pdata->fixed_screen_cpu)
> dma_free_writecombine(&pdev->dev,fbi->map_size,fbi->map_cpu,
> fbi->map_dma);
> failed_map:
> @@ -956,6 +1078,7 @@ failed_ioremap:
> failed_getclock:
> release_mem_region(res->start, resource_size(res));
> failed_req:
> +failed_of_parse:
> kfree(info->pseudo_palette);
> failed_init:
> platform_set_drvdata(pdev, NULL);
> @@ -980,7 +1103,7 @@ static int imxfb_remove(struct platform_device *pdev)
> unregister_framebuffer(info);
>
> pdata = pdev->dev.platform_data;
> - if (pdata->exit)
> + if (pdata && pdata->exit)
> pdata->exit(fbi->pdev);
>
> fb_dealloc_cmap(&info->cmap);
> @@ -1009,6 +1132,7 @@ static struct platform_driver imxfb_driver = {
> .shutdown = imxfb_shutdown,
> .driver = {
> .name = DRIVER_NAME,
> + .of_match_table = imxfb_of_dev_id,
> },
> .id_table = imxfb_devtype,
> };
> --
> 1.8.1.5
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* [PATCH 00/10] OMAPDSS: Basic deferred probe support
From: Tomi Valkeinen @ 2013-04-29 10:22 UTC (permalink / raw)
To: linux-fbdev, linux-omap
Cc: Tony Lindgren, grygorii.strashko, chf.fritz, Archit Taneja,
Tomi Valkeinen
Hi,
omapdss, omapfb and the panel drivers do not currently support deferred probe,
which is causing the display drivers fail when booting with DT.
This series adds very basic support for deferred probing, which hopefully fixes
the issues for omap4 panda and sdp boards with the current kernel.
Limitations:
* Deferred probe support for omap_vout and omapdrm is still totally missing.
* If it so happens that at omapfb probe time one panel has been probed, but
another has been deferred, only the probed one will be used.
* Only DPI, DSI and HDMI outputs have been fixed.
* Some panel drivers may need modifications to support EPROBE_DEFER
Patches based on linux-next, i.e. the latest omapdss stuff.
Tomi
Tomi Valkeinen (10):
OMAPDSS: Makefile: move omapfb after panels
OMAPFB: use module_platform_driver()
OMAPFB: defer probe if no displays
OMAPDSS: DSI: use platform_driver_register()
OMAPDSS: DSI: Add error handling for dsi_probe_pdata
OMAPDSS: DPI: use platform_driver_register()
OMAPDSS: DPI: Add error handling for dpi_probe_pdata
OMAPDSS: HDMI: use platform_driver_register()
OMAPDSS: HDMI: Add error handling for hdmi_probe_pdata
OMAPDSS: TFP410: return EPROBE_DEFER if the i2c adapter not found
drivers/video/omap2/Makefile | 2 +-
drivers/video/omap2/displays/panel-tfp410.c | 2 +-
drivers/video/omap2/dss/dpi.c | 35 +++++++++++++++++----------
drivers/video/omap2/dss/dsi.c | 35 +++++++++++++++++----------
drivers/video/omap2/dss/hdmi.c | 33 ++++++++++++++++---------
drivers/video/omap2/omapfb/omapfb-main.c | 30 +++--------------------
6 files changed, 71 insertions(+), 66 deletions(-)
--
1.7.10.4
^ permalink raw reply
* [PATCH 01/10] OMAPDSS: Makefile: move omapfb after panels
From: Tomi Valkeinen @ 2013-04-29 10:22 UTC (permalink / raw)
To: linux-fbdev, linux-omap
Cc: Tony Lindgren, grygorii.strashko, chf.fritz, Archit Taneja,
Tomi Valkeinen
In-Reply-To: <1367230957-32337-1-git-send-email-tomi.valkeinen@ti.com>
omapfb requires the panels to have been probed before omapfb's probe. We
currently manage that by having omapfb in late initcall level. However,
a much simpler way is to just change the makefile so that omapfb is
after the panel drivers.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/omap2/Makefile b/drivers/video/omap2/Makefile
index 5ea7cb9..296e5c5 100644
--- a/drivers/video/omap2/Makefile
+++ b/drivers/video/omap2/Makefile
@@ -1,5 +1,5 @@
obj-$(CONFIG_OMAP2_VRFB) += vrfb.o
obj-$(CONFIG_OMAP2_DSS) += dss/
-obj-$(CONFIG_FB_OMAP2) += omapfb/
obj-y += displays/
+obj-$(CONFIG_FB_OMAP2) += omapfb/
--
1.7.10.4
^ permalink raw reply related
* [PATCH 02/10] OMAPFB: use module_platform_driver()
From: Tomi Valkeinen @ 2013-04-29 10:22 UTC (permalink / raw)
To: linux-fbdev, linux-omap
Cc: Tony Lindgren, grygorii.strashko, chf.fritz, Archit Taneja,
Tomi Valkeinen
In-Reply-To: <1367230957-32337-1-git-send-email-tomi.valkeinen@ti.com>
Instead of using platform_driver_probe(), use module_platform_driver()
so that we can support deferred probing.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/omapfb/omapfb-main.c | 28 +++-------------------------
1 file changed, 3 insertions(+), 25 deletions(-)
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index f38348e..808f6af 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -2422,7 +2422,7 @@ static int omapfb_init_connections(struct omapfb2_device *fbdev,
return 0;
}
-static int __init omapfb_probe(struct platform_device *pdev)
+static int omapfb_probe(struct platform_device *pdev)
{
struct omapfb2_device *fbdev = NULL;
int r = 0;
@@ -2595,6 +2595,7 @@ static int __exit omapfb_remove(struct platform_device *pdev)
}
static struct platform_driver omapfb_driver = {
+ .probe = omapfb_probe,
.remove = __exit_p(omapfb_remove),
.driver = {
.name = "omapfb",
@@ -2602,36 +2603,13 @@ static struct platform_driver omapfb_driver = {
},
};
-static int __init omapfb_init(void)
-{
- DBG("omapfb_init\n");
-
- if (platform_driver_probe(&omapfb_driver, omapfb_probe)) {
- printk(KERN_ERR "failed to register omapfb driver\n");
- return -ENODEV;
- }
-
- return 0;
-}
-
-static void __exit omapfb_exit(void)
-{
- DBG("omapfb_exit\n");
- platform_driver_unregister(&omapfb_driver);
-}
-
module_param_named(mode, def_mode, charp, 0);
module_param_named(vram, def_vram, charp, 0);
module_param_named(rotate, def_rotate, int, 0);
module_param_named(vrfb, def_vrfb, bool, 0);
module_param_named(mirror, def_mirror, bool, 0);
-/* late_initcall to let panel/ctrl drivers loaded first.
- * I guess better option would be a more dynamic approach,
- * so that omapfb reacts to new panels when they are loaded */
-late_initcall(omapfb_init);
-/*module_init(omapfb_init);*/
-module_exit(omapfb_exit);
+module_platform_driver(omapfb_driver);
MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@nokia.com>");
MODULE_DESCRIPTION("OMAP2/3 Framebuffer");
--
1.7.10.4
^ permalink raw reply related
* [PATCH 03/10] OMAPFB: defer probe if no displays
From: Tomi Valkeinen @ 2013-04-29 10:22 UTC (permalink / raw)
To: linux-fbdev, linux-omap
Cc: Tony Lindgren, grygorii.strashko, chf.fritz, Archit Taneja,
Tomi Valkeinen
In-Reply-To: <1367230957-32337-1-git-send-email-tomi.valkeinen@ti.com>
omapfb requires the panel drivers to have been probed when omapfb is
initialized. omapfb does not support insertion of new panels after its
probe. This causes a problem in case omapdss or the panel probes have
been deferred due to EPROBE_DEFER error, as omapfb won't find any
displays.
As a quick fix, this patch changes the omapfb probe so that if omapfb
does not find any displays, it'll return EPROBE_DEFER. This is not
perfect, as with a board with no displays, omapfb will get deferred
forever. Also, if the board has multiple displays, but only some of them
have been probed, omapfb will start and leave the unprobed displays out.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/omapfb/omapfb-main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 808f6af..ff00d1d 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -2484,7 +2484,7 @@ static int omapfb_probe(struct platform_device *pdev)
if (fbdev->num_displays = 0) {
dev_err(&pdev->dev, "no displays\n");
- r = -EINVAL;
+ r = -EPROBE_DEFER;
goto cleanup;
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH 04/10] OMAPDSS: DSI: use platform_driver_register()
From: Tomi Valkeinen @ 2013-04-29 10:22 UTC (permalink / raw)
To: linux-fbdev, linux-omap
Cc: Tony Lindgren, grygorii.strashko, chf.fritz, Archit Taneja,
Tomi Valkeinen
In-Reply-To: <1367230957-32337-1-git-send-email-tomi.valkeinen@ti.com>
Use platform_driver_register() instead of platform_driver_probe() so
that we can support EPROBE_DEFER.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/dsi.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 9b1c5ec..55fc0d4 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -5225,7 +5225,7 @@ static enum omap_channel dsi_get_channel(int module_id)
}
}
-static int __init dsi_init_display(struct omap_dss_device *dssdev)
+static int dsi_init_display(struct omap_dss_device *dssdev)
{
struct platform_device *dsidev dsi_get_dsidev_from_id(dssdev->phy.dsi.module);
@@ -5366,7 +5366,7 @@ static int dsi_get_clocks(struct platform_device *dsidev)
return 0;
}
-static struct omap_dss_device * __init dsi_find_dssdev(struct platform_device *pdev)
+static struct omap_dss_device *dsi_find_dssdev(struct platform_device *pdev)
{
struct omap_dss_board_info *pdata = pdev->dev.platform_data;
struct dsi_data *dsi = dsi_get_dsidrv_data(pdev);
@@ -5398,7 +5398,7 @@ static struct omap_dss_device * __init dsi_find_dssdev(struct platform_device *p
return def_dssdev;
}
-static void __init dsi_probe_pdata(struct platform_device *dsidev)
+static void dsi_probe_pdata(struct platform_device *dsidev)
{
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
struct omap_dss_device *plat_dssdev;
@@ -5436,11 +5436,13 @@ static void __init dsi_probe_pdata(struct platform_device *dsidev)
DSSERR("device %s register failed: %d\n", dssdev->name, r);
omapdss_output_unset_device(&dsi->output);
dss_put_device(dssdev);
- return;
+ return r;
}
+
+ return 0;
}
-static void __init dsi_init_output(struct platform_device *dsidev)
+static void dsi_init_output(struct platform_device *dsidev)
{
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
struct omap_dss_output *out = &dsi->output;
@@ -5465,7 +5467,7 @@ static void __exit dsi_uninit_output(struct platform_device *dsidev)
}
/* DSI1 HW IP initialisation */
-static int __init omap_dsihw_probe(struct platform_device *dsidev)
+static int omap_dsihw_probe(struct platform_device *dsidev)
{
u32 rev;
int r, i;
@@ -5632,6 +5634,7 @@ static const struct dev_pm_ops dsi_pm_ops = {
};
static struct platform_driver omap_dsihw_driver = {
+ .probe = omap_dsihw_probe,
.remove = __exit_p(omap_dsihw_remove),
.driver = {
.name = "omapdss_dsi",
@@ -5642,7 +5645,7 @@ static struct platform_driver omap_dsihw_driver = {
int __init dsi_init_platform_driver(void)
{
- return platform_driver_probe(&omap_dsihw_driver, omap_dsihw_probe);
+ return platform_driver_register(&omap_dsihw_driver);
}
void __exit dsi_uninit_platform_driver(void)
--
1.7.10.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox