* Re: [PATCH 3/4] [resend #2] fb_ddc: Allow I2C adapters without SCL read capability
From: Tomi Valkeinen @ 2015-09-02 11:33 UTC (permalink / raw)
To: Ondrej Zary, Krzysztof Helt; +Cc: linux-fbdev, Kernel development list
In-Reply-To: <1440445048-24694-3-git-send-email-linux@rainbow-software.org>
[-- Attachment #1: Type: text/plain, Size: 1512 bytes --]
On 24/08/15 22:37, Ondrej Zary wrote:
> i2c-algo-bit allows I2C adapters without SCL read capability to work but
> fb_ddc_read fails to work on them.
>
> Fix fb_ddc_read to work with I2C adapters not capable of reading SCL.
>
> Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
> Acked-by: Krzysztof Helt <krzysztof.h1@wp.pl>
> ---
> drivers/video/fbdev/core/fb_ddc.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/video/fbdev/core/fb_ddc.c b/drivers/video/fbdev/core/fb_ddc.c
> index 94322cc..22c694a 100644
> --- a/drivers/video/fbdev/core/fb_ddc.c
> +++ b/drivers/video/fbdev/core/fb_ddc.c
> @@ -69,10 +69,11 @@ unsigned char *fb_ddc_read(struct i2c_adapter *adapter)
> algo_data->setscl(algo_data->data, 1);
> for (j = 0; j < 5; j++) {
> msleep(10);
> - if (algo_data->getscl(algo_data->data))
> + if (algo_data->getscl &&
> + algo_data->getscl(algo_data->data))
> break;
> }
> - if (j == 5)
> + if (algo_data->getscl && j == 5)
> continue;
>
> algo_data->setsda(algo_data->data, 0);
> @@ -91,7 +92,8 @@ unsigned char *fb_ddc_read(struct i2c_adapter *adapter)
> algo_data->setscl(algo_data->data, 1);
> for (j = 0; j < 10; j++) {
> msleep(10);
> - if (algo_data->getscl(algo_data->data))
> + if (algo_data->getscl &&
> + algo_data->getscl(algo_data->data))
> break;
> }
Aren't both of those loops pointless if there's no getscl?
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 4/4] [resend #2] tridentfb: Add DDC support
From: Tomi Valkeinen @ 2015-09-02 11:30 UTC (permalink / raw)
To: Ondrej Zary, Krzysztof Helt; +Cc: linux-fbdev, Kernel development list
In-Reply-To: <1440445048-24694-4-git-send-email-linux@rainbow-software.org>
[-- Attachment #1: Type: text/plain, Size: 1089 bytes --]
Hi,
On 24/08/15 22:37, Ondrej Zary wrote:
> Add DDC support for Trident cards.
>
> Tested on TGUI9440, TGUI9680, 3DImage 9750, Blade3D 9880 and Blade XP.
>
> Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
> ---
> drivers/video/fbdev/Kconfig | 9 ++
> drivers/video/fbdev/tridentfb.c | 192 ++++++++++++++++++++++++++++++++++++++-
> 2 files changed, 196 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
> index 2d98de5..e2531b8 100644
> --- a/drivers/video/fbdev/Kconfig
> +++ b/drivers/video/fbdev/Kconfig
> @@ -1680,6 +1680,15 @@ config FB_TRIDENT
> To compile this driver as a module, choose M here: the
> module will be called tridentfb.
>
> +config FB_TRIDENT_DDC
> + bool "DDC for Trident support"
> + depends on FB_TRIDENT
> + select FB_DDC
> + select FB_MODE_HELPERS
> + default y
> + help
> + Say Y here if you want DDC support for your Trident graphics card.
> +
Why would somebody not want this enabled? Is there some drawback if it's
enabled?
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH] video: fbdev: atmel_lcdfb: remove useless include
From: Tomi Valkeinen @ 2015-09-02 11:25 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1439217114-12317-1-git-send-email-alexandre.belloni@free-electrons.com>
[-- Attachment #1: Type: text/plain, Size: 799 bytes --]
On 10/08/15 17:31, Alexandre Belloni wrote:
> Definitions from linux/platform_data/atmel.h are not used, remove the
> include.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
> drivers/video/fbdev/atmel_lcdfb.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c
> index abadc490fa1f..a5006788647c 100644
> --- a/drivers/video/fbdev/atmel_lcdfb.c
> +++ b/drivers/video/fbdev/atmel_lcdfb.c
> @@ -19,7 +19,6 @@
> #include <linux/backlight.h>
> #include <linux/gfp.h>
> #include <linux/module.h>
> -#include <linux/platform_data/atmel.h>
> #include <linux/of.h>
> #include <linux/of_device.h>
> #include <linux/of_gpio.h>
Thanks, queued for 4.3.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 4/4] fbdev: Debug knob to register without holding console_lock
From: Daniel Vetter @ 2015-09-01 15:31 UTC (permalink / raw)
To: Rob Clark
Cc: Linux Fbdev development list, Daniel Vetter,
Intel Graphics Development, DRI Development, Tomi Valkeinen,
Jean-Christophe Plagniol-Villard
In-Reply-To: <CAF6AEGva6hg9Nkn7kk8msB3WXOAVNB4C+akh-u-QHkZU9sT6zQ@mail.gmail.com>
On Tue, Sep 01, 2015 at 11:12:11AM -0400, Rob Clark wrote:
> On Tue, Sep 1, 2015 at 10:41 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> >
> >
> > On 01/09/15 17:34, Rob Clark wrote:
> >> On Tue, Sep 1, 2015 at 6:32 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> >>>
> >>>
> >>> On 25/08/15 22:24, Rob Clark wrote:
> >>>> On Tue, Aug 25, 2015 at 9:45 AM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> >>>>> When the usual fbcon legacy options are enabled we have
> >>>>> ->register_framebuffer
> >>>>> ->fb notifier chain calls into fbcon
> >>>>> ->fbcon sets up console on new fbi
> >>>>> ->fbi->set_par
> >>>>> ->drm_fb_helper_set_par exercises full kms api
> >>>>>
> >>>>> And because of locking inversion hilarity all of register_framebuffer
> >>>>> is done with the console lock held. Which means that the first time on
> >>>>> driver load we exercise _all_ the kms code (all probe paths and
> >>>>> modeset paths for everything connected) is under the console lock.
> >>>>> That means if anything goes belly-up in that big pile of code nothing
> >>>>> ever reaches logfiles (and the machine is dead).
> >>>>>
> >>>>> Usual tactic to debug that is to temporarily remove those console_lock
> >>>>> calls to be able to capture backtraces. I'm fed up writing this patch
> >>>>> and recompiling kernels. Hence this patch here to add an unsafe,
> >>>>> kernel-taining option to do this at runtime.
> >>>>>
> >>>>> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
> >>>>> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> >>>>> Cc: linux-fbdev@vger.kernel.org
> >>>>> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> >>>>
> >>>> This one was causing me some problems, if I tried to enable
> >>>> lockless_register_fb. It *looks* like it should work, so I'm not
> >>>> quite sure what the deal is. But I'm 110% fan of getting something
> >>>> like this working, because console_lock is pretty much the bane of kms
> >>>> developer's existence..
> >>>>
> >>>> I'll have to debug further on a system where I can see more than the
> >>>> bottom three lines of the second to last backtrace..
> >>>
> >>> Any idea if anyone has ever looked at properly fixing this?
> >>
> >> I hadn't had a chance to look at it further yet.. I think Daniel
> >> claimed it worked for him, but he was probably on intel-next, where I
> >> was on drm-next at the time which seemed to be having some unrelated
> >> i915 issues (when I was trying to debug atomic fb-helper patches). So
> >> can't really say that the issue I had was actually related to this
> >> patch. I'll try again later this week or next, when hopefully i915 in
> >> drm-next is in better shape..
> >
> > Oh, I didn't mean this patch, but the whole console lock in general.
> > I've also banged my head to a wall because of it =).
>
> oh, not sure.. every time I've started looking closer at
> console/console_lock I run away screaming.. I guess if it were
> possible to push the lock down further so only drivers that needed the
> lock (presumably serial/net/etc) could take it, that would be nice..
> but not sure I am that brave..
console_lock is pretty much unfixable without rewriting half of fbdev.
Which I don't expect to ever happen. For the curious look at all the
commits changing locking in fbdev over the past few years.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply
* Re: [PATCH 4/4] fbdev: Debug knob to register without holding console_lock
From: Rob Clark @ 2015-09-01 15:12 UTC (permalink / raw)
To: Tomi Valkeinen
Cc: Daniel Vetter, Intel Graphics Development,
Jean-Christophe Plagniol-Villard, Linux Fbdev development list,
DRI Development
In-Reply-To: <55E5B92C.7000202@ti.com>
On Tue, Sep 1, 2015 at 10:41 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>
>
> On 01/09/15 17:34, Rob Clark wrote:
>> On Tue, Sep 1, 2015 at 6:32 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>>>
>>>
>>> On 25/08/15 22:24, Rob Clark wrote:
>>>> On Tue, Aug 25, 2015 at 9:45 AM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>>>>> When the usual fbcon legacy options are enabled we have
>>>>> ->register_framebuffer
>>>>> ->fb notifier chain calls into fbcon
>>>>> ->fbcon sets up console on new fbi
>>>>> ->fbi->set_par
>>>>> ->drm_fb_helper_set_par exercises full kms api
>>>>>
>>>>> And because of locking inversion hilarity all of register_framebuffer
>>>>> is done with the console lock held. Which means that the first time on
>>>>> driver load we exercise _all_ the kms code (all probe paths and
>>>>> modeset paths for everything connected) is under the console lock.
>>>>> That means if anything goes belly-up in that big pile of code nothing
>>>>> ever reaches logfiles (and the machine is dead).
>>>>>
>>>>> Usual tactic to debug that is to temporarily remove those console_lock
>>>>> calls to be able to capture backtraces. I'm fed up writing this patch
>>>>> and recompiling kernels. Hence this patch here to add an unsafe,
>>>>> kernel-taining option to do this at runtime.
>>>>>
>>>>> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
>>>>> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
>>>>> Cc: linux-fbdev@vger.kernel.org
>>>>> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>>>>
>>>> This one was causing me some problems, if I tried to enable
>>>> lockless_register_fb. It *looks* like it should work, so I'm not
>>>> quite sure what the deal is. But I'm 110% fan of getting something
>>>> like this working, because console_lock is pretty much the bane of kms
>>>> developer's existence..
>>>>
>>>> I'll have to debug further on a system where I can see more than the
>>>> bottom three lines of the second to last backtrace..
>>>
>>> Any idea if anyone has ever looked at properly fixing this?
>>
>> I hadn't had a chance to look at it further yet.. I think Daniel
>> claimed it worked for him, but he was probably on intel-next, where I
>> was on drm-next at the time which seemed to be having some unrelated
>> i915 issues (when I was trying to debug atomic fb-helper patches). So
>> can't really say that the issue I had was actually related to this
>> patch. I'll try again later this week or next, when hopefully i915 in
>> drm-next is in better shape..
>
> Oh, I didn't mean this patch, but the whole console lock in general.
> I've also banged my head to a wall because of it =).
oh, not sure.. every time I've started looking closer at
console/console_lock I run away screaming.. I guess if it were
possible to push the lock down further so only drivers that needed the
lock (presumably serial/net/etc) could take it, that would be nice..
but not sure I am that brave..
BR,
-R
> Tomi
>
^ permalink raw reply
* Re: [PATCH 4/4] fbdev: Debug knob to register without holding console_lock
From: Tomi Valkeinen @ 2015-09-01 14:41 UTC (permalink / raw)
To: Rob Clark
Cc: Daniel Vetter, Intel Graphics Development,
Jean-Christophe Plagniol-Villard, Linux Fbdev development list,
DRI Development
In-Reply-To: <CAF6AEGtV1-tgvA0D-BFZ8NMNyNN7C8-jst5xXBKrQHGFVWCpyA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2587 bytes --]
On 01/09/15 17:34, Rob Clark wrote:
> On Tue, Sep 1, 2015 at 6:32 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>>
>>
>> On 25/08/15 22:24, Rob Clark wrote:
>>> On Tue, Aug 25, 2015 at 9:45 AM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>>>> When the usual fbcon legacy options are enabled we have
>>>> ->register_framebuffer
>>>> ->fb notifier chain calls into fbcon
>>>> ->fbcon sets up console on new fbi
>>>> ->fbi->set_par
>>>> ->drm_fb_helper_set_par exercises full kms api
>>>>
>>>> And because of locking inversion hilarity all of register_framebuffer
>>>> is done with the console lock held. Which means that the first time on
>>>> driver load we exercise _all_ the kms code (all probe paths and
>>>> modeset paths for everything connected) is under the console lock.
>>>> That means if anything goes belly-up in that big pile of code nothing
>>>> ever reaches logfiles (and the machine is dead).
>>>>
>>>> Usual tactic to debug that is to temporarily remove those console_lock
>>>> calls to be able to capture backtraces. I'm fed up writing this patch
>>>> and recompiling kernels. Hence this patch here to add an unsafe,
>>>> kernel-taining option to do this at runtime.
>>>>
>>>> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
>>>> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
>>>> Cc: linux-fbdev@vger.kernel.org
>>>> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>>>
>>> This one was causing me some problems, if I tried to enable
>>> lockless_register_fb. It *looks* like it should work, so I'm not
>>> quite sure what the deal is. But I'm 110% fan of getting something
>>> like this working, because console_lock is pretty much the bane of kms
>>> developer's existence..
>>>
>>> I'll have to debug further on a system where I can see more than the
>>> bottom three lines of the second to last backtrace..
>>
>> Any idea if anyone has ever looked at properly fixing this?
>
> I hadn't had a chance to look at it further yet.. I think Daniel
> claimed it worked for him, but he was probably on intel-next, where I
> was on drm-next at the time which seemed to be having some unrelated
> i915 issues (when I was trying to debug atomic fb-helper patches). So
> can't really say that the issue I had was actually related to this
> patch. I'll try again later this week or next, when hopefully i915 in
> drm-next is in better shape..
Oh, I didn't mean this patch, but the whole console lock in general.
I've also banged my head to a wall because of it =).
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 4/4] fbdev: Debug knob to register without holding console_lock
From: Rob Clark @ 2015-09-01 14:34 UTC (permalink / raw)
To: Tomi Valkeinen
Cc: Daniel Vetter, Intel Graphics Development,
Jean-Christophe Plagniol-Villard, Linux Fbdev development list,
DRI Development
In-Reply-To: <55E57ED1.5060109@ti.com>
On Tue, Sep 1, 2015 at 6:32 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>
>
> On 25/08/15 22:24, Rob Clark wrote:
>> On Tue, Aug 25, 2015 at 9:45 AM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>>> When the usual fbcon legacy options are enabled we have
>>> ->register_framebuffer
>>> ->fb notifier chain calls into fbcon
>>> ->fbcon sets up console on new fbi
>>> ->fbi->set_par
>>> ->drm_fb_helper_set_par exercises full kms api
>>>
>>> And because of locking inversion hilarity all of register_framebuffer
>>> is done with the console lock held. Which means that the first time on
>>> driver load we exercise _all_ the kms code (all probe paths and
>>> modeset paths for everything connected) is under the console lock.
>>> That means if anything goes belly-up in that big pile of code nothing
>>> ever reaches logfiles (and the machine is dead).
>>>
>>> Usual tactic to debug that is to temporarily remove those console_lock
>>> calls to be able to capture backtraces. I'm fed up writing this patch
>>> and recompiling kernels. Hence this patch here to add an unsafe,
>>> kernel-taining option to do this at runtime.
>>>
>>> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
>>> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
>>> Cc: linux-fbdev@vger.kernel.org
>>> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>>
>> This one was causing me some problems, if I tried to enable
>> lockless_register_fb. It *looks* like it should work, so I'm not
>> quite sure what the deal is. But I'm 110% fan of getting something
>> like this working, because console_lock is pretty much the bane of kms
>> developer's existence..
>>
>> I'll have to debug further on a system where I can see more than the
>> bottom three lines of the second to last backtrace..
>
> Any idea if anyone has ever looked at properly fixing this?
I hadn't had a chance to look at it further yet.. I think Daniel
claimed it worked for him, but he was probably on intel-next, where I
was on drm-next at the time which seemed to be having some unrelated
i915 issues (when I was trying to debug atomic fb-helper patches). So
can't really say that the issue I had was actually related to this
patch. I'll try again later this week or next, when hopefully i915 in
drm-next is in better shape..
BR,
-R
> Tomi
>
^ permalink raw reply
* Re: [PATCH v2 1/3] staging: sm7xxfb: move sm712fb out of staging
From: Sudip Mukherjee @ 2015-09-01 13:55 UTC (permalink / raw)
To: Tomi Valkeinen
Cc: Jean-Christophe Plagniol-Villard, Jonathan Corbet,
Greg Kroah-Hartman, linux-kernel, linux-fbdev, linux-doc, devel
In-Reply-To: <55E5A7BC.8060003@ti.com>
On Tue, Sep 01, 2015 at 04:27:24PM +0300, Tomi Valkeinen wrote:
>
>
> On 18/07/15 07:08, Sudip Mukherjee wrote:
> > Now since all cleanups are done and the code is ready to be merged lets
> > move it out of staging into fbdev location.
>
> Have you considered writing a DRM driver for this? I'm not happy at all
> adding new fbdev drivers, as the DRM framework is much better,
> supported, and continuously improved. With fbdev you end up with things
> like module parameters used to define video modes etc, which is just ugly.
Yes, I am working on a DRM driver, but since these are all voluntary
work it is taking time. And Greg has already merged it.
>
> Anyway, some comments below.
Some replies inline and remaining I will fix and send patches to you.
>
<snip>
> > +
> > +extern void __iomem *smtc_regbaseaddress;
>
> Uh, what is that?
I guess all of us missed seeing it. :(
As you said in another comments smtc_regbaseaddress will be included in
the per-device data and this will be removed.
>
<snip>
> > +static inline unsigned int smtc_seqr(int reg)
> > +{
> > + smtc_mmiowb(reg, 0x3c4);
> > + return smtc_mmiorb(0x3c5);
> > +}
>
> There's quite a lot of magic numbers there, and the same continues
> through the driver. You should use defines to assign symbolic names for
> most of the numbers.
will do.
>
<snip>
> > +
> > +void __iomem *smtc_regbaseaddress; /* Memory Map IO starting address */
>
> You can't have globals like this in the driver, they must be inside the
> per-device data. Just think what happens if someone has two of these
> devices.
will do.
>
<snip>
> > +
> > +static struct fb_fix_screeninfo smtcfb_fix = {
> > + .id = "smXXXfb",
> > + .type = FB_TYPE_PACKED_PIXELS,
> > + .visual = FB_VISUAL_TRUECOLOR,
> > + .line_length = 800 * 3,
> > + .accel = FB_ACCEL_SMI_LYNX,
> > + .type_aux = 0,
> > + .xpanstep = 0,
> > + .ypanstep = 0,
> > + .ywrapstep = 0,
> > +};
>
> These should be const.
ok.
>
<snip>
> > +static const struct vesa_mode vesa_mode_table[] = {
> > + {"0x301", 640, 480, 8},
> > + {"0x303", 800, 600, 8},
> > + {"0x305", 1024, 768, 8},
> > + {"0x307", 1280, 1024, 8},
> > +
> > + {"0x311", 640, 480, 16},
> > + {"0x314", 800, 600, 16},
> > + {"0x317", 1024, 768, 16},
> > + {"0x31A", 1280, 1024, 16},
> > +
> > + {"0x312", 640, 480, 24},
> > + {"0x315", 800, 600, 24},
> > + {"0x318", 1024, 768, 24},
> > + {"0x31B", 1280, 1024, 24},
> > +};
>
> We have "vesa_modes" in include/linux/fb.h. What is the above table for?
The resolutions that are supported along with the kernel boot parameter
to point to the resolution to boot with.
>
> > +
> > +/**********************************************************************
> > + SM712 Mode table.
> > + **********************************************************************/
> > +static const struct modeinit vgamode[] = {
> > + {
<snip>
> > + { /* Init_CR90_CRA7 */
> > + 0x55, 0xD9, 0x5D, 0xE1, 0x86, 0x1B, 0x8E, 0x26,
> > + 0xDA, 0x8D, 0xDE, 0x94, 0x00, 0x00, 0x18, 0x00,
> > + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x03,
> > + },
> > + },
> > +};
>
> What are these tables above for?
Different register settings based on the display resolution. Do you want
me to do anything with these vgamode table and the vesa_mode_table?
regards
sudip
^ permalink raw reply
* Re: [PATCH v2 1/3] staging: sm7xxfb: move sm712fb out of staging
From: Tomi Valkeinen @ 2015-09-01 13:27 UTC (permalink / raw)
To: Sudip Mukherjee
Cc: Jean-Christophe Plagniol-Villard, Jonathan Corbet,
Greg Kroah-Hartman, linux-kernel, linux-fbdev, linux-doc, devel
In-Reply-To: <1437192539-14150-1-git-send-email-sudipm.mukherjee@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 32589 bytes --]
On 18/07/15 07:08, Sudip Mukherjee wrote:
> Now since all cleanups are done and the code is ready to be merged lets
> move it out of staging into fbdev location.
Have you considered writing a DRM driver for this? I'm not happy at all
adding new fbdev drivers, as the DRM framework is much better,
supported, and continuously improved. With fbdev you end up with things
like module parameters used to define video modes etc, which is just ugly.
Anyway, some comments below.
> diff --git a/drivers/video/fbdev/sm712.h b/drivers/video/fbdev/sm712.h
> new file mode 100644
> index 0000000..aad1cc4
> --- /dev/null
> +++ b/drivers/video/fbdev/sm712.h
> @@ -0,0 +1,116 @@
> +/*
> + * Silicon Motion SM712 frame buffer device
> + *
> + * Copyright (C) 2006 Silicon Motion Technology Corp.
> + * Authors: Ge Wang, gewang@siliconmotion.com
> + * Boyod boyod.yang@siliconmotion.com.cn
> + *
> + * Copyright (C) 2009 Lemote, Inc.
> + * Author: Wu Zhangjin, wuzhangjin@gmail.com
> + *
> + * 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.
> + */
> +
> +#define FB_ACCEL_SMI_LYNX 88
> +
> +#define SCREEN_X_RES 1024
> +#define SCREEN_Y_RES 600
> +#define SCREEN_BPP 16
> +
> +/*Assume SM712 graphics chip has 4MB VRAM */
> +#define SM712_VIDEOMEMORYSIZE 0x00400000
> +/*Assume SM722 graphics chip has 8MB VRAM */
> +#define SM722_VIDEOMEMORYSIZE 0x00800000
> +
> +#define dac_reg (0x3c8)
> +#define dac_val (0x3c9)
> +
> +extern void __iomem *smtc_regbaseaddress;
Uh, what is that?
> +#define smtc_mmiowb(dat, reg) writeb(dat, smtc_regbaseaddress + reg)
> +
> +#define smtc_mmiorb(reg) readb(smtc_regbaseaddress + reg)
> +
> +#define SIZE_SR00_SR04 (0x04 - 0x00 + 1)
> +#define SIZE_SR10_SR24 (0x24 - 0x10 + 1)
> +#define SIZE_SR30_SR75 (0x75 - 0x30 + 1)
> +#define SIZE_SR80_SR93 (0x93 - 0x80 + 1)
> +#define SIZE_SRA0_SRAF (0xAF - 0xA0 + 1)
> +#define SIZE_GR00_GR08 (0x08 - 0x00 + 1)
> +#define SIZE_AR00_AR14 (0x14 - 0x00 + 1)
> +#define SIZE_CR00_CR18 (0x18 - 0x00 + 1)
> +#define SIZE_CR30_CR4D (0x4D - 0x30 + 1)
> +#define SIZE_CR90_CRA7 (0xA7 - 0x90 + 1)
> +
> +static inline void smtc_crtcw(int reg, int val)
> +{
> + smtc_mmiowb(reg, 0x3d4);
> + smtc_mmiowb(val, 0x3d5);
> +}
> +
> +static inline void smtc_grphw(int reg, int val)
> +{
> + smtc_mmiowb(reg, 0x3ce);
> + smtc_mmiowb(val, 0x3cf);
> +}
> +
> +static inline void smtc_attrw(int reg, int val)
> +{
> + smtc_mmiorb(0x3da);
> + smtc_mmiowb(reg, 0x3c0);
> + smtc_mmiorb(0x3c1);
> + smtc_mmiowb(val, 0x3c0);
> +}
> +
> +static inline void smtc_seqw(int reg, int val)
> +{
> + smtc_mmiowb(reg, 0x3c4);
> + smtc_mmiowb(val, 0x3c5);
> +}
> +
> +static inline unsigned int smtc_seqr(int reg)
> +{
> + smtc_mmiowb(reg, 0x3c4);
> + return smtc_mmiorb(0x3c5);
> +}
There's quite a lot of magic numbers there, and the same continues
through the driver. You should use defines to assign symbolic names for
most of the numbers.
> +
> +/* The next structure holds all information relevant for a specific video mode.
> + */
> +
> +struct modeinit {
> + int mmsizex;
> + int mmsizey;
> + int bpp;
> + int hz;
> + unsigned char init_misc;
> + unsigned char init_sr00_sr04[SIZE_SR00_SR04];
> + unsigned char init_sr10_sr24[SIZE_SR10_SR24];
> + unsigned char init_sr30_sr75[SIZE_SR30_SR75];
> + unsigned char init_sr80_sr93[SIZE_SR80_SR93];
> + unsigned char init_sra0_sraf[SIZE_SRA0_SRAF];
> + unsigned char init_gr00_gr08[SIZE_GR00_GR08];
> + unsigned char init_ar00_ar14[SIZE_AR00_AR14];
> + unsigned char init_cr00_cr18[SIZE_CR00_CR18];
> + unsigned char init_cr30_cr4d[SIZE_CR30_CR4D];
> + unsigned char init_cr90_cra7[SIZE_CR90_CRA7];
> +};
> +
> +#ifdef __BIG_ENDIAN
> +#define pal_rgb(r, g, b, val) (((r & 0xf800) >> 8) | \
> + ((g & 0xe000) >> 13) | \
> + ((g & 0x1c00) << 3) | \
> + ((b & 0xf800) >> 3))
> +#define big_addr 0x800000
> +#define mmio_addr 0x00800000
> +#define seqw17() smtc_seqw(0x17, 0x30)
> +#define big_pixel_depth(p, d) {if (p == 24) {p = 32; d = 32; } }
> +#define big_swap(p) ((p & 0xff00ff00 >> 8) | (p & 0x00ff00ff << 8))
> +#else
> +#define pal_rgb(r, g, b, val) val
> +#define big_addr 0
> +#define mmio_addr 0x00c00000
> +#define seqw17() do { } while (0)
> +#define big_pixel_depth(p, d) do { } while (0)
> +#define big_swap(p) p
> +#endif
> diff --git a/drivers/video/fbdev/sm712fb.c b/drivers/video/fbdev/sm712fb.c
> new file mode 100644
> index 0000000..629bfa2
> --- /dev/null
> +++ b/drivers/video/fbdev/sm712fb.c
> @@ -0,0 +1,1653 @@
> +/*
> + * Silicon Motion SM7XX frame buffer device
> + *
> + * Copyright (C) 2006 Silicon Motion Technology Corp.
> + * Authors: Ge Wang, gewang@siliconmotion.com
> + * Boyod boyod.yang@siliconmotion.com.cn
> + *
> + * Copyright (C) 2009 Lemote, Inc.
> + * Author: Wu Zhangjin, wuzhangjin@gmail.com
> + *
> + * Copyright (C) 2011 Igalia, S.L.
> + * Author: Javier M. Mellid <jmunhoz@igalia.com>
> + *
> + * 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.
> + *
> + * Framebuffer driver for Silicon Motion SM710, SM712, SM721 and SM722 chips
> + */
> +
> +#include <linux/io.h>
> +#include <linux/fb.h>
> +#include <linux/pci.h>
> +#include <linux/init.h>
> +#include <linux/slab.h>
> +#include <linux/uaccess.h>
> +#include <linux/module.h>
> +#include <linux/console.h>
> +#include <linux/screen_info.h>
> +
> +#ifdef CONFIG_PM
> +#include <linux/pm.h>
> +#endif
> +
> +#include "sm712.h"
> +
> +/*
> +* Private structure
> +*/
> +struct smtcfb_info {
> + struct pci_dev *pdev;
> + struct fb_info *fb;
> + u16 chip_id;
> + u8 chip_rev_id;
> +
> + void __iomem *lfb; /* linear frame buffer */
> + void __iomem *dp_regs; /* drawing processor control regs */
> + void __iomem *vp_regs; /* video processor control regs */
> + void __iomem *cp_regs; /* capture processor control regs */
> + void __iomem *mmio; /* memory map IO port */
> +
> + u_int width;
> + u_int height;
> + u_int hz;
> +
> + u32 colreg[17];
> +};
> +
> +void __iomem *smtc_regbaseaddress; /* Memory Map IO starting address */
You can't have globals like this in the driver, they must be inside the
per-device data. Just think what happens if someone has two of these
devices.
> +
> +static struct fb_var_screeninfo smtcfb_var = {
> + .xres = 1024,
> + .yres = 600,
> + .xres_virtual = 1024,
> + .yres_virtual = 600,
> + .bits_per_pixel = 16,
> + .red = {16, 8, 0},
> + .green = {8, 8, 0},
> + .blue = {0, 8, 0},
> + .activate = FB_ACTIVATE_NOW,
> + .height = -1,
> + .width = -1,
> + .vmode = FB_VMODE_NONINTERLACED,
> + .nonstd = 0,
> + .accel_flags = FB_ACCELF_TEXT,
> +};
> +
> +static struct fb_fix_screeninfo smtcfb_fix = {
> + .id = "smXXXfb",
> + .type = FB_TYPE_PACKED_PIXELS,
> + .visual = FB_VISUAL_TRUECOLOR,
> + .line_length = 800 * 3,
> + .accel = FB_ACCEL_SMI_LYNX,
> + .type_aux = 0,
> + .xpanstep = 0,
> + .ypanstep = 0,
> + .ywrapstep = 0,
> +};
These should be const.
> +
> +struct vesa_mode {
> + char index[6];
> + u16 lfb_width;
> + u16 lfb_height;
> + u16 lfb_depth;
> +};
> +
> +static const struct vesa_mode vesa_mode_table[] = {
> + {"0x301", 640, 480, 8},
> + {"0x303", 800, 600, 8},
> + {"0x305", 1024, 768, 8},
> + {"0x307", 1280, 1024, 8},
> +
> + {"0x311", 640, 480, 16},
> + {"0x314", 800, 600, 16},
> + {"0x317", 1024, 768, 16},
> + {"0x31A", 1280, 1024, 16},
> +
> + {"0x312", 640, 480, 24},
> + {"0x315", 800, 600, 24},
> + {"0x318", 1024, 768, 24},
> + {"0x31B", 1280, 1024, 24},
> +};
We have "vesa_modes" in include/linux/fb.h. What is the above table for?
> +
> +/**********************************************************************
> + SM712 Mode table.
> + **********************************************************************/
> +static const struct modeinit vgamode[] = {
> + {
> + /* mode#0: 640 x 480 16Bpp 60Hz */
> + 640, 480, 16, 60,
> + /* Init_MISC */
> + 0xE3,
> + { /* Init_SR0_SR4 */
> + 0x03, 0x01, 0x0F, 0x00, 0x0E,
> + },
> + { /* Init_SR10_SR24 */
> + 0xFF, 0xBE, 0xEF, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
> + 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0xC4, 0x30, 0x02, 0x01, 0x01,
> + },
> + { /* Init_SR30_SR75 */
> + 0x32, 0x03, 0xA0, 0x09, 0xC0, 0x32, 0x32, 0x32,
> + 0x32, 0x32, 0x32, 0x32, 0x00, 0x00, 0x03, 0xFF,
> + 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
> + 0x20, 0x0C, 0x44, 0x20, 0x00, 0x32, 0x32, 0x32,
> + 0x04, 0x24, 0x63, 0x4F, 0x52, 0x0B, 0xDF, 0xEA,
> + 0x04, 0x50, 0x19, 0x32, 0x32, 0x00, 0x00, 0x32,
> + 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
> + 0x50, 0x03, 0x74, 0x14, 0x07, 0x82, 0x07, 0x04,
> + 0x00, 0x45, 0x30, 0x30, 0x40, 0x30,
> + },
> + { /* Init_SR80_SR93 */
> + 0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x32,
> + 0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x32, 0x32,
> + 0x00, 0x00, 0x00, 0x00,
> + },
> + { /* Init_SRA0_SRAF */
> + 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
> + 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xFF, 0xDF,
> + },
> + { /* Init_GR00_GR08 */
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
> + 0xFF,
> + },
> + { /* Init_AR00_AR14 */
> + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
> + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
> + 0x41, 0x00, 0x0F, 0x00, 0x00,
> + },
> + { /* Init_CR00_CR18 */
> + 0x5F, 0x4F, 0x4F, 0x00, 0x53, 0x1F, 0x0B, 0x3E,
> + 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0xEA, 0x0C, 0xDF, 0x50, 0x40, 0xDF, 0x00, 0xE3,
> + 0xFF,
> + },
> + { /* Init_CR30_CR4D */
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x03, 0x20,
> + 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xFF, 0xFD,
> + 0x5F, 0x4F, 0x00, 0x54, 0x00, 0x0B, 0xDF, 0x00,
> + 0xEA, 0x0C, 0x2E, 0x00, 0x4F, 0xDF,
> + },
> + { /* Init_CR90_CRA7 */
> + 0x56, 0xDD, 0x5E, 0xEA, 0x87, 0x44, 0x8F, 0x55,
> + 0x0A, 0x8F, 0x55, 0x0A, 0x00, 0x00, 0x18, 0x00,
> + 0x11, 0x10, 0x0B, 0x0A, 0x0A, 0x0A, 0x0A, 0x00,
> + },
> + },
> + {
> + /* mode#1: 640 x 480 24Bpp 60Hz */
> + 640, 480, 24, 60,
> + /* Init_MISC */
> + 0xE3,
> + { /* Init_SR0_SR4 */
> + 0x03, 0x01, 0x0F, 0x00, 0x0E,
> + },
> + { /* Init_SR10_SR24 */
> + 0xFF, 0xBE, 0xEF, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
> + 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0xC4, 0x30, 0x02, 0x01, 0x01,
> + },
> + { /* Init_SR30_SR75 */
> + 0x32, 0x03, 0xA0, 0x09, 0xC0, 0x32, 0x32, 0x32,
> + 0x32, 0x32, 0x32, 0x32, 0x00, 0x00, 0x03, 0xFF,
> + 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
> + 0x20, 0x0C, 0x44, 0x20, 0x00, 0x32, 0x32, 0x32,
> + 0x04, 0x24, 0x63, 0x4F, 0x52, 0x0B, 0xDF, 0xEA,
> + 0x04, 0x50, 0x19, 0x32, 0x32, 0x00, 0x00, 0x32,
> + 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
> + 0x50, 0x03, 0x74, 0x14, 0x07, 0x82, 0x07, 0x04,
> + 0x00, 0x45, 0x30, 0x30, 0x40, 0x30,
> + },
> + { /* Init_SR80_SR93 */
> + 0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x32,
> + 0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x32, 0x32,
> + 0x00, 0x00, 0x00, 0x00,
> + },
> + { /* Init_SRA0_SRAF */
> + 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
> + 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xFF, 0xDF,
> + },
> + { /* Init_GR00_GR08 */
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
> + 0xFF,
> + },
> + { /* Init_AR00_AR14 */
> + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
> + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
> + 0x41, 0x00, 0x0F, 0x00, 0x00,
> + },
> + { /* Init_CR00_CR18 */
> + 0x5F, 0x4F, 0x4F, 0x00, 0x53, 0x1F, 0x0B, 0x3E,
> + 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0xEA, 0x0C, 0xDF, 0x50, 0x40, 0xDF, 0x00, 0xE3,
> + 0xFF,
> + },
> + { /* Init_CR30_CR4D */
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x03, 0x20,
> + 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xFF, 0xFD,
> + 0x5F, 0x4F, 0x00, 0x54, 0x00, 0x0B, 0xDF, 0x00,
> + 0xEA, 0x0C, 0x2E, 0x00, 0x4F, 0xDF,
> + },
> + { /* Init_CR90_CRA7 */
> + 0x56, 0xDD, 0x5E, 0xEA, 0x87, 0x44, 0x8F, 0x55,
> + 0x0A, 0x8F, 0x55, 0x0A, 0x00, 0x00, 0x18, 0x00,
> + 0x11, 0x10, 0x0B, 0x0A, 0x0A, 0x0A, 0x0A, 0x00,
> + },
> + },
> + {
> + /* mode#0: 640 x 480 32Bpp 60Hz */
> + 640, 480, 32, 60,
> + /* Init_MISC */
> + 0xE3,
> + { /* Init_SR0_SR4 */
> + 0x03, 0x01, 0x0F, 0x00, 0x0E,
> + },
> + { /* Init_SR10_SR24 */
> + 0xFF, 0xBE, 0xEF, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
> + 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0xC4, 0x30, 0x02, 0x01, 0x01,
> + },
> + { /* Init_SR30_SR75 */
> + 0x32, 0x03, 0xA0, 0x09, 0xC0, 0x32, 0x32, 0x32,
> + 0x32, 0x32, 0x32, 0x32, 0x00, 0x00, 0x03, 0xFF,
> + 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
> + 0x20, 0x0C, 0x44, 0x20, 0x00, 0x32, 0x32, 0x32,
> + 0x04, 0x24, 0x63, 0x4F, 0x52, 0x0B, 0xDF, 0xEA,
> + 0x04, 0x50, 0x19, 0x32, 0x32, 0x00, 0x00, 0x32,
> + 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
> + 0x50, 0x03, 0x74, 0x14, 0x07, 0x82, 0x07, 0x04,
> + 0x00, 0x45, 0x30, 0x30, 0x40, 0x30,
> + },
> + { /* Init_SR80_SR93 */
> + 0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x32,
> + 0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x32, 0x32,
> + 0x00, 0x00, 0x00, 0x00,
> + },
> + { /* Init_SRA0_SRAF */
> + 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
> + 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xFF, 0xDF,
> + },
> + { /* Init_GR00_GR08 */
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
> + 0xFF,
> + },
> + { /* Init_AR00_AR14 */
> + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
> + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
> + 0x41, 0x00, 0x0F, 0x00, 0x00,
> + },
> + { /* Init_CR00_CR18 */
> + 0x5F, 0x4F, 0x4F, 0x00, 0x53, 0x1F, 0x0B, 0x3E,
> + 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0xEA, 0x0C, 0xDF, 0x50, 0x40, 0xDF, 0x00, 0xE3,
> + 0xFF,
> + },
> + { /* Init_CR30_CR4D */
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x03, 0x20,
> + 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xFF, 0xFD,
> + 0x5F, 0x4F, 0x00, 0x54, 0x00, 0x0B, 0xDF, 0x00,
> + 0xEA, 0x0C, 0x2E, 0x00, 0x4F, 0xDF,
> + },
> + { /* Init_CR90_CRA7 */
> + 0x56, 0xDD, 0x5E, 0xEA, 0x87, 0x44, 0x8F, 0x55,
> + 0x0A, 0x8F, 0x55, 0x0A, 0x00, 0x00, 0x18, 0x00,
> + 0x11, 0x10, 0x0B, 0x0A, 0x0A, 0x0A, 0x0A, 0x00,
> + },
> + },
> +
> + { /* mode#2: 800 x 600 16Bpp 60Hz */
> + 800, 600, 16, 60,
> + /* Init_MISC */
> + 0x2B,
> + { /* Init_SR0_SR4 */
> + 0x03, 0x01, 0x0F, 0x03, 0x0E,
> + },
> + { /* Init_SR10_SR24 */
> + 0xFF, 0xBE, 0xEE, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
> + 0x99, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0xC4, 0x30, 0x02, 0x01, 0x01,
> + },
> + { /* Init_SR30_SR75 */
> + 0x34, 0x03, 0x20, 0x09, 0xC0, 0x24, 0x24, 0x24,
> + 0x24, 0x24, 0x24, 0x24, 0x00, 0x00, 0x03, 0xFF,
> + 0x00, 0xFC, 0x00, 0x00, 0x20, 0x38, 0x00, 0xFC,
> + 0x20, 0x0C, 0x44, 0x20, 0x00, 0x24, 0x24, 0x24,
> + 0x04, 0x48, 0x83, 0x63, 0x68, 0x72, 0x57, 0x58,
> + 0x04, 0x55, 0x59, 0x24, 0x24, 0x00, 0x00, 0x24,
> + 0x01, 0x80, 0x7A, 0x1A, 0x1A, 0x00, 0x00, 0x00,
> + 0x50, 0x03, 0x74, 0x14, 0x1C, 0x85, 0x35, 0x13,
> + 0x02, 0x45, 0x30, 0x35, 0x40, 0x20,
> + },
> + { /* Init_SR80_SR93 */
> + 0x00, 0x00, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x24,
> + 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x24, 0x24,
> + 0x00, 0x00, 0x00, 0x00,
> + },
> + { /* Init_SRA0_SRAF */
> + 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
> + 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xBF, 0xDF,
> + },
> + { /* Init_GR00_GR08 */
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
> + 0xFF,
> + },
> + { /* Init_AR00_AR14 */
> + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
> + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
> + 0x41, 0x00, 0x0F, 0x00, 0x00,
> + },
> + { /* Init_CR00_CR18 */
> + 0x7F, 0x63, 0x63, 0x00, 0x68, 0x18, 0x72, 0xF0,
> + 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x58, 0x0C, 0x57, 0x64, 0x40, 0x57, 0x00, 0xE3,
> + 0xFF,
> + },
> + { /* Init_CR30_CR4D */
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x03, 0x20,
> + 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xBF, 0xFD,
> + 0x7F, 0x63, 0x00, 0x69, 0x18, 0x72, 0x57, 0x00,
> + 0x58, 0x0C, 0xE0, 0x20, 0x63, 0x57,
> + },
> + { /* Init_CR90_CRA7 */
> + 0x56, 0x4B, 0x5E, 0x55, 0x86, 0x9D, 0x8E, 0xAA,
> + 0xDB, 0x2A, 0xDF, 0x33, 0x00, 0x00, 0x18, 0x00,
> + 0x20, 0x1F, 0x1A, 0x19, 0x0F, 0x0F, 0x0F, 0x00,
> + },
> + },
> + { /* mode#3: 800 x 600 24Bpp 60Hz */
> + 800, 600, 24, 60,
> + 0x2B,
> + { /* Init_SR0_SR4 */
> + 0x03, 0x01, 0x0F, 0x03, 0x0E,
> + },
> + { /* Init_SR10_SR24 */
> + 0xFF, 0xBE, 0xEE, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
> + 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0xC4, 0x30, 0x02, 0x01, 0x01,
> + },
> + { /* Init_SR30_SR75 */
> + 0x36, 0x03, 0x20, 0x09, 0xC0, 0x36, 0x36, 0x36,
> + 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x03, 0xFF,
> + 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
> + 0x20, 0x0C, 0x44, 0x20, 0x00, 0x36, 0x36, 0x36,
> + 0x04, 0x48, 0x83, 0x63, 0x68, 0x72, 0x57, 0x58,
> + 0x04, 0x55, 0x59, 0x36, 0x36, 0x00, 0x00, 0x36,
> + 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
> + 0x50, 0x03, 0x74, 0x14, 0x1C, 0x85, 0x35, 0x13,
> + 0x02, 0x45, 0x30, 0x30, 0x40, 0x20,
> + },
> + { /* Init_SR80_SR93 */
> + 0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x36,
> + 0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x36, 0x36,
> + 0x00, 0x00, 0x00, 0x00,
> + },
> + { /* Init_SRA0_SRAF */
> + 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
> + 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xBF, 0xDF,
> + },
> + { /* Init_GR00_GR08 */
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
> + 0xFF,
> + },
> + { /* Init_AR00_AR14 */
> + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
> + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
> + 0x41, 0x00, 0x0F, 0x00, 0x00,
> + },
> + { /* Init_CR00_CR18 */
> + 0x7F, 0x63, 0x63, 0x00, 0x68, 0x18, 0x72, 0xF0,
> + 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x58, 0x0C, 0x57, 0x64, 0x40, 0x57, 0x00, 0xE3,
> + 0xFF,
> + },
> + { /* Init_CR30_CR4D */
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x03, 0x20,
> + 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xBF, 0xFD,
> + 0x7F, 0x63, 0x00, 0x69, 0x18, 0x72, 0x57, 0x00,
> + 0x58, 0x0C, 0xE0, 0x20, 0x63, 0x57,
> + },
> + { /* Init_CR90_CRA7 */
> + 0x56, 0x4B, 0x5E, 0x55, 0x86, 0x9D, 0x8E, 0xAA,
> + 0xDB, 0x2A, 0xDF, 0x33, 0x00, 0x00, 0x18, 0x00,
> + 0x20, 0x1F, 0x1A, 0x19, 0x0F, 0x0F, 0x0F, 0x00,
> + },
> + },
> + { /* mode#7: 800 x 600 32Bpp 60Hz */
> + 800, 600, 32, 60,
> + /* Init_MISC */
> + 0x2B,
> + { /* Init_SR0_SR4 */
> + 0x03, 0x01, 0x0F, 0x03, 0x0E,
> + },
> + { /* Init_SR10_SR24 */
> + 0xFF, 0xBE, 0xEE, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
> + 0x99, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0xC4, 0x30, 0x02, 0x01, 0x01,
> + },
> + { /* Init_SR30_SR75 */
> + 0x34, 0x03, 0x20, 0x09, 0xC0, 0x24, 0x24, 0x24,
> + 0x24, 0x24, 0x24, 0x24, 0x00, 0x00, 0x03, 0xFF,
> + 0x00, 0xFC, 0x00, 0x00, 0x20, 0x38, 0x00, 0xFC,
> + 0x20, 0x0C, 0x44, 0x20, 0x00, 0x24, 0x24, 0x24,
> + 0x04, 0x48, 0x83, 0x63, 0x68, 0x72, 0x57, 0x58,
> + 0x04, 0x55, 0x59, 0x24, 0x24, 0x00, 0x00, 0x24,
> + 0x01, 0x80, 0x7A, 0x1A, 0x1A, 0x00, 0x00, 0x00,
> + 0x50, 0x03, 0x74, 0x14, 0x1C, 0x85, 0x35, 0x13,
> + 0x02, 0x45, 0x30, 0x35, 0x40, 0x20,
> + },
> + { /* Init_SR80_SR93 */
> + 0x00, 0x00, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x24,
> + 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x24, 0x24,
> + 0x00, 0x00, 0x00, 0x00,
> + },
> + { /* Init_SRA0_SRAF */
> + 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
> + 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xBF, 0xDF,
> + },
> + { /* Init_GR00_GR08 */
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
> + 0xFF,
> + },
> + { /* Init_AR00_AR14 */
> + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
> + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
> + 0x41, 0x00, 0x0F, 0x00, 0x00,
> + },
> + { /* Init_CR00_CR18 */
> + 0x7F, 0x63, 0x63, 0x00, 0x68, 0x18, 0x72, 0xF0,
> + 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x58, 0x0C, 0x57, 0x64, 0x40, 0x57, 0x00, 0xE3,
> + 0xFF,
> + },
> + { /* Init_CR30_CR4D */
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x03, 0x20,
> + 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xBF, 0xFD,
> + 0x7F, 0x63, 0x00, 0x69, 0x18, 0x72, 0x57, 0x00,
> + 0x58, 0x0C, 0xE0, 0x20, 0x63, 0x57,
> + },
> + { /* Init_CR90_CRA7 */
> + 0x56, 0x4B, 0x5E, 0x55, 0x86, 0x9D, 0x8E, 0xAA,
> + 0xDB, 0x2A, 0xDF, 0x33, 0x00, 0x00, 0x18, 0x00,
> + 0x20, 0x1F, 0x1A, 0x19, 0x0F, 0x0F, 0x0F, 0x00,
> + },
> + },
> + /* We use 1024x768 table to light 1024x600 panel for lemote */
> + { /* mode#4: 1024 x 600 16Bpp 60Hz */
> + 1024, 600, 16, 60,
> + /* Init_MISC */
> + 0xEB,
> + { /* Init_SR0_SR4 */
> + 0x03, 0x01, 0x0F, 0x00, 0x0E,
> + },
> + { /* Init_SR10_SR24 */
> + 0xC8, 0x40, 0x14, 0x60, 0x00, 0x0A, 0x17, 0x20,
> + 0x51, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0xC4, 0x30, 0x02, 0x00, 0x01,
> + },
> + { /* Init_SR30_SR75 */
> + 0x22, 0x03, 0x24, 0x09, 0xC0, 0x22, 0x22, 0x22,
> + 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0x03, 0xFF,
> + 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
> + 0x20, 0x0C, 0x44, 0x20, 0x00, 0x22, 0x22, 0x22,
> + 0x06, 0x68, 0xA7, 0x7F, 0x83, 0x24, 0xFF, 0x03,
> + 0x00, 0x60, 0x59, 0x22, 0x22, 0x00, 0x00, 0x22,
> + 0x01, 0x80, 0x7A, 0x1A, 0x1A, 0x00, 0x00, 0x00,
> + 0x50, 0x03, 0x16, 0x02, 0x0D, 0x82, 0x09, 0x02,
> + 0x04, 0x45, 0x3F, 0x30, 0x40, 0x20,
> + },
> + { /* Init_SR80_SR93 */
> + 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x3A,
> + 0xF7, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3A, 0x3A,
> + 0x00, 0x00, 0x00, 0x00,
> + },
> + { /* Init_SRA0_SRAF */
> + 0x00, 0xFB, 0x9F, 0x01, 0x00, 0xED, 0xED, 0xED,
> + 0x7B, 0xFB, 0xFF, 0xFF, 0x97, 0xEF, 0xBF, 0xDF,
> + },
> + { /* Init_GR00_GR08 */
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
> + 0xFF,
> + },
> + { /* Init_AR00_AR14 */
> + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
> + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
> + 0x41, 0x00, 0x0F, 0x00, 0x00,
> + },
> + { /* Init_CR00_CR18 */
> + 0xA3, 0x7F, 0x7F, 0x00, 0x85, 0x16, 0x24, 0xF5,
> + 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x03, 0x09, 0xFF, 0x80, 0x40, 0xFF, 0x00, 0xE3,
> + 0xFF,
> + },
> + { /* Init_CR30_CR4D */
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x20,
> + 0x00, 0x00, 0x00, 0x40, 0x00, 0xFF, 0xBF, 0xFF,
> + 0xA3, 0x7F, 0x00, 0x82, 0x0b, 0x6f, 0x57, 0x00,
> + 0x5c, 0x0f, 0xE0, 0xe0, 0x7F, 0x57,
> + },
> + { /* Init_CR90_CRA7 */
> + 0x55, 0xD9, 0x5D, 0xE1, 0x86, 0x1B, 0x8E, 0x26,
> + 0xDA, 0x8D, 0xDE, 0x94, 0x00, 0x00, 0x18, 0x00,
> + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x03,
> + },
> + },
> + { /* mode#5: 1024 x 768 24Bpp 60Hz */
> + 1024, 768, 24, 60,
> + /* Init_MISC */
> + 0xEB,
> + { /* Init_SR0_SR4 */
> + 0x03, 0x01, 0x0F, 0x03, 0x0E,
> + },
> + { /* Init_SR10_SR24 */
> + 0xF3, 0xB6, 0xC0, 0xDD, 0x00, 0x0E, 0x17, 0x2C,
> + 0x99, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0xC4, 0x30, 0x02, 0x01, 0x01,
> + },
> + { /* Init_SR30_SR75 */
> + 0x38, 0x03, 0x20, 0x09, 0xC0, 0x3A, 0x3A, 0x3A,
> + 0x3A, 0x3A, 0x3A, 0x3A, 0x00, 0x00, 0x03, 0xFF,
> + 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
> + 0x20, 0x0C, 0x44, 0x20, 0x00, 0x00, 0x00, 0x3A,
> + 0x06, 0x68, 0xA7, 0x7F, 0x83, 0x24, 0xFF, 0x03,
> + 0x00, 0x60, 0x59, 0x3A, 0x3A, 0x00, 0x00, 0x3A,
> + 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
> + 0x50, 0x03, 0x74, 0x14, 0x3B, 0x0D, 0x09, 0x02,
> + 0x04, 0x45, 0x30, 0x30, 0x40, 0x20,
> + },
> + { /* Init_SR80_SR93 */
> + 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x3A,
> + 0xF7, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3A, 0x3A,
> + 0x00, 0x00, 0x00, 0x00,
> + },
> + { /* Init_SRA0_SRAF */
> + 0x00, 0xFB, 0x9F, 0x01, 0x00, 0xED, 0xED, 0xED,
> + 0x7B, 0xFB, 0xFF, 0xFF, 0x97, 0xEF, 0xBF, 0xDF,
> + },
> + { /* Init_GR00_GR08 */
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
> + 0xFF,
> + },
> + { /* Init_AR00_AR14 */
> + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
> + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
> + 0x41, 0x00, 0x0F, 0x00, 0x00,
> + },
> + { /* Init_CR00_CR18 */
> + 0xA3, 0x7F, 0x7F, 0x00, 0x85, 0x16, 0x24, 0xF5,
> + 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x03, 0x09, 0xFF, 0x80, 0x40, 0xFF, 0x00, 0xE3,
> + 0xFF,
> + },
> + { /* Init_CR30_CR4D */
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x20,
> + 0x00, 0x00, 0x00, 0x40, 0x00, 0xFF, 0xBF, 0xFF,
> + 0xA3, 0x7F, 0x00, 0x86, 0x15, 0x24, 0xFF, 0x00,
> + 0x01, 0x07, 0xE5, 0x20, 0x7F, 0xFF,
> + },
> + { /* Init_CR90_CRA7 */
> + 0x55, 0xD9, 0x5D, 0xE1, 0x86, 0x1B, 0x8E, 0x26,
> + 0xDA, 0x8D, 0xDE, 0x94, 0x00, 0x00, 0x18, 0x00,
> + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x03,
> + },
> + },
> + { /* mode#4: 1024 x 768 32Bpp 60Hz */
> + 1024, 768, 32, 60,
> + /* Init_MISC */
> + 0xEB,
> + { /* Init_SR0_SR4 */
> + 0x03, 0x01, 0x0F, 0x03, 0x0E,
> + },
> + { /* Init_SR10_SR24 */
> + 0xF3, 0xB6, 0xC0, 0xDD, 0x00, 0x0E, 0x17, 0x2C,
> + 0x99, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0xC4, 0x32, 0x02, 0x01, 0x01,
> + },
> + { /* Init_SR30_SR75 */
> + 0x38, 0x03, 0x20, 0x09, 0xC0, 0x3A, 0x3A, 0x3A,
> + 0x3A, 0x3A, 0x3A, 0x3A, 0x00, 0x00, 0x03, 0xFF,
> + 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
> + 0x20, 0x0C, 0x44, 0x20, 0x00, 0x00, 0x00, 0x3A,
> + 0x06, 0x68, 0xA7, 0x7F, 0x83, 0x24, 0xFF, 0x03,
> + 0x00, 0x60, 0x59, 0x3A, 0x3A, 0x00, 0x00, 0x3A,
> + 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
> + 0x50, 0x03, 0x74, 0x14, 0x3B, 0x0D, 0x09, 0x02,
> + 0x04, 0x45, 0x30, 0x30, 0x40, 0x20,
> + },
> + { /* Init_SR80_SR93 */
> + 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x3A,
> + 0xF7, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3A, 0x3A,
> + 0x00, 0x00, 0x00, 0x00,
> + },
> + { /* Init_SRA0_SRAF */
> + 0x00, 0xFB, 0x9F, 0x01, 0x00, 0xED, 0xED, 0xED,
> + 0x7B, 0xFB, 0xFF, 0xFF, 0x97, 0xEF, 0xBF, 0xDF,
> + },
> + { /* Init_GR00_GR08 */
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
> + 0xFF,
> + },
> + { /* Init_AR00_AR14 */
> + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
> + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
> + 0x41, 0x00, 0x0F, 0x00, 0x00,
> + },
> + { /* Init_CR00_CR18 */
> + 0xA3, 0x7F, 0x7F, 0x00, 0x85, 0x16, 0x24, 0xF5,
> + 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x03, 0x09, 0xFF, 0x80, 0x40, 0xFF, 0x00, 0xE3,
> + 0xFF,
> + },
> + { /* Init_CR30_CR4D */
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x20,
> + 0x00, 0x00, 0x00, 0x40, 0x00, 0xFF, 0xBF, 0xFF,
> + 0xA3, 0x7F, 0x00, 0x86, 0x15, 0x24, 0xFF, 0x00,
> + 0x01, 0x07, 0xE5, 0x20, 0x7F, 0xFF,
> + },
> + { /* Init_CR90_CRA7 */
> + 0x55, 0xD9, 0x5D, 0xE1, 0x86, 0x1B, 0x8E, 0x26,
> + 0xDA, 0x8D, 0xDE, 0x94, 0x00, 0x00, 0x18, 0x00,
> + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x03,
> + },
> + },
> + { /* mode#6: 320 x 240 16Bpp 60Hz */
> + 320, 240, 16, 60,
> + /* Init_MISC */
> + 0xEB,
> + { /* Init_SR0_SR4 */
> + 0x03, 0x01, 0x0F, 0x03, 0x0E,
> + },
> + { /* Init_SR10_SR24 */
> + 0xF3, 0xB6, 0xC0, 0xDD, 0x00, 0x0E, 0x17, 0x2C,
> + 0x99, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0xC4, 0x32, 0x02, 0x01, 0x01,
> + },
> + { /* Init_SR30_SR75 */
> + 0x38, 0x03, 0x20, 0x09, 0xC0, 0x3A, 0x3A, 0x3A,
> + 0x3A, 0x3A, 0x3A, 0x3A, 0x00, 0x00, 0x03, 0xFF,
> + 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
> + 0x20, 0x0C, 0x44, 0x20, 0x00, 0x00, 0x00, 0x3A,
> + 0x06, 0x68, 0xA7, 0x7F, 0x83, 0x24, 0xFF, 0x03,
> + 0x00, 0x60, 0x59, 0x3A, 0x3A, 0x00, 0x00, 0x3A,
> + 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
> + 0x50, 0x03, 0x74, 0x14, 0x08, 0x43, 0x08, 0x43,
> + 0x04, 0x45, 0x30, 0x30, 0x40, 0x20,
> + },
> + { /* Init_SR80_SR93 */
> + 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x3A,
> + 0xF7, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3A, 0x3A,
> + 0x00, 0x00, 0x00, 0x00,
> + },
> + { /* Init_SRA0_SRAF */
> + 0x00, 0xFB, 0x9F, 0x01, 0x00, 0xED, 0xED, 0xED,
> + 0x7B, 0xFB, 0xFF, 0xFF, 0x97, 0xEF, 0xBF, 0xDF,
> + },
> + { /* Init_GR00_GR08 */
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
> + 0xFF,
> + },
> + { /* Init_AR00_AR14 */
> + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
> + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
> + 0x41, 0x00, 0x0F, 0x00, 0x00,
> + },
> + { /* Init_CR00_CR18 */
> + 0xA3, 0x7F, 0x7F, 0x00, 0x85, 0x16, 0x24, 0xF5,
> + 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x03, 0x09, 0xFF, 0x80, 0x40, 0xFF, 0x00, 0xE3,
> + 0xFF,
> + },
> + { /* Init_CR30_CR4D */
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x20,
> + 0x00, 0x00, 0x30, 0x40, 0x00, 0xFF, 0xBF, 0xFF,
> + 0x2E, 0x27, 0x00, 0x2b, 0x0c, 0x0F, 0xEF, 0x00,
> + 0xFe, 0x0f, 0x01, 0xC0, 0x27, 0xEF,
> + },
> + { /* Init_CR90_CRA7 */
> + 0x55, 0xD9, 0x5D, 0xE1, 0x86, 0x1B, 0x8E, 0x26,
> + 0xDA, 0x8D, 0xDE, 0x94, 0x00, 0x00, 0x18, 0x00,
> + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x03,
> + },
> + },
> +
> + { /* mode#8: 320 x 240 32Bpp 60Hz */
> + 320, 240, 32, 60,
> + /* Init_MISC */
> + 0xEB,
> + { /* Init_SR0_SR4 */
> + 0x03, 0x01, 0x0F, 0x03, 0x0E,
> + },
> + { /* Init_SR10_SR24 */
> + 0xF3, 0xB6, 0xC0, 0xDD, 0x00, 0x0E, 0x17, 0x2C,
> + 0x99, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0xC4, 0x32, 0x02, 0x01, 0x01,
> + },
> + { /* Init_SR30_SR75 */
> + 0x38, 0x03, 0x20, 0x09, 0xC0, 0x3A, 0x3A, 0x3A,
> + 0x3A, 0x3A, 0x3A, 0x3A, 0x00, 0x00, 0x03, 0xFF,
> + 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
> + 0x20, 0x0C, 0x44, 0x20, 0x00, 0x00, 0x00, 0x3A,
> + 0x06, 0x68, 0xA7, 0x7F, 0x83, 0x24, 0xFF, 0x03,
> + 0x00, 0x60, 0x59, 0x3A, 0x3A, 0x00, 0x00, 0x3A,
> + 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
> + 0x50, 0x03, 0x74, 0x14, 0x08, 0x43, 0x08, 0x43,
> + 0x04, 0x45, 0x30, 0x30, 0x40, 0x20,
> + },
> + { /* Init_SR80_SR93 */
> + 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x3A,
> + 0xF7, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3A, 0x3A,
> + 0x00, 0x00, 0x00, 0x00,
> + },
> + { /* Init_SRA0_SRAF */
> + 0x00, 0xFB, 0x9F, 0x01, 0x00, 0xED, 0xED, 0xED,
> + 0x7B, 0xFB, 0xFF, 0xFF, 0x97, 0xEF, 0xBF, 0xDF,
> + },
> + { /* Init_GR00_GR08 */
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
> + 0xFF,
> + },
> + { /* Init_AR00_AR14 */
> + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
> + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
> + 0x41, 0x00, 0x0F, 0x00, 0x00,
> + },
> + { /* Init_CR00_CR18 */
> + 0xA3, 0x7F, 0x7F, 0x00, 0x85, 0x16, 0x24, 0xF5,
> + 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x03, 0x09, 0xFF, 0x80, 0x40, 0xFF, 0x00, 0xE3,
> + 0xFF,
> + },
> + { /* Init_CR30_CR4D */
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x20,
> + 0x00, 0x00, 0x30, 0x40, 0x00, 0xFF, 0xBF, 0xFF,
> + 0x2E, 0x27, 0x00, 0x2b, 0x0c, 0x0F, 0xEF, 0x00,
> + 0xFe, 0x0f, 0x01, 0xC0, 0x27, 0xEF,
> + },
> + { /* Init_CR90_CRA7 */
> + 0x55, 0xD9, 0x5D, 0xE1, 0x86, 0x1B, 0x8E, 0x26,
> + 0xDA, 0x8D, 0xDE, 0x94, 0x00, 0x00, 0x18, 0x00,
> + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x03,
> + },
> + },
> +};
What are these tables above for?
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH] video: fbdev: Use devm_clk_get
From: Tomi Valkeinen @ 2015-09-01 10:56 UTC (permalink / raw)
To: Vaishali Thakkar, Jean-Christophe Plagniol-Villard
Cc: linux-fbdev, linux-kernel
In-Reply-To: <20150818032840.GA14566@localhost>
[-- Attachment #1: Type: text/plain, Size: 580 bytes --]
On 18/08/15 06:28, Vaishali Thakkar wrote:
> This patch introduces the use of managed resource function
> devm_clk_get instead of clk_get and removes corresponding calls
> to clk_put in the probe and remove functions.
>
> To be compatible with the change various gotos are replaced with
> direct returns, and unneeded label failed_put_clk is dropped.
>
> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
> ---
> drivers/video/fbdev/pxa168fb.c | 14 ++++----------
> 1 file changed, 4 insertions(+), 10 deletions(-)
Thanks, queued for 4.3.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH v4] OMAPDSS: hdmi: Reconfigure and restart audio when display is enabled
From: Tomi Valkeinen @ 2015-09-01 10:52 UTC (permalink / raw)
To: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap; +Cc: peter.ujfalusi
In-Reply-To: <1440771706-21388-1-git-send-email-jsarha@ti.com>
[-- Attachment #1: Type: text/plain, Size: 2029 bytes --]
On 28/08/15 17:21, Jyri Sarha wrote:
> Reconfigure and restart audio when display is enabled, if audio
> playback was active before. This is needed in a situation when an
> audio+video stream application opens the audio stream before the
> video. When video stream is opened the display mode may change and
> that aborts audio playback, because the display is momentarily
> turned off.
>
> The audio configuration is stored when it is successfully applied and
> a boolean is set when the audio playback is started and unset when
> stopped. This data is used to reconfigure the audio when display is
> re-enabled. The audio playback is aborted if the reconfiguration fails.
>
> A new spin lock is introduced in order to protect state variables
> related to audio playback status. This is needed for the transition
> from display enabled state (when audio start/stop commands can be
> written to HW) to display disabled state (when audio start/stop
> commands update only the hdmi.audio_playing variable) to always
> serialize correctly with the start/stop audio commands. The already
> existing mutex can not be used, because the audio start and stop
> commands are executed in atomic context.
>
> For example: when display is turned back on we take the spinlock and
> we can be sure that the audio start/stop status will not change while
> we update the HW according to hdmi.audio_playing state and set
> hdmi.display_enabled to true. After releasing the lock
> hdmi.display_enabled is true and all audio_start and audio_stop
> commands write their stuff directly to HW.
>
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
> Fixed one bad sentece in the description.
>
> drivers/video/fbdev/omap2/dss/hdmi.h | 9 ++++-
> drivers/video/fbdev/omap2/dss/hdmi4.c | 66 +++++++++++++++++++++++++-----
> drivers/video/fbdev/omap2/dss/hdmi5.c | 76 ++++++++++++++++++++++++++++-------
> 3 files changed, 124 insertions(+), 27 deletions(-)
Thanks, I've queued this for 4.4.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 04/11] fbdev: ssd1307fb: fix error return code
From: Tomi Valkeinen @ 2015-09-01 10:39 UTC (permalink / raw)
To: Julia Lawall, Jean-Christophe Plagniol-Villard
Cc: kernel-janitors, linux-fbdev, linux-kernel
In-Reply-To: <1440288682-12732-5-git-send-email-Julia.Lawall@lip6.fr>
[-- Attachment #1: Type: text/plain, Size: 1448 bytes --]
On 23/08/15 03:11, Julia Lawall wrote:
> Propagate error code on failure. Also changed %ld to %d in dev_err to use
> ret variable rather than putting two calls to PTR_ERR.
>
> A simplified version of the semantic match that finds the first problem is as
> follows: (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> identifier ret; expression e1,e2;
> @@
> (
> if (\(ret < 0\|ret != 0\))
> { ... return ret; }
> |
> ret = 0
> )
> ... when != ret = e1
> when != &ret
> *if(...)
> {
> ... when != ret = e2
> when forall
> return ret;
> }
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
> drivers/video/fbdev/ssd1307fb.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
> index 3e153c0..1611215 100644
> --- a/drivers/video/fbdev/ssd1307fb.c
> +++ b/drivers/video/fbdev/ssd1307fb.c
> @@ -656,8 +656,9 @@ static int ssd1307fb_probe(struct i2c_client *client,
> bl = backlight_device_register(bl_name, &client->dev, par,
> &ssd1307fb_bl_ops, NULL);
> if (IS_ERR(bl)) {
> - dev_err(&client->dev, "unable to register backlight device: %ld\n",
> - PTR_ERR(bl));
> + ret = PTR_ERR(bl);
> + dev_err(&client->dev, "unable to register backlight device: %d\n",
> + ret);
> goto bl_init_error;
> }
Thanks, queued for 4.3.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [patch v2] fbdev: fix snprintf() limit in show_bl_curve()
From: Tomi Valkeinen @ 2015-09-01 10:35 UTC (permalink / raw)
To: linux-fbdev
[-- Attachment #1: Type: text/plain, Size: 1063 bytes --]
On 24/08/15 22:54, Dan Carpenter wrote:
> The limit should be "PAGE_SIZE - len" instead of PAGE_SIZE. Also let's
> use scnprintf() because snprintf() returns the number of bytes which
> would have been printed if there were space and scnprintf() returns the
> number of bytes actually printed.
>
> I don't think we are ever going to actually hit this limit in real life.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/video/fbdev/core/fbsysfs.c b/drivers/video/fbdev/core/fbsysfs.c
> index 60c3f0a..15755ce 100644
> --- a/drivers/video/fbdev/core/fbsysfs.c
> +++ b/drivers/video/fbdev/core/fbsysfs.c
> @@ -485,7 +485,7 @@ static ssize_t show_bl_curve(struct device *device,
>
> mutex_lock(&fb_info->bl_curve_mutex);
> for (i = 0; i < FB_BACKLIGHT_LEVELS; i += 8)
> - len += snprintf(&buf[len], PAGE_SIZE, "%8ph\n",
> + len += scnprintf(&buf[len], PAGE_SIZE - len, "%8ph\n",
> fb_info->bl_curve + i);
> mutex_unlock(&fb_info->bl_curve_mutex);
Thanks, queued for 4.3.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 4/4] fbdev: Debug knob to register without holding console_lock
From: Tomi Valkeinen @ 2015-09-01 10:32 UTC (permalink / raw)
To: Rob Clark, Daniel Vetter
Cc: Intel Graphics Development, Jean-Christophe Plagniol-Villard,
Linux Fbdev development list, DRI Development
In-Reply-To: <CAF6AEGu54g+5Q0ZQXeMd7HLHkGWPw+sdo-FZ4qVS=9nB6nLwtw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1794 bytes --]
On 25/08/15 22:24, Rob Clark wrote:
> On Tue, Aug 25, 2015 at 9:45 AM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>> When the usual fbcon legacy options are enabled we have
>> ->register_framebuffer
>> ->fb notifier chain calls into fbcon
>> ->fbcon sets up console on new fbi
>> ->fbi->set_par
>> ->drm_fb_helper_set_par exercises full kms api
>>
>> And because of locking inversion hilarity all of register_framebuffer
>> is done with the console lock held. Which means that the first time on
>> driver load we exercise _all_ the kms code (all probe paths and
>> modeset paths for everything connected) is under the console lock.
>> That means if anything goes belly-up in that big pile of code nothing
>> ever reaches logfiles (and the machine is dead).
>>
>> Usual tactic to debug that is to temporarily remove those console_lock
>> calls to be able to capture backtraces. I'm fed up writing this patch
>> and recompiling kernels. Hence this patch here to add an unsafe,
>> kernel-taining option to do this at runtime.
>>
>> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
>> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
>> Cc: linux-fbdev@vger.kernel.org
>> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> This one was causing me some problems, if I tried to enable
> lockless_register_fb. It *looks* like it should work, so I'm not
> quite sure what the deal is. But I'm 110% fan of getting something
> like this working, because console_lock is pretty much the bane of kms
> developer's existence..
>
> I'll have to debug further on a system where I can see more than the
> bottom three lines of the second to last backtrace..
Any idea if anyone has ever looked at properly fixing this?
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH] efifb: Add support for 64-bit frame buffer addresses
From: Matt Fleming @ 2015-09-01 8:54 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Peter Jones, linux-efi, linux-kernel@vger.kernel.org,
Linux Fbdev development list, Matt Fleming, Pete Hawkins,
Matthew Garrett, Chad Page
In-Reply-To: <CAMuHMdU146p_vs9bfgV9n_tTkH_545hRb1qsEza=dLO=C-y69A@mail.gmail.com>
On Mon, 31 Aug, at 10:24:31PM, Geert Uytterhoeven wrote:
> On Fri, Aug 28, 2015 at 2:12 PM, Matt Fleming <matt@codeblueprint.co.uk> wrote:
> > --- a/arch/x86/boot/compressed/eboot.c
> > +++ b/arch/x86/boot/compressed/eboot.c
> > @@ -624,7 +624,7 @@ setup_pixel_info(struct screen_info *si, u32 pixels_per_scan_line,
> > static efi_status_t
> > __gop_query32(struct efi_graphics_output_protocol_32 *gop32,
> > struct efi_graphics_output_mode_info **info,
> > - unsigned long *size, u32 *fb_base)
> > + unsigned long *size, u64 *fb_base)
>
> phys_addr_t instead of u64?
I can see why you might think that, but no, phys_addr_t isn't the
correct data type because your kernel config dictates whether that's
u32 or u64.
We're interacting with the firmware here and the frame buffer address
is always u64, for both 32-bit and 64-bit firmware. It's defined that
way in the UEFI spec.
It's better to be explicit about these kinds of things, and use u64.
--
Matt Fleming, Intel Open Source Technology Center
^ permalink raw reply
* Re: [PATCH 3/3] devicetree: Add led-backlight binding
From: Rob Herring @ 2015-08-31 23:12 UTC (permalink / raw)
To: Jacek Anaszewski
Cc: Tomi Valkeinen, Jingoo Han, Lee Jones, Linux LED Subsystem,
linux-fbdev@vger.kernel.org, Andrew Lunn,
devicetree@vger.kernel.org
In-Reply-To: <55DD8D4A.8010507@samsung.com>
On Wed, Aug 26, 2015 at 4:56 AM, Jacek Anaszewski
<j.anaszewski@samsung.com> wrote:
> On 08/26/2015 11:11 AM, Tomi Valkeinen wrote:
>>
>>
>>
>> On 26/08/15 10:07, Jacek Anaszewski wrote:
>>>
>>> On 08/25/2015 05:41 PM, Tomi Valkeinen wrote:
>>>>
>>>>
>>>>
>>>> On 25/08/15 16:39, Jacek Anaszewski wrote:
>>>>
>>>>>> +Example:
>>>>>> +
>>>>>> + backlight {
>>>>>> + compatible = "led-backlight";
>>>>>> + leds = <&backlight_led>;
>>>>>> +
>>>>>> + brightness-levels = <0 4 8 16 32 64 128 255>;
>>>>>
>>>>>
>>>>> brightness level is not a suitable unit for describing LED brightness
>>>>> in a Device Tree, as it is not a physical unit. We have
>>>>> led-max-microamp
>>>>> property for this, expressed in microamperes, please refer to [0] from
>>>>> linux-next.
>>>>
>>>>
>>>> Hmm, ok, but what should the driver do with microamperes? As far as I
>>>> see, "enum led_brightness" (which is between 0-255) is used to set the
>>>> brightness to LEDs. I don't see any function accepting microamperes.
>>>
>>>
>>> This is implementation detail. You can convert microamperes to
>>> enum led_brightness in the driver. Please refer to the discussion [1].
>>
>>
>> The led_set_brightness() takes "enum led_brightness", so I don't
>> understand what this driver would do with the microampere value. It
>> could, of course, do an arbitrary conversion, say, direct mapping of the
>> mA value to brightness, but that would just confuse things further.
>
>
> OK, I was looking at the problem from LED-centric perspective. Indeed,
> backlight subsystem has no other way to pass brightness to the LED
> subsystem than in the form of levels. However, the last word belongs
> to DT maintainer in this matter.
>
> Cc'ing devicetree@vger.kernel.org.
I don't have a simple answer for you...
There was a similar discussion for pm8941-wled and
"default-brightness-level" units[1]. The conclusion was it should be
units matching the h/w so that there is no conversion between
bootloader and OS units to h/w units. That principle probably applies
here.
If the brightness levels are non-linear, then you need a translation
from percent to h/w level. What's needed here for h/w levels depends
on whether the brightness control is PWM, current control or both. For
PWM, units of the PWM control makes sense. For current control, units
of microamps probably makes sense. I don't know what you do with both,
but I have seen that h/w (FSL PMICs).
This all certainly needs some more work on defining some common
binding. We already have some bindings for backlights with the LED and
PWM bindings (perhaps incomplete?). Do we need another way here? This
also introduces possibility of multiple ways to define GPIO controlled
backlights: gpio -> gpio-leds -> led-backlight or gpio ->
gpio-backlight. We don't want that...
This problem is not really specific at all to backlights, but applies
to all LEDs. Some LEDs you may not have control beyond on/off or
really care about fine-grained control of level, but they are really
no different. The main unique thing about backlights is what display
are they associated with.
Rob
[1] https://lkml.org/lkml/2015/7/30/542
^ permalink raw reply
* Re: [PATCH] efifb: Add support for 64-bit frame buffer addresses
From: Geert Uytterhoeven @ 2015-08-31 20:24 UTC (permalink / raw)
To: Matt Fleming
Cc: Peter Jones, linux-efi-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Linux Fbdev development list, Matt Fleming, Pete Hawkins,
Matthew Garrett, Chad Page
In-Reply-To: <1440763939-17027-1-git-send-email-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
On Fri, Aug 28, 2015 at 2:12 PM, Matt Fleming <matt@codeblueprint.co.uk> wrote:
> --- a/arch/x86/boot/compressed/eboot.c
> +++ b/arch/x86/boot/compressed/eboot.c
> @@ -624,7 +624,7 @@ setup_pixel_info(struct screen_info *si, u32 pixels_per_scan_line,
> static efi_status_t
> __gop_query32(struct efi_graphics_output_protocol_32 *gop32,
> struct efi_graphics_output_mode_info **info,
> - unsigned long *size, u32 *fb_base)
> + unsigned long *size, u64 *fb_base)
phys_addr_t instead of u64?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* Re: [PATCH] efifb: Add support for 64-bit frame buffer addresses
From: Peter Jones @ 2015-08-31 15:23 UTC (permalink / raw)
To: Matt Fleming
Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA, Matt Fleming, Pete Hawkins,
Matthew Garrett, Chad Page
In-Reply-To: <1440763939-17027-1-git-send-email-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
On Fri, Aug 28, 2015 at 01:12:19PM +0100, Matt Fleming wrote:
> From: Matt Fleming <matt.fleming@intel.com>
>
> The EFI Graphics Output Protocol uses 64-bit frame buffer addresses
> but these get truncated to 32-bit by the EFI boot stub when storing
> the address in the 'lfb_base' field of 'struct screen_info'.
>
> Add a 'ext_lfb_base' field for the upper 32-bits of the frame buffer
> address and set VIDEO_TYPE_CAPABILITY_64BIT_BASE when the field is
> useable.
>
> It turns out that the reason no one has required this support so far
> is that there's actually code in tianocore to "downgrade" PCI
> resources that have option ROMs and 64-bit BARS from 64-bit to 32-bit
> to cope with legacy option ROMs that can't handle 64-bit addresses.
> The upshot is that basically all GOP devices in the wild use a 32-bit
> frame buffer address.
>
> Still, it is possible to build firmware that uses a full 64-bit GOP
> frame buffer address. Chad did, which led to him reporting this issue.
>
> Add support in anticipation of GOP devices using 64-bit addresses more
> widely, and so that efifb works out of the box when that happens.
>
> Reported-by: Chad Page <chad.page@znyx.com>
> Cc: Pete Hawkins <pete.hawkins@znyx.com>
> Cc: Peter Jones <pjones@redhat.com>
> Cc: Matthew Garrett <mjg59@srcf.ucam.org>
> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Looks good to me.
Acked-by: Peter Jones <pjones@redhat.com>
--
Peter
^ permalink raw reply
* [PATCHv2] staging: sm750fb: fix improper typedef usage
From: Brian Stottler @ 2015-08-31 1:42 UTC (permalink / raw)
To: linux-fbdev
Fix typedef usage which does not comply with kernel style guidelines.
Signed-off-by: Brian Stottler <brianstottler@gmail.com>
---
v2: Recreated patch against proper source tree
drivers/staging/sm750fb/ddk750_chip.c | 31 ++++++++++++++---------------
drivers/staging/sm750fb/ddk750_chip.h | 34 ++++++++++++++------------------
drivers/staging/sm750fb/ddk750_display.c | 2 +-
drivers/staging/sm750fb/ddk750_display.h | 12 +++++------
drivers/staging/sm750fb/ddk750_dvi.c | 12 +++++------
drivers/staging/sm750fb/ddk750_dvi.h | 4 ++--
drivers/staging/sm750fb/ddk750_mode.c | 8 ++++----
drivers/staging/sm750fb/ddk750_mode.h | 18 ++++++++---------
drivers/staging/sm750fb/ddk750_power.c | 2 +-
drivers/staging/sm750fb/ddk750_power.h | 7 +++----
drivers/staging/sm750fb/ddk750_sii164.c | 2 +-
drivers/staging/sm750fb/ddk750_sii164.h | 4 ++--
drivers/staging/sm750fb/sm750_hw.c | 8 ++++----
13 files changed, 67 insertions(+), 77 deletions(-)
diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c
index 5e6798e..20f2630 100644
--- a/drivers/staging/sm750fb/ddk750_chip.c
+++ b/drivers/staging/sm750fb/ddk750_chip.c
@@ -2,20 +2,19 @@
#include "ddk750_reg.h"
#include "ddk750_chip.h"
#include "ddk750_power.h"
-typedef struct _pllcalparam {
+struct pllcalparam {
unsigned char power;/* d : 0~ 6*/
unsigned char pod;
unsigned char od;
unsigned char value;/* value of 2 power d (2^d) */
-}
-pllcalparam;
+};
-logical_chip_type_t getChipType(void)
+enum logical_chip_type_t getChipType(void)
{
unsigned short physicalID;
char physicalRev;
- logical_chip_type_t chip;
+ enum logical_chip_type_t chip;
physicalID = devId750; /* either 0x718 or 0x750 */
physicalRev = revId750;
@@ -44,12 +43,12 @@ inline unsigned int twoToPowerOfx(unsigned long x)
return result;
}
-inline unsigned int calcPLL(pll_value_t *pPLL)
+inline unsigned int calcPLL(struct pll_value_t *pPLL)
{
return (pPLL->inputFreq * pPLL->M / pPLL->N / twoToPowerOfx(pPLL->OD) / twoToPowerOfx(pPLL->POD));
}
-unsigned int getPllValue(clock_type_t clockType, pll_value_t *pPLL)
+unsigned int getPllValue(enum clock_type_t clockType, struct pll_value_t *pPLL)
{
unsigned int ulPllReg = 0;
@@ -85,7 +84,7 @@ unsigned int getPllValue(clock_type_t clockType, pll_value_t *pPLL)
unsigned int getChipClock(void)
{
- pll_value_t pll;
+ struct pll_value_t pll;
#if 1
if (getChipType() = SM750LE)
return MHz(130);
@@ -102,7 +101,7 @@ unsigned int getChipClock(void)
*/
void setChipClock(unsigned int frequency)
{
- pll_value_t pll;
+ struct pll_value_t pll;
unsigned int ulActualMxClk;
#if 1
/* Cheok_0509: For SM750LE, the chip clock is fixed. Nothing to set. */
@@ -252,7 +251,7 @@ unsigned int ddk750_getVMSize(void)
}
-int ddk750_initHw(initchip_param_t *pInitParam)
+int ddk750_initHw(struct initchip_param_t *pInitParam)
{
unsigned int ulReg;
@@ -405,10 +404,10 @@ unsigned int absDiff(unsigned int a, unsigned int b)
M = {1,...,255}
N = {2,...,15}
*/
-unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll)
+unsigned int calcPllValue(unsigned int request_orig, struct pll_value_t *pll)
{
/* used for primary and secondary channel pixel clock pll */
- static pllcalparam xparm_PIXEL[] = {
+ static struct pllcalparam xparm_PIXEL[] = {
/* 2^0 = 1*/ {0, 0, 0, 1},
/* 2^ 1 =2*/ {1, 0, 1, 2},
/* 2^ 2 = 4*/ {2, 0, 2, 4},
@@ -419,7 +418,7 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll)
};
/* used for MXCLK (chip clock) */
- static pllcalparam xparm_MXCLK[] = {
+ static struct pllcalparam xparm_MXCLK[] = {
/* 2^0 = 1*/ {0, 0, 0, 1},
/* 2^ 1 =2*/ {1, 0, 1, 2},
/* 2^ 2 = 4*/ {2, 0, 2, 4},
@@ -433,7 +432,7 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll)
unsigned int RN, quo, rem, fl_quo;
unsigned int input, request;
unsigned int tmpClock, ret;
- pllcalparam *xparm;
+ struct pllcalparam *xparm;
#if 1
if (getChipType() = SM750LE) {
@@ -493,7 +492,7 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll)
unsigned int calcPllValue2(
unsigned int ulRequestClk, /* Required pixel clock in Hz unit */
-pll_value_t *pPLL /* Structure to hold the value to be set in PLL */
+struct pll_value_t *pPLL /* Structure to hold the value to be set in PLL */
)
{
unsigned int M, N, OD, POD = 0, diff, pllClk, odPower, podPower;
@@ -591,7 +590,7 @@ pll_value_t *pPLL /* Structure to hold the value to be set in PLL */
-unsigned int formatPllReg(pll_value_t *pPLL)
+unsigned int formatPllReg(struct pll_value_t *pPLL)
{
unsigned int ulPllReg = 0;
diff --git a/drivers/staging/sm750fb/ddk750_chip.h b/drivers/staging/sm750fb/ddk750_chip.h
index 6ff0436..26b3b4a6 100644
--- a/drivers/staging/sm750fb/ddk750_chip.h
+++ b/drivers/staging/sm750fb/ddk750_chip.h
@@ -8,26 +8,24 @@
#include <linux/io.h>
/* This is all the chips recognized by this library */
-typedef enum _logical_chip_type_t {
+enum logical_chip_type_t {
SM_UNKNOWN,
SM718,
SM750,
SM750LE,
-}
-logical_chip_type_t;
+};
-typedef enum _clock_type_t {
+enum clock_type_t {
MXCLK_PLL,
PRIMARY_PLL,
SECONDARY_PLL,
VGA0_PLL,
VGA1_PLL,
-}
-clock_type_t;
+};
-typedef struct _pll_value_t {
- clock_type_t clockType;
+struct pll_value_t {
+ enum clock_type_t clockType;
unsigned long inputFreq; /* Input clock frequency to the PLL */
/* Use this when clockType = PANEL_PLL */
@@ -35,11 +33,10 @@ typedef struct _pll_value_t {
unsigned long N;
unsigned long OD;
unsigned long POD;
-}
-pll_value_t;
+};
/* input struct to initChipParam() function */
-typedef struct _initchip_param_t {
+struct initchip_param_t {
unsigned short powerMode; /* Use power mode 0 or 1 */
unsigned short chipClock; /**
* Speed of main chip clock in MHz unit
@@ -67,18 +64,17 @@ typedef struct _initchip_param_t {
*/
/* More initialization parameter can be added if needed */
-}
-initchip_param_t;
+};
-logical_chip_type_t getChipType(void);
-unsigned int calcPllValue(unsigned int request, pll_value_t *pll);
-unsigned int calcPllValue2(unsigned int, pll_value_t *);
-unsigned int formatPllReg(pll_value_t *pPLL);
+enum logical_chip_type_t getChipType(void);
+unsigned int calcPllValue(unsigned int request, struct pll_value_t *pll);
+unsigned int calcPllValue2(unsigned int, struct pll_value_t *);
+unsigned int formatPllReg(struct pll_value_t *pPLL);
void ddk750_set_mmio(void __iomem *, unsigned short, char);
unsigned int ddk750_getVMSize(void);
-int ddk750_initHw(initchip_param_t *);
-unsigned int getPllValue(clock_type_t clockType, pll_value_t *pPLL);
+int ddk750_initHw(struct initchip_param_t *);
+unsigned int getPllValue(enum clock_type_t clockType, struct pll_value_t *pPLL);
unsigned int getChipClock(void);
void setChipClock(unsigned int);
void setMemoryClock(unsigned int frequency);
diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c
index 8348113..a40871e 100644
--- a/drivers/staging/sm750fb/ddk750_display.c
+++ b/drivers/staging/sm750fb/ddk750_display.c
@@ -208,7 +208,7 @@ static void swPanelPowerSequence(int disp, int delay)
}
-void ddk750_setLogicalDispOut(disp_output_t output)
+void ddk750_setLogicalDispOut(enum disp_output_t output)
{
unsigned int reg;
diff --git a/drivers/staging/sm750fb/ddk750_display.h b/drivers/staging/sm750fb/ddk750_display.h
index abccf84..a06bb8e 100644
--- a/drivers/staging/sm750fb/ddk750_display.h
+++ b/drivers/staging/sm750fb/ddk750_display.h
@@ -86,7 +86,7 @@
CRT means crt path DSUB
*/
#if 0
-typedef enum _disp_output_t {
+enum disp_output_t {
NO_DISPLAY = DPMS_OFF,
LCD1_PRI = PNL_2_PRI|PRI_TP_ON|PNL_SEQ_ON|DPMS_OFF|DAC_ON,
@@ -125,10 +125,9 @@ typedef enum _disp_output_t {
CRT_2_SEC|PRI_TP_OFF|DPMS_ON|DUAL_TFT_ON,
-}
-disp_output_t;
+};
#else
-typedef enum _disp_output_t {
+enum disp_output_t {
do_LCD1_PRI = PNL_2_PRI|PRI_TP_ON|PNL_SEQ_ON|DAC_ON,
do_LCD1_SEC = PNL_2_SEC|SEC_TP_ON|PNL_SEQ_ON|DAC_ON,
#if 0
@@ -149,11 +148,10 @@ typedef enum _disp_output_t {
do_CRT_PRI = CRT_2_PRI|PRI_TP_ON|DPMS_ON|DAC_ON,
do_CRT_SEC = CRT_2_SEC|SEC_TP_ON|DPMS_ON|DAC_ON,
#endif
-}
-disp_output_t;
+};
#endif
-void ddk750_setLogicalDispOut(disp_output_t);
+void ddk750_setLogicalDispOut(enum disp_output_t);
int ddk750_initDVIDisp(void);
#endif
diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c
index a7a2351..1a8ca6d 100644
--- a/drivers/staging/sm750fb/ddk750_dvi.c
+++ b/drivers/staging/sm750fb/ddk750_dvi.c
@@ -9,7 +9,7 @@
/* This global variable contains all the supported driver and its corresponding
function API. Please set the function pointer to NULL whenever the function
is not supported. */
-static dvi_ctrl_device_t g_dcftSupportedDviController[] = {
+static struct dvi_ctrl_device_t g_dcftSupportedDviController[] = {
#ifdef DVI_CTRL_SII164
{
.pfnInit = sii164InitChip,
@@ -42,7 +42,7 @@ int dviInit(
unsigned char pllFilterValue
)
{
- dvi_ctrl_device_t *pCurrentDviCtrl;
+ struct dvi_ctrl_device_t *pCurrentDviCtrl;
pCurrentDviCtrl = g_dcftSupportedDviController;
if (pCurrentDviCtrl->pfnInit != NULL) {
@@ -63,10 +63,10 @@ int dviInit(
*/
unsigned short dviGetVendorID(void)
{
- dvi_ctrl_device_t *pCurrentDviCtrl;
+ struct dvi_ctrl_device_t *pCurrentDviCtrl;
pCurrentDviCtrl = g_dcftSupportedDviController;
- if (pCurrentDviCtrl != (dvi_ctrl_device_t *)0)
+ if (pCurrentDviCtrl != (struct dvi_ctrl_device_t *)0)
return pCurrentDviCtrl->pfnGetVendorId();
return 0x0000;
@@ -82,10 +82,10 @@ unsigned short dviGetVendorID(void)
*/
unsigned short dviGetDeviceID(void)
{
- dvi_ctrl_device_t *pCurrentDviCtrl;
+ struct dvi_ctrl_device_t *pCurrentDviCtrl;
pCurrentDviCtrl = g_dcftSupportedDviController;
- if (pCurrentDviCtrl != (dvi_ctrl_device_t *)0)
+ if (pCurrentDviCtrl != (struct dvi_ctrl_device_t *)0)
return pCurrentDviCtrl->pfnGetDeviceId();
return 0x0000;
diff --git a/drivers/staging/sm750fb/ddk750_dvi.h b/drivers/staging/sm750fb/ddk750_dvi.h
index e1d4c9a..7181e5d 100644
--- a/drivers/staging/sm750fb/ddk750_dvi.h
+++ b/drivers/staging/sm750fb/ddk750_dvi.h
@@ -26,7 +26,7 @@ typedef unsigned char (*PFN_DVICTRL_CHECKINTERRUPT)(void);
typedef void (*PFN_DVICTRL_CLEARINTERRUPT)(void);
/* Structure to hold all the function pointer to the DVI Controller. */
-typedef struct _dvi_ctrl_device_t {
+struct dvi_ctrl_device_t {
PFN_DVICTRL_INIT pfnInit;
PFN_DVICTRL_RESETCHIP pfnResetChip;
PFN_DVICTRL_GETCHIPSTRING pfnGetChipString;
@@ -37,7 +37,7 @@ typedef struct _dvi_ctrl_device_t {
PFN_DVICTRL_ISCONNECTED pfnIsConnected;
PFN_DVICTRL_CHECKINTERRUPT pfnCheckInterrupt;
PFN_DVICTRL_CLEARINTERRUPT pfnClearInterrupt;
-} dvi_ctrl_device_t;
+};
#define DVI_CTRL_SII164
diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c
index 2399b17..df5e94b7 100644
--- a/drivers/staging/sm750fb/ddk750_mode.c
+++ b/drivers/staging/sm750fb/ddk750_mode.c
@@ -13,7 +13,7 @@
HW only supports 7 predefined pixel clocks, and clock select is
in bit 29:27 of Display Control register.
*/
-static unsigned long displayControlAdjust_SM750LE(mode_parameter_t *pModeParam, unsigned long dispControl)
+static unsigned long displayControlAdjust_SM750LE(struct mode_parameter_t *pModeParam, unsigned long dispControl)
{
unsigned long x, y;
@@ -75,7 +75,7 @@ static unsigned long displayControlAdjust_SM750LE(mode_parameter_t *pModeParam,
/* only timing related registers will be programed */
-static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll)
+static int programModeRegisters(struct mode_parameter_t *pModeParam, struct pll_value_t *pll)
{
int ret = 0;
int cnt = 0;
@@ -182,9 +182,9 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll)
return ret;
}
-int ddk750_setModeTiming(mode_parameter_t *parm, clock_type_t clock)
+int ddk750_setModeTiming(struct mode_parameter_t *parm, enum clock_type_t clock)
{
- pll_value_t pll;
+ struct pll_value_t pll;
unsigned int uiActualPixelClk;
pll.inputFreq = DEFAULT_INPUT_CLOCK;
diff --git a/drivers/staging/sm750fb/ddk750_mode.h b/drivers/staging/sm750fb/ddk750_mode.h
index e846dc2..4310c10 100644
--- a/drivers/staging/sm750fb/ddk750_mode.h
+++ b/drivers/staging/sm750fb/ddk750_mode.h
@@ -3,27 +3,26 @@
#include "ddk750_chip.h"
-typedef enum _spolarity_t {
+enum spolarity_t {
POS = 0, /* positive */
NEG, /* negative */
-}
-spolarity_t;
+};
-typedef struct _mode_parameter_t {
+struct mode_parameter_t {
/* Horizontal timing. */
unsigned long horizontal_total;
unsigned long horizontal_display_end;
unsigned long horizontal_sync_start;
unsigned long horizontal_sync_width;
- spolarity_t horizontal_sync_polarity;
+ enum spolarity_t horizontal_sync_polarity;
/* Vertical timing. */
unsigned long vertical_total;
unsigned long vertical_display_end;
unsigned long vertical_sync_start;
unsigned long vertical_sync_height;
- spolarity_t vertical_sync_polarity;
+ enum spolarity_t vertical_sync_polarity;
/* Refresh timing. */
unsigned long pixel_clock;
@@ -31,11 +30,10 @@ typedef struct _mode_parameter_t {
unsigned long vertical_frequency;
/* Clock Phase. This clock phase only applies to Panel. */
- spolarity_t clock_phase_polarity;
-}
-mode_parameter_t;
+ enum spolarity_t clock_phase_polarity;
+};
-int ddk750_setModeTiming(mode_parameter_t *, clock_type_t);
+int ddk750_setModeTiming(struct mode_parameter_t *, enum clock_type_t);
#endif
diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c
index e580dab..ae76a6d 100644
--- a/drivers/staging/sm750fb/ddk750_power.c
+++ b/drivers/staging/sm750fb/ddk750_power.c
@@ -2,7 +2,7 @@
#include "ddk750_reg.h"
#include "ddk750_power.h"
-void ddk750_setDPMS(DPMS_t state)
+void ddk750_setDPMS(enum DPMS_t state)
{
unsigned int value;
diff --git a/drivers/staging/sm750fb/ddk750_power.h b/drivers/staging/sm750fb/ddk750_power.h
index b7cf6b2..ab0477b 100644
--- a/drivers/staging/sm750fb/ddk750_power.h
+++ b/drivers/staging/sm750fb/ddk750_power.h
@@ -1,13 +1,12 @@
#ifndef DDK750_POWER_H__
#define DDK750_POWER_H__
-typedef enum _DPMS_t {
+enum DPMS_t {
crtDPMS_ON = 0x0,
crtDPMS_STANDBY = 0x1,
crtDPMS_SUSPEND = 0x2,
crtDPMS_OFF = 0x3,
-}
-DPMS_t;
+};
#define setDAC(off) \
{ \
@@ -17,7 +16,7 @@ DPMS_t;
off)); \
}
-void ddk750_setDPMS(DPMS_t);
+void ddk750_setDPMS(enum DPMS_t);
unsigned int getPowerMode(void);
diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c
index 0bdf3db..637d1ca 100644
--- a/drivers/staging/sm750fb/ddk750_sii164.c
+++ b/drivers/staging/sm750fb/ddk750_sii164.c
@@ -303,7 +303,7 @@ void sii164SetPower(
* This function selects the mode of the hot plug detection.
*/
static void sii164SelectHotPlugDetectionMode(
- sii164_hot_plug_mode_t hotPlugMode
+ enum sii164_hot_plug_mode_t hotPlugMode
)
{
unsigned char detectReg;
diff --git a/drivers/staging/sm750fb/ddk750_sii164.h b/drivers/staging/sm750fb/ddk750_sii164.h
index f2610c9..1ca985e 100644
--- a/drivers/staging/sm750fb/ddk750_sii164.h
+++ b/drivers/staging/sm750fb/ddk750_sii164.h
@@ -4,12 +4,12 @@
#define USE_DVICHIP
/* Hot Plug detection mode structure */
-typedef enum _sii164_hot_plug_mode_t {
+enum sii164_hot_plug_mode_t {
SII164_HOTPLUG_DISABLE = 0, /* Disable Hot Plug output bit (always high). */
SII164_HOTPLUG_USE_MDI, /* Use Monitor Detect Interrupt bit. */
SII164_HOTPLUG_USE_RSEN, /* Use Receiver Sense detect bit. */
SII164_HOTPLUG_USE_HTPLG /* Use Hot Plug detect bit. */
-} sii164_hot_plug_mode_t;
+};
/* Silicon Image SiI164 chip prototype */
diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
index 7317ba9..5152688 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -116,7 +116,7 @@ int hw_sm750_inithw(struct lynx_share *share, struct pci_dev *pdev)
if (parm->master_clk = 0)
parm->master_clk = parm->chip_clk/3;
- ddk750_initHw((initchip_param_t *)&spec_share->state.initParm);
+ ddk750_initHw((struct initchip_param_t *)&spec_share->state.initParm);
/* for sm718,open pci burst */
if (share->devid = 0x718) {
POKE32(SYSTEM_CTRL,
@@ -216,7 +216,7 @@ int hw_sm750_output_setMode(struct lynxfb_output *output,
struct fb_var_screeninfo *var, struct fb_fix_screeninfo *fix)
{
int ret;
- disp_output_t dispSet;
+ enum disp_output_t dispSet;
int channel;
ret = 0;
@@ -295,8 +295,8 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc,
{
int ret, fmt;
u32 reg;
- mode_parameter_t modparm;
- clock_type_t clock;
+ struct mode_parameter_t modparm;
+ enum clock_type_t clock;
struct lynx_share *share;
struct lynxfb_par *par;
--
2.5.0
^ permalink raw reply related
* [PATCH 2/2] backlight: adp8870: Remove unnecessary MODULE_ALIAS()
From: Javier Martinez Canillas @ 2015-08-30 21:34 UTC (permalink / raw)
To: linux-kernel
Cc: Javier Martinez Canillas, linux-fbdev, Tomi Valkeinen, Jingoo Han,
Jean-Christophe Plagniol-Villard, Lee Jones
In-Reply-To: <1440970465-11651-1-git-send-email-javier@osg.samsung.com>
The driver has a I2C device id table that is used to create the modaliases
and also "adp8870-backlight" is not a supported I2C id, so it's never used.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
drivers/video/backlight/adp8870_bl.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/video/backlight/adp8870_bl.c b/drivers/video/backlight/adp8870_bl.c
index 037e43083343..9d738352d7d4 100644
--- a/drivers/video/backlight/adp8870_bl.c
+++ b/drivers/video/backlight/adp8870_bl.c
@@ -992,4 +992,3 @@ module_i2c_driver(adp8870_driver);
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
MODULE_DESCRIPTION("ADP8870 Backlight driver");
-MODULE_ALIAS("i2c:adp8870-backlight");
--
2.4.3
^ permalink raw reply related
* [PATCH 1/2] backlight: adp8860: Remove unnecessary MODULE_ALIAS()
From: Javier Martinez Canillas @ 2015-08-30 21:34 UTC (permalink / raw)
To: linux-kernel
Cc: Javier Martinez Canillas, linux-fbdev, Michael Hennerich,
Tomi Valkeinen, Jingoo Han, Jean-Christophe Plagniol-Villard,
Lee Jones
The driver has a I2C device id table that is used to create the modaliases
and also "adp8860-backlight" is not a supported I2C id, so it's never used.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
drivers/video/backlight/adp8860_bl.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/video/backlight/adp8860_bl.c b/drivers/video/backlight/adp8860_bl.c
index 71147f4461b8..98ffe71e8af2 100644
--- a/drivers/video/backlight/adp8860_bl.c
+++ b/drivers/video/backlight/adp8860_bl.c
@@ -819,4 +819,3 @@ module_i2c_driver(adp8860_driver);
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
MODULE_DESCRIPTION("ADP8860 Backlight driver");
-MODULE_ALIAS("i2c:adp8860-backlight");
--
2.4.3
^ permalink raw reply related
* Re: [PATCH] staging: sm750fb: fix improper typedef usage
From: Sudip Mukherjee @ 2015-08-30 7:15 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <20150819022745.GA5960@brian_archtop.Home>
On Sat, Aug 29, 2015 at 05:58:50PM -0400, Brian Stottler wrote:
> On Thu, Aug 27, 2015 at 05:41:42PM +0530, Sudip Mukherjee wrote:
> > I think you need to update your tree. This patch will not apply due to
> > changes already done in some of the files.
>
> My mistake, thanks for the heads up. I will resubmit my corrected patch as soon
> as possible. Just to clarify, the tree in question is torvalds/linux.git,
> correct?
No, use Greg's staging-testing tree.
regards
sudip
^ permalink raw reply
* Re: [PATCH] staging: sm750fb: fix improper typedef usage
From: Brian Stottler @ 2015-08-29 21:58 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <20150819022745.GA5960@brian_archtop.Home>
On Thu, Aug 27, 2015 at 05:41:42PM +0530, Sudip Mukherjee wrote:
> I think you need to update your tree. This patch will not apply due to
> changes already done in some of the files.
My mistake, thanks for the heads up. I will resubmit my corrected patch as soon
as possible. Just to clarify, the tree in question is torvalds/linux.git,
correct?
Thanks,
Brian Stottler
^ permalink raw reply
* Re: [PATCH] S390: add pci_iomap_wc() and pci_iomap_wc_range()
From: Luis R. Rodriguez @ 2015-08-29 0:14 UTC (permalink / raw)
To: Guenter Roeck
Cc: Ingo Molnar, Luis R. Rodriguez, schwidefsky, heiko.carstens,
linux-s390, bp, plagnioj, tomi.valkeinen, linux-fbdev,
linux-kernel, fengguang.wu, akpm, rostedt, linux-arch
In-Reply-To: <55E01A43.9080109@roeck-us.net>
On Fri, Aug 28, 2015 at 01:22:27AM -0700, Guenter Roeck wrote:
> On 08/27/2015 11:06 PM, Ingo Molnar wrote:
> >
> >* Luis R. Rodriguez <mcgrof@do-not-panic.com> wrote:
> >
> >>From: "Luis R. Rodriguez" <mcgrof@suse.com>
> >>
> >>S390 requires its own implementation of pcio_iomap*() calls
> >>is because it has its "BAR spaces are not disjunctive on s390
> >>so we need the bar parameter of pci_iomap to find the corresponding
> >>device and create the mapping cookie" -- in summary, it has its own
> >>lookup/lock solution.
> >>
> >>It does not include asm-generic/pci_iomap.h
> >>
> >>Since it currenty maps ioremap_wc() to ioremap_nocache() and that's
> >>the architecture default we can easily just map the wc calls to
> >>the default calls as well.
> >>
> >>Cc: Guenter Roeck <linux@roeck-us.net>
> >>Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
> >>Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> >>Cc: linux-fbdev@vger.kernel.org
> >>Cc: linux-kernel@vger.kernel.org
> >>Cc: Borislav Petkov <bp@suse.de>
> >>Cc: Ingo Molnar <mingo@kernel.org>
> >>Cc: Fengguang Wu <fengguang.wu@intel.com>
> >>Cc: Andrew Morton <akpm@linux-foundation.org>
> >>Cc: Steven Rostedt <rostedt@goodmis.org>
> >>Reported-by: 0 day bot
> >>Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
> >>---
> >>
> >>This broke through some series that went into Ingo's tip tree which
> >>I added. As such I *think* this should go through Ingo's tip tree.
> >>Let me know. Up to you guys.
> >
> >I fixed the changelog to explain all this.
> >
> >Also, is there any other architecture that got broken by:
> >
> > 1b3d4200c1e0 PCI: Add pci_iomap_wc() variants
> >
>
> Should be the only one. There are only two implementations of pci_iomap(),
> one in s390 code and the generic implementation.
Indeed, sadly there is no semantics well defined to establish this requirement
so the best we can do is infer:
mcgrof@ergon ~/linux-next (git::20150805-pend-all)$ git grep pci_iomap_range arch/
arch/s390/include/asm/io.h:#define pci_iomap_wc_range pci_iomap_range
arch/s390/pci/pci.c:void __iomem *pci_iomap_range(struct pci_dev *pdev,
arch/s390/pci/pci.c:EXPORT_SYMBOL(pci_iomap_range);
arch/s390/pci/pci.c: return pci_iomap_range(dev, bar, 0, maxlen);
To this end a Kconfig option to implicate this might be more well suited for
future lookups and make other architectures which are incompatible with
generic pci_iomap clearer. Will post an RFC.
Luis
^ permalink raw reply
* [PATCH v4] OMAPDSS: hdmi: Reconfigure and restart audio when display is enabled
From: Jyri Sarha @ 2015-08-28 14:21 UTC (permalink / raw)
To: alsa-devel, linux-fbdev, linux-omap
Cc: peter.ujfalusi, tomi.valkeinen, Jyri Sarha
Reconfigure and restart audio when display is enabled, if audio
playback was active before. This is needed in a situation when an
audio+video stream application opens the audio stream before the
video. When video stream is opened the display mode may change and
that aborts audio playback, because the display is momentarily
turned off.
The audio configuration is stored when it is successfully applied and
a boolean is set when the audio playback is started and unset when
stopped. This data is used to reconfigure the audio when display is
re-enabled. The audio playback is aborted if the reconfiguration fails.
A new spin lock is introduced in order to protect state variables
related to audio playback status. This is needed for the transition
from display enabled state (when audio start/stop commands can be
written to HW) to display disabled state (when audio start/stop
commands update only the hdmi.audio_playing variable) to always
serialize correctly with the start/stop audio commands. The already
existing mutex can not be used, because the audio start and stop
commands are executed in atomic context.
For example: when display is turned back on we take the spinlock and
we can be sure that the audio start/stop status will not change while
we update the HW according to hdmi.audio_playing state and set
hdmi.display_enabled to true. After releasing the lock
hdmi.display_enabled is true and all audio_start and audio_stop
commands write their stuff directly to HW.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
Fixed one bad sentece in the description.
drivers/video/fbdev/omap2/dss/hdmi.h | 9 ++++-
drivers/video/fbdev/omap2/dss/hdmi4.c | 66 +++++++++++++++++++++++++-----
drivers/video/fbdev/omap2/dss/hdmi5.c | 76 ++++++++++++++++++++++++++++-------
3 files changed, 124 insertions(+), 27 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h
index e4a32fe..53616b0 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi.h
+++ b/drivers/video/fbdev/omap2/dss/hdmi.h
@@ -351,13 +351,20 @@ struct omap_hdmi {
struct regulator *vdda_reg;
bool core_enabled;
- bool display_enabled;
struct omap_dss_device output;
struct platform_device *audio_pdev;
void (*audio_abort_cb)(struct device *dev);
int wp_idlemode;
+
+ bool audio_configured;
+ struct omap_dss_audio audio_config;
+
+ /* This lock should be taken when booleans bellow are touched. */
+ spinlock_t audio_playing_lock;
+ bool audio_playing;
+ bool display_enabled;
};
#endif
diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c b/drivers/video/fbdev/omap2/dss/hdmi4.c
index 6d3aa3f..94c8d55 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi4.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi4.c
@@ -321,9 +321,22 @@ static int read_edid(u8 *buf, int len)
return r;
}
+static void hdmi_start_audio_stream(struct omap_hdmi *hd)
+{
+ hdmi_wp_audio_enable(&hd->wp, true);
+ hdmi4_audio_start(&hd->core, &hd->wp);
+}
+
+static void hdmi_stop_audio_stream(struct omap_hdmi *hd)
+{
+ hdmi4_audio_stop(&hd->core, &hd->wp);
+ hdmi_wp_audio_enable(&hd->wp, false);
+}
+
static int hdmi_display_enable(struct omap_dss_device *dssdev)
{
struct omap_dss_device *out = &hdmi.output;
+ unsigned long flags;
int r = 0;
DSSDBG("ENTER hdmi_display_enable\n");
@@ -342,7 +355,21 @@ static int hdmi_display_enable(struct omap_dss_device *dssdev)
goto err0;
}
+ if (hdmi.audio_configured) {
+ r = hdmi4_audio_config(&hdmi.core, &hdmi.wp, &hdmi.audio_config,
+ hdmi.cfg.timings.pixelclock);
+ if (r) {
+ DSSERR("Error restoring audio configuration: %d", r);
+ hdmi.audio_abort_cb(&hdmi.pdev->dev);
+ hdmi.audio_configured = false;
+ }
+ }
+
+ spin_lock_irqsave(&hdmi.audio_playing_lock, flags);
+ if (hdmi.audio_configured && hdmi.audio_playing)
+ hdmi_start_audio_stream(&hdmi);
hdmi.display_enabled = true;
+ spin_unlock_irqrestore(&hdmi.audio_playing_lock, flags);
mutex_unlock(&hdmi.lock);
return 0;
@@ -354,17 +381,19 @@ err0:
static void hdmi_display_disable(struct omap_dss_device *dssdev)
{
+ unsigned long flags;
+
DSSDBG("Enter hdmi_display_disable\n");
mutex_lock(&hdmi.lock);
- if (hdmi.audio_pdev && hdmi.audio_abort_cb)
- hdmi.audio_abort_cb(&hdmi.audio_pdev->dev);
+ spin_lock_irqsave(&hdmi.audio_playing_lock, flags);
+ hdmi_stop_audio_stream(&hdmi);
+ hdmi.display_enabled = false;
+ spin_unlock_irqrestore(&hdmi.audio_playing_lock, flags);
hdmi_power_off_full(dssdev);
- hdmi.display_enabled = false;
-
mutex_unlock(&hdmi.lock);
}
@@ -568,6 +597,8 @@ static int hdmi_audio_shutdown(struct device *dev)
mutex_lock(&hd->lock);
hd->audio_abort_cb = NULL;
+ hd->audio_configured = false;
+ hd->audio_playing = false;
mutex_unlock(&hd->lock);
return 0;
@@ -576,25 +607,34 @@ static int hdmi_audio_shutdown(struct device *dev)
static int hdmi_audio_start(struct device *dev)
{
struct omap_hdmi *hd = dev_get_drvdata(dev);
+ unsigned long flags;
WARN_ON(!hdmi_mode_has_audio(&hd->cfg));
- WARN_ON(!hd->display_enabled);
- hdmi_wp_audio_enable(&hd->wp, true);
- hdmi4_audio_start(&hd->core, &hd->wp);
+ spin_lock_irqsave(&hd->audio_playing_lock, flags);
+
+ if (hd->display_enabled)
+ hdmi_start_audio_stream(hd);
+ hd->audio_playing = true;
+ spin_unlock_irqrestore(&hd->audio_playing_lock, flags);
return 0;
}
static void hdmi_audio_stop(struct device *dev)
{
struct omap_hdmi *hd = dev_get_drvdata(dev);
+ unsigned long flags;
WARN_ON(!hdmi_mode_has_audio(&hd->cfg));
- WARN_ON(!hd->display_enabled);
- hdmi4_audio_stop(&hd->core, &hd->wp);
- hdmi_wp_audio_enable(&hd->wp, false);
+ spin_lock_irqsave(&hd->audio_playing_lock, flags);
+
+ if (hd->display_enabled)
+ hdmi_stop_audio_stream(hd);
+ hd->audio_playing = false;
+
+ spin_unlock_irqrestore(&hd->audio_playing_lock, flags);
}
static int hdmi_audio_config(struct device *dev,
@@ -612,7 +652,10 @@ static int hdmi_audio_config(struct device *dev,
ret = hdmi4_audio_config(&hd->core, &hd->wp, dss_audio,
hd->cfg.timings.pixelclock);
-
+ if (!ret) {
+ hd->audio_configured = true;
+ hd->audio_config = *dss_audio;
+ }
out:
mutex_unlock(&hd->lock);
@@ -657,6 +700,7 @@ static int hdmi4_bind(struct device *dev, struct device *master, void *data)
dev_set_drvdata(&pdev->dev, &hdmi);
mutex_init(&hdmi.lock);
+ spin_lock_init(&hdmi.audio_playing_lock);
if (pdev->dev.of_node) {
r = hdmi_probe_of(pdev);
diff --git a/drivers/video/fbdev/omap2/dss/hdmi5.c b/drivers/video/fbdev/omap2/dss/hdmi5.c
index 7f87578..b6c767b 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi5.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi5.c
@@ -349,9 +349,24 @@ static int read_edid(u8 *buf, int len)
return r;
}
+static void hdmi_start_audio_stream(struct omap_hdmi *hd)
+{
+ REG_FLD_MOD(hdmi.wp.base, HDMI_WP_SYSCONFIG, 1, 3, 2);
+ hdmi_wp_audio_enable(&hd->wp, true);
+ hdmi_wp_audio_core_req_enable(&hd->wp, true);
+}
+
+static void hdmi_stop_audio_stream(struct omap_hdmi *hd)
+{
+ hdmi_wp_audio_core_req_enable(&hd->wp, false);
+ hdmi_wp_audio_enable(&hd->wp, false);
+ REG_FLD_MOD(hd->wp.base, HDMI_WP_SYSCONFIG, hd->wp_idlemode, 3, 2);
+}
+
static int hdmi_display_enable(struct omap_dss_device *dssdev)
{
struct omap_dss_device *out = &hdmi.output;
+ unsigned long flags;
int r = 0;
DSSDBG("ENTER hdmi_display_enable\n");
@@ -370,7 +385,21 @@ static int hdmi_display_enable(struct omap_dss_device *dssdev)
goto err0;
}
+ if (hdmi.audio_configured) {
+ r = hdmi5_audio_config(&hdmi.core, &hdmi.wp, &hdmi.audio_config,
+ hdmi.cfg.timings.pixelclock);
+ if (r) {
+ DSSERR("Error restoring audio configuration: %d", r);
+ hdmi.audio_abort_cb(&hdmi.pdev->dev);
+ hdmi.audio_configured = false;
+ }
+ }
+
+ spin_lock_irqsave(&hdmi.audio_playing_lock, flags);
+ if (hdmi.audio_configured && hdmi.audio_playing)
+ hdmi_start_audio_stream(&hdmi);
hdmi.display_enabled = true;
+ spin_unlock_irqrestore(&hdmi.audio_playing_lock, flags);
mutex_unlock(&hdmi.lock);
return 0;
@@ -382,17 +411,19 @@ err0:
static void hdmi_display_disable(struct omap_dss_device *dssdev)
{
+ unsigned long flags;
+
DSSDBG("Enter hdmi_display_disable\n");
mutex_lock(&hdmi.lock);
- if (hdmi.audio_pdev && hdmi.audio_abort_cb)
- hdmi.audio_abort_cb(&hdmi.audio_pdev->dev);
+ spin_lock_irqsave(&hdmi.audio_playing_lock, flags);
+ hdmi_stop_audio_stream(&hdmi);
+ hdmi.display_enabled = false;
+ spin_unlock_irqrestore(&hdmi.audio_playing_lock, flags);
hdmi_power_off_full(dssdev);
- hdmi.display_enabled = false;
-
mutex_unlock(&hdmi.lock);
}
@@ -596,6 +627,8 @@ static int hdmi_audio_shutdown(struct device *dev)
mutex_lock(&hd->lock);
hd->audio_abort_cb = NULL;
+ hd->audio_configured = false;
+ hd->audio_playing = false;
mutex_unlock(&hd->lock);
return 0;
@@ -604,32 +637,35 @@ static int hdmi_audio_shutdown(struct device *dev)
static int hdmi_audio_start(struct device *dev)
{
struct omap_hdmi *hd = dev_get_drvdata(dev);
+ unsigned long flags;
WARN_ON(!hdmi_mode_has_audio(&hd->cfg));
- WARN_ON(!hd->display_enabled);
- /* No-idle while playing audio, store the old value */
- hd->wp_idlemode = REG_GET(hdmi.wp.base, HDMI_WP_SYSCONFIG, 3, 2);
- REG_FLD_MOD(hdmi.wp.base, HDMI_WP_SYSCONFIG, 1, 3, 2);
+ spin_lock_irqsave(&hd->audio_playing_lock, flags);
- hdmi_wp_audio_enable(&hd->wp, true);
- hdmi_wp_audio_core_req_enable(&hd->wp, true);
+ if (hd->display_enabled) {
+ hdmi_start_audio_stream(hd);
+ }
+ hd->audio_playing = true;
+ spin_unlock_irqrestore(&hd->audio_playing_lock, flags);
return 0;
}
static void hdmi_audio_stop(struct device *dev)
{
struct omap_hdmi *hd = dev_get_drvdata(dev);
+ unsigned long flags;
WARN_ON(!hdmi_mode_has_audio(&hd->cfg));
- WARN_ON(!hd->display_enabled);
- hdmi_wp_audio_core_req_enable(&hd->wp, false);
- hdmi_wp_audio_enable(&hd->wp, false);
+ spin_lock_irqsave(&hd->audio_playing_lock, flags);
+
+ if (hd->display_enabled)
+ hdmi_stop_audio_stream(hd);
+ hd->audio_playing = false;
- /* Playback stopped, restore original idlemode */
- REG_FLD_MOD(hdmi.wp.base, HDMI_WP_SYSCONFIG, hd->wp_idlemode, 3, 2);
+ spin_unlock_irqrestore(&hd->audio_playing_lock, flags);
}
static int hdmi_audio_config(struct device *dev,
@@ -648,6 +684,10 @@ static int hdmi_audio_config(struct device *dev,
ret = hdmi5_audio_config(&hd->core, &hd->wp, dss_audio,
hd->cfg.timings.pixelclock);
+ if (!ret) {
+ hd->audio_configured = true;
+ hd->audio_config = *dss_audio;
+ }
out:
mutex_unlock(&hd->lock);
@@ -678,6 +718,11 @@ static int hdmi_audio_register(struct device *dev)
if (IS_ERR(hdmi.audio_pdev))
return PTR_ERR(hdmi.audio_pdev);
+ hdmi_runtime_get();
+ hdmi.wp_idlemode + REG_GET(hdmi.wp.base, HDMI_WP_SYSCONFIG, 3, 2);
+ hdmi_runtime_put();
+
return 0;
}
@@ -692,6 +737,7 @@ static int hdmi5_bind(struct device *dev, struct device *master, void *data)
dev_set_drvdata(&pdev->dev, &hdmi);
mutex_init(&hdmi.lock);
+ spin_lock_init(&hdmi.audio_playing_lock);
if (pdev->dev.of_node) {
r = hdmi_probe_of(pdev);
--
1.9.1
^ 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