* Re: [PATCH v2 4/4] backlight/lp855x: Remove CONFIG_OF ifdef in favor of Kconfig depends
From: Jingoo Han @ 2014-12-09 1:36 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1418077278-14144-4-git-send-email-seanpaul@chromium.org>
On Tuesday, December 09, 2014 7:21 AM, Sean Paul wrote:
>
> Now that we've removed all traces of pdata, remove the CONFIG_OF ifdef
> from lp855x and instead make the driver depend on OF.
>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Best regards,
Jingoo Han
> ---
> Changes in v2:
> - Remove of_match_ptr() wrapper
>
> drivers/video/backlight/Kconfig | 2 +-
> drivers/video/backlight/lp855x_bl.c | 9 +--------
> 2 files changed, 2 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
> index 8d03924..113c8b3 100644
> --- a/drivers/video/backlight/Kconfig
> +++ b/drivers/video/backlight/Kconfig
> @@ -384,7 +384,7 @@ config BACKLIGHT_LM3639
>
> config BACKLIGHT_LP855X
> tristate "Backlight driver for TI LP855X"
> - depends on BACKLIGHT_CLASS_DEVICE && I2C && PWM
> + depends on BACKLIGHT_CLASS_DEVICE && I2C && PWM && OF
> help
> This supports TI LP8550, LP8551, LP8552, LP8553, LP8555, LP8556 and
> LP8557 backlight driver.
> diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c
> index 6530d60..f0a85f5 100644
> --- a/drivers/video/backlight/lp855x_bl.c
> +++ b/drivers/video/backlight/lp855x_bl.c
> @@ -379,7 +379,6 @@ static const struct attribute_group lp855x_attr_group = {
> .attrs = lp855x_attributes,
> };
>
> -#ifdef CONFIG_OF
> static int lp855x_parse_dt(struct lp855x *lp)
> {
> struct device *dev = lp->dev;
> @@ -426,12 +425,6 @@ static int lp855x_parse_dt(struct lp855x *lp)
>
> return 0;
> }
> -#else
> -static int lp855x_parse_dt(struct lp855x *lp)
> -{
> - return -EINVAL;
> -}
> -#endif
>
> static int lp855x_probe(struct i2c_client *cl, const struct i2c_device_id *id)
> {
> @@ -532,7 +525,7 @@ MODULE_DEVICE_TABLE(i2c, lp855x_ids);
> static struct i2c_driver lp855x_driver = {
> .driver = {
> .name = "lp855x",
> - .of_match_table = of_match_ptr(lp855x_dt_ids),
> + .of_match_table = lp855x_dt_ids,
> },
> .probe = lp855x_probe,
> .remove = lp855x_remove,
> --
> 2.1.1
^ permalink raw reply
* Re: [PATCH v2 2/2] backlight/lp855x: Add supply regulator to lp855x
From: Kim, Milo @ 2014-12-09 3:03 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sean Paul, cooloney-Re5JQEeQqe8AvxtiuMwx3w,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA, jg1.han-Sze3O3UU22JBDgjK7y7TUQ,
lee.jones-QSEj5FYQhm4dnm+yROfE0A, Stéphane Marchesin,
Aaron Durbin
In-Reply-To: <5204192.bzM5jPIgHv@wuerfel>
Hi Arnd,
Good to talk to you again. It's been a long time since I met you in
Linaro Connect HK few years ago :)
On 12/3/2014 11:11 PM, Arnd Bergmann wrote:
> While your two patches are both correct (and applied already), I took
> a look at the platform_data header and noticed that all users of this
> file have been converted to DT a while ago, so it would be nice to clean
> it up by integrating the linux/platform_data/lp855x.h header file into the
> drivers/video/backlight/lp855x_bl.c itself.
I like this cleanup but need to consider few things.
- Platform which does not support the DT
In this case, there is no way to configure options like backlight device
control mode. Without the DT, only default options are set.
To change the settings, the driver modification is required.
I don't want to write project/platform dependency code inside the driver.
- Backward compatibility
Some customers have been using this platform data in their board-*.c
(but this *.c has not been mainlined yet).
My concern is the backward compatibility issue may happen in their projects.
Best regards,
Milo
^ permalink raw reply
* Re: [PATCH v2 2/2] backlight/lp855x: Add supply regulator to lp855x
From: Jingoo Han @ 2014-12-09 3:46 UTC (permalink / raw)
To: 'Kim, Milo', 'Arnd Bergmann'
Cc: 'Sean Paul', cooloney-Re5JQEeQqe8AvxtiuMwx3w,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
lee.jones-QSEj5FYQhm4dnm+yROfE0A,
'Stéphane Marchesin', 'Aaron Durbin',
'Jingoo Han'
In-Reply-To: <54866695.3050307-l0cyMroinI0@public.gmane.org>
On Tuesday, December 09, 2014 12:04 PM, Kim, Milo wrote:
>
> Hi Arnd,
>
> Good to talk to you again. It's been a long time since I met you in
> Linaro Connect HK few years ago :)
>
> On 12/3/2014 11:11 PM, Arnd Bergmann wrote:
> > While your two patches are both correct (and applied already), I took
> > a look at the platform_data header and noticed that all users of this
> > file have been converted to DT a while ago, so it would be nice to clean
> > it up by integrating the linux/platform_data/lp855x.h header file into the
> > drivers/video/backlight/lp855x_bl.c itself.
>
> I like this cleanup but need to consider few things.
>
> - Platform which does not support the DT
> In this case, there is no way to configure options like backlight device
> control mode. Without the DT, only default options are set.
> To change the settings, the driver modification is required.
> I don't want to write project/platform dependency code inside the driver.
>
> - Backward compatibility
> Some customers have been using this platform data in their board-*.c
> (but this *.c has not been mainlined yet).
> My concern is the backward compatibility issue may happen in their projects.
I understand this situation. In the case of Exynos DisplayPort driver,
a similar issue happened. At that time, the conclusion was that
out-of-tree code (not mainlined yet) cannot be considered.
In this context, it is valuable to upstream the code to mainline kernel.
I think that one of the followings can be considered.
1. Ask customers to upstream their machine code
2. Ask customers to use DT
If they don't want to these things, someone (you or customers)
will need to make the patch for non-DT support, whenever new
kernel is released and is used by projects not supporting DT.
Best regards,
Jingoo Han
>
> Best regards,
> Milo
^ permalink raw reply
* Re: [PATCH v2 2/2] backlight/lp855x: Add supply regulator to lp855x
From: Arnd Bergmann @ 2014-12-09 8:13 UTC (permalink / raw)
To: Jingoo Han
Cc: 'Kim, Milo', 'Sean Paul',
cooloney-Re5JQEeQqe8AvxtiuMwx3w,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
lee.jones-QSEj5FYQhm4dnm+yROfE0A,
'Stéphane Marchesin', 'Aaron Durbin'
In-Reply-To: <000a01d01362$aee684d0$0cb38e70$%han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
On Tuesday 09 December 2014 12:46:15 Jingoo Han wrote:
> On Tuesday, December 09, 2014 12:04 PM, Kim, Milo wrote:
> >
> > Hi Arnd,
> >
> > Good to talk to you again. It's been a long time since I met you in
> > Linaro Connect HK few years ago
> >
> > On 12/3/2014 11:11 PM, Arnd Bergmann wrote:
> > > While your two patches are both correct (and applied already), I took
> > > a look at the platform_data header and noticed that all users of this
> > > file have been converted to DT a while ago, so it would be nice to clean
> > > it up by integrating the linux/platform_data/lp855x.h header file into the
> > > drivers/video/backlight/lp855x_bl.c itself.
> >
> > I like this cleanup but need to consider few things.
> >
> > - Platform which does not support the DT
> > In this case, there is no way to configure options like backlight device
> > control mode. Without the DT, only default options are set.
> > To change the settings, the driver modification is required.
> > I don't want to write project/platform dependency code inside the driver.
> >
> > - Backward compatibility
> > Some customers have been using this platform data in their board-*.c
> > (but this *.c has not been mainlined yet).
> > My concern is the backward compatibility issue may happen in their projects.
>
> I understand this situation. In the case of Exynos DisplayPort driver,
> a similar issue happened. At that time, the conclusion was that
> out-of-tree code (not mainlined yet) cannot be considered.
Right. Basically when the only reason to have code in the kernel is
to support someone with an out-of-tree patch set, they can be expected
to add the extra bit to their patch set, it doesn't add any extra burden
to them, and it makes our lives easier.
Arnd
^ permalink raw reply
* Re: [PATCH v2 1/4] backlight/lp855x: Remove stale code from lp855x.h
From: Arnd Bergmann @ 2014-12-09 8:39 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1418077278-14144-1-git-send-email-seanpaul@chromium.org>
On Monday 08 December 2014 17:21:15 Sean Paul wrote:
> These aren't used by anyone, remove them.
>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
Very nicely done series!
All four patches
Acked-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply
* using fb1
From: Sudip Mukherjee @ 2014-12-09 14:39 UTC (permalink / raw)
To: linux-fbdev
hi,
I am starting to work with SM712 driver which was in drivers/staging, but then removed. I have a demoboard of SM712, and testing the existing code on it.
After the module is inserted the board is initialized, and /dev/fb1 is successfully created. But after that how do i test? how do i confugure ubuntu to use that /dev/fb1 ?
I know it is not the proper place to post this, and I should have posted in some ubuntu specific forum or list, but i thought this will be the best place to get the best answer.
Looking forward for some pointer or some idea / hints in this regard.
thanks
sudip
^ permalink raw reply
* Re: FOSDEM15: Graphics DevRoom: call for speakers.
From: Luc Verhaegen @ 2014-12-09 14:39 UTC (permalink / raw)
To: mesa-dev, xorg-devel, wayland-devel, mir-devel, directfb-dev,
linux-fbdev, linux-media
Cc: dri-devel, xorg, xorg-announce
In-Reply-To: <20141002174457.GA11725@skynet.be>
On Thu, Oct 02, 2014 at 07:44:57PM +0200, Luc Verhaegen wrote:
> Hi,
>
> At FOSDEM on the 31st of january and the 1st of February 2015, there
> will be another graphics DevRoom. URL: https://fosdem.org/2015/
> Slots will be handed out on a first come, first serve basis. The best
> slots will go to those who apply the earliest. The amount of slots is
> currently not known yet, but i expect there to be around 16 available (8
> on each day), so act quickly.
> As for deadlines, i hope to have a pretty much complete schedule between
> christmas and the new year. The rockhard printed schedule deadline is
> probably January 9th, after that you will not be featured in the booklet
> and you will have a lot less visitors. I will hopefully be able to lock
> down entries and descriptions after that date.
It's been more than 2 months since the original email, it's less than
two months away from the event, and one month away from what usually is
the deadline for the booklet. File your talk now, while there are still
some useful slots available.
Also, for those who have filed already but who have left their abstracts
open, please get those filed in ASAP. Your talk will be only be ordered
in when at least the basics are provided.
Thanks,
Luc Verhaegen.
^ permalink raw reply
* Compiled tridentfb hangs but distribution kernel works fine
From: Ondrej Zary @ 2014-12-09 21:33 UTC (permalink / raw)
To: linux-fbdev; +Cc: Kernel development list
Hello,
I'm doing some work on tridentfb driver but encountered a weird problem.
When I compile custom kernel with tridentfb, it hangs with Blade3D card (ID
0x9880) in blade_image_blit(). The screen is blank with some artifacts and
machine does not respond to ping or keyboard. However, it can be rebooted by
Alt+SysRq+B. It works fine with other cards (3DImage 9750 and CyberBlade XP)
with no blit implementation. Commenting out contents of blade_image_blit()
function makes the hang go away (nothing useful on the screen, of course).
The weird thing is that the Blade3D card works fine when I load Debian
kernels! Debian 3.16-0.bpo.3-686-pae works fine but when I compile 3.16
kernel, it hangs.
Any ideas?
--
Ondrej Zary
^ permalink raw reply
* Re: Compiled tridentfb hangs but distribution kernel works fine
From: Mike Galbraith @ 2014-12-10 7:15 UTC (permalink / raw)
To: Ondrej Zary; +Cc: linux-fbdev, Kernel development list
In-Reply-To: <201412092233.17030.linux@rainbow-software.org>
On Tue, 2014-12-09 at 22:33 +0100, Ondrej Zary wrote:
> Hello,
> I'm doing some work on tridentfb driver but encountered a weird problem.
>
> When I compile custom kernel with tridentfb, it hangs with Blade3D card (ID
> 0x9880) in blade_image_blit(). The screen is blank with some artifacts and
> machine does not respond to ping or keyboard. However, it can be rebooted by
> Alt+SysRq+B. It works fine with other cards (3DImage 9750 and CyberBlade XP)
> with no blit implementation. Commenting out contents of blade_image_blit()
> function makes the hang go away (nothing useful on the screen, of course).
>
> The weird thing is that the Blade3D card works fine when I load Debian
> kernels! Debian 3.16-0.bpo.3-686-pae works fine but when I compile 3.16
> kernel, it hangs.
>
> Any ideas?
I'd start by looking for what Debian changed in source and/or config.
-Mike
^ permalink raw reply
* [PATCH] fbdev: vgastate: remove trailing whitespaces
From: Asaf Vertz @ 2014-12-11 9:04 UTC (permalink / raw)
To: plagnioj; +Cc: tomi.valkeinen, linux-fbdev, linux-kernel
Fixed a coding style error, trailing whitespace.
Signed-off-by: Asaf Vertz <asaf.vertz@tandemg.com>
---
drivers/video/vgastate.c | 82 +++++++++++++++++++++++-----------------------
1 files changed, 41 insertions(+), 41 deletions(-)
diff --git a/drivers/video/vgastate.c b/drivers/video/vgastate.c
index b91c466..548c751 100644
--- a/drivers/video/vgastate.c
+++ b/drivers/video/vgastate.c
@@ -2,7 +2,7 @@
* linux/drivers/video/vgastate.c -- VGA state save/restore
*
* Copyright 2002 James Simmons
- *
+ *
* Copyright history from vga16fb.c:
* Copyright 1999 Ben Pfaff and Petr Vandrovec
* Based on VGA info at http://www.goodnet.com/~tinara/FreeVGA/home.htm
@@ -10,7 +10,7 @@
*
* 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.
+ * archive for more details.
*
*/
#include <linux/module.h>
@@ -29,16 +29,16 @@ struct regstate {
__u8 *gfx;
__u8 *seq;
__u8 misc;
-};
+};
-static inline unsigned char vga_rcrtcs(void __iomem *regbase, unsigned short iobase,
+static inline unsigned char vga_rcrtcs(void __iomem *regbase, unsigned short iobase,
unsigned char reg)
{
vga_w(regbase, iobase + 0x4, reg);
return vga_r(regbase, iobase + 0x5);
}
-static inline void vga_wcrtcs(void __iomem *regbase, unsigned short iobase,
+static inline void vga_wcrtcs(void __iomem *regbase, unsigned short iobase,
unsigned char reg, unsigned char val)
{
vga_w(regbase, iobase + 0x4, reg);
@@ -71,7 +71,7 @@ static void save_vga_text(struct vgastate *state, void __iomem *fbbase)
gr6 = vga_rgfx(state->vgabase, VGA_GFX_MISC);
seq2 = vga_rseq(state->vgabase, VGA_SEQ_PLANE_WRITE);
seq4 = vga_rseq(state->vgabase, VGA_SEQ_MEMORY_MODE);
-
+
/* blank screen */
seq1 = vga_rseq(state->vgabase, VGA_SEQ_CLOCK_MODE);
vga_wseq(state->vgabase, VGA_SEQ_RESET, 0x1);
@@ -85,7 +85,7 @@ static void save_vga_text(struct vgastate *state, void __iomem *fbbase)
vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x2);
vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
- for (i = 0; i < 4 * 8192; i++)
+ for (i = 0; i < 4 * 8192; i++)
saved->vga_font0[i] = vga_r(fbbase, i);
}
@@ -96,10 +96,10 @@ static void save_vga_text(struct vgastate *state, void __iomem *fbbase)
vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x3);
vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
- for (i = 0; i < state->memsize; i++)
+ for (i = 0; i < state->memsize; i++)
saved->vga_font1[i] = vga_r(fbbase, i);
}
-
+
/* save font at plane 0/1 */
if (state->flags & VGA_SAVE_TEXT) {
vga_wseq(state->vgabase, VGA_SEQ_PLANE_WRITE, 0x1);
@@ -107,7 +107,7 @@ static void save_vga_text(struct vgastate *state, void __iomem *fbbase)
vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x0);
vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
- for (i = 0; i < 8192; i++)
+ for (i = 0; i < 8192; i++)
saved->vga_text[i] = vga_r(fbbase, i);
vga_wseq(state->vgabase, VGA_SEQ_PLANE_WRITE, 0x2);
@@ -115,8 +115,8 @@ static void save_vga_text(struct vgastate *state, void __iomem *fbbase)
vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x1);
vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
- for (i = 0; i < 8192; i++)
- saved->vga_text[8192+i] = vga_r(fbbase + 2 * 8192, i);
+ for (i = 0; i < 8192; i++)
+ saved->vga_text[8192+i] = vga_r(fbbase + 2 * 8192, i);
}
/* restore regs */
@@ -151,7 +151,7 @@ static void restore_vga_text(struct vgastate *state, void __iomem *fbbase)
gr8 = vga_rgfx(state->vgabase, VGA_GFX_BIT_MASK);
seq2 = vga_rseq(state->vgabase, VGA_SEQ_PLANE_WRITE);
seq4 = vga_rseq(state->vgabase, VGA_SEQ_MEMORY_MODE);
-
+
/* blank screen */
seq1 = vga_rseq(state->vgabase, VGA_SEQ_CLOCK_MODE);
vga_wseq(state->vgabase, VGA_SEQ_RESET, 0x1);
@@ -163,7 +163,7 @@ static void restore_vga_text(struct vgastate *state, void __iomem *fbbase)
vga_wgfx(state->vgabase, VGA_GFX_BIT_MASK, 0xff);
vga_wgfx(state->vgabase, VGA_GFX_SR_ENABLE, 0x00);
}
-
+
/* restore font at plane 2 */
if (state->flags & VGA_SAVE_FONT0) {
vga_wseq(state->vgabase, VGA_SEQ_PLANE_WRITE, 0x4);
@@ -171,7 +171,7 @@ static void restore_vga_text(struct vgastate *state, void __iomem *fbbase)
vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x2);
vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
- for (i = 0; i < 4 * 8192; i++)
+ for (i = 0; i < 4 * 8192; i++)
vga_w(fbbase, i, saved->vga_font0[i]);
}
@@ -182,10 +182,10 @@ static void restore_vga_text(struct vgastate *state, void __iomem *fbbase)
vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x3);
vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
- for (i = 0; i < state->memsize; i++)
+ for (i = 0; i < state->memsize; i++)
vga_w(fbbase, i, saved->vga_font1[i]);
}
-
+
/* restore font at plane 0/1 */
if (state->flags & VGA_SAVE_TEXT) {
vga_wseq(state->vgabase, VGA_SEQ_PLANE_WRITE, 0x1);
@@ -193,16 +193,16 @@ static void restore_vga_text(struct vgastate *state, void __iomem *fbbase)
vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x0);
vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
- for (i = 0; i < 8192; i++)
+ for (i = 0; i < 8192; i++)
vga_w(fbbase, i, saved->vga_text[i]);
-
+
vga_wseq(state->vgabase, VGA_SEQ_PLANE_WRITE, 0x2);
vga_wseq(state->vgabase, VGA_SEQ_MEMORY_MODE, 0x6);
vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x1);
vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
- for (i = 0; i < 8192; i++)
- vga_w(fbbase, i, saved->vga_text[8192+i]);
+ for (i = 0; i < 8192; i++)
+ vga_w(fbbase, i, saved->vga_text[8192+i]);
}
/* unblank screen */
@@ -222,7 +222,7 @@ static void restore_vga_text(struct vgastate *state, void __iomem *fbbase)
vga_wseq(state->vgabase, VGA_SEQ_PLANE_WRITE, seq2);
vga_wseq(state->vgabase, VGA_SEQ_MEMORY_MODE, seq4);
}
-
+
static void save_vga_mode(struct vgastate *state)
{
struct regstate *saved = (struct regstate *) state->vidstate;
@@ -235,10 +235,10 @@ static void save_vga_mode(struct vgastate *state)
else
iobase = 0x3b0;
- for (i = 0; i < state->num_crtc; i++)
+ for (i = 0; i < state->num_crtc; i++)
saved->crtc[i] = vga_rcrtcs(state->vgabase, iobase, i);
-
- vga_r(state->vgabase, iobase + 0xa);
+
+ vga_r(state->vgabase, iobase + 0xa);
vga_w(state->vgabase, VGA_ATT_W, 0x00);
for (i = 0; i < state->num_attr; i++) {
vga_r(state->vgabase, iobase + 0xa);
@@ -247,10 +247,10 @@ static void save_vga_mode(struct vgastate *state)
vga_r(state->vgabase, iobase + 0xa);
vga_w(state->vgabase, VGA_ATT_W, 0x20);
- for (i = 0; i < state->num_gfx; i++)
+ for (i = 0; i < state->num_gfx; i++)
saved->gfx[i] = vga_rgfx(state->vgabase, i);
- for (i = 0; i < state->num_seq; i++)
+ for (i = 0; i < state->num_seq; i++)
saved->seq[i] = vga_rseq(state->vgabase, i);
}
@@ -268,26 +268,26 @@ static void restore_vga_mode(struct vgastate *state)
iobase = 0x3b0;
/* turn off display */
- vga_wseq(state->vgabase, VGA_SEQ_CLOCK_MODE,
+ vga_wseq(state->vgabase, VGA_SEQ_CLOCK_MODE,
saved->seq[VGA_SEQ_CLOCK_MODE] | 0x20);
/* disable sequencer */
vga_wseq(state->vgabase, VGA_SEQ_RESET, 0x01);
-
+
/* enable palette addressing */
vga_r(state->vgabase, iobase + 0xa);
vga_w(state->vgabase, VGA_ATT_W, 0x00);
- for (i = 2; i < state->num_seq; i++)
+ for (i = 2; i < state->num_seq; i++)
vga_wseq(state->vgabase, i, saved->seq[i]);
/* unprotect vga regs */
vga_wcrtcs(state->vgabase, iobase, 17, saved->crtc[17] & ~0x80);
- for (i = 0; i < state->num_crtc; i++)
+ for (i = 0; i < state->num_crtc; i++)
vga_wcrtcs(state->vgabase, iobase, i, saved->crtc[i]);
-
- for (i = 0; i < state->num_gfx; i++)
+
+ for (i = 0; i < state->num_gfx; i++)
vga_wgfx(state->vgabase, i, saved->gfx[i]);
for (i = 0; i < state->num_attr; i++) {
@@ -298,7 +298,7 @@ static void restore_vga_mode(struct vgastate *state)
/* reenable sequencer */
vga_wseq(state->vgabase, VGA_SEQ_RESET, 0x03);
/* turn display on */
- vga_wseq(state->vgabase, VGA_SEQ_CLOCK_MODE,
+ vga_wseq(state->vgabase, VGA_SEQ_CLOCK_MODE,
saved->seq[VGA_SEQ_CLOCK_MODE] & ~(1 << 5));
/* disable video/palette source */
@@ -312,7 +312,7 @@ static void save_vga_cmap(struct vgastate *state)
int i;
vga_w(state->vgabase, VGA_PEL_MSK, 0xff);
-
+
/* assumes DAC is readable and writable */
vga_w(state->vgabase, VGA_PEL_IR, 0x00);
for (i = 0; i < 768; i++)
@@ -346,7 +346,7 @@ static void vga_cleanup(struct vgastate *state)
state->vidstate = NULL;
}
}
-
+
int save_vga(struct vgastate *state)
{
struct regstate *saved;
@@ -357,7 +357,7 @@ int save_vga(struct vgastate *state)
return 1;
state->vidstate = (void *)saved;
-
+
if (state->flags & VGA_SAVE_CMAP) {
saved->vga_cmap = vmalloc(768);
if (!saved->vga_cmap) {
@@ -403,7 +403,7 @@ int save_vga(struct vgastate *state)
}
if (!state->memsize)
state->memsize = 8 * 8192;
-
+
if (!state->membase)
state->membase = 0xA0000;
@@ -414,7 +414,7 @@ int save_vga(struct vgastate *state)
return 1;
}
- /*
+ /*
* save only first 32K used by vgacon
*/
if (state->flags & VGA_SAVE_FONT0) {
@@ -425,7 +425,7 @@ int save_vga(struct vgastate *state)
return 1;
}
}
- /*
+ /*
* largely unused, but if required by the caller
* we'll just save everything.
*/
@@ -448,7 +448,7 @@ int save_vga(struct vgastate *state)
return 1;
}
}
-
+
save_vga_text(state, fbbase);
iounmap(fbbase);
}
--
1.7.0.4
^ permalink raw reply related
* [GIT PULL] fbdev fixes for 3.19
From: Tomi Valkeinen @ 2014-12-11 13:41 UTC (permalink / raw)
To: Linus Torvalds; +Cc: LKML, Linux Fbdev development list, Mark Brown
[-- Attachment #1: Type: text/plain, Size: 10534 bytes --]
Hi Linus,
Please pull fbdev changes for 3.19.
Tomi
The following changes since commit 0df1f2487d2f0d04703f142813d53615d62a1da4:
Linux 3.18-rc3 (2014-11-02 15:01:51 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux.git tags/fbdev-3.19
for you to fetch changes up to 3315764efceaccfb02c7d4c99ef8eed6716cd861:
Merge branches '3.19/omapdss' and '3.19/simplefb' into fbdev (2014-12-08 09:16:31 +0200)
----------------------------------------------------------------
fbdev changes for 3.19
* support for mx6sl and mx6sx
* OMAP HDMI audio rewrite to make it finally work
* OMAP video PLL work to prepare for new DRA7xx SoCs
* simplefb DT related improvements
----------------------------------------------------------------
Alexey Khoroshilov (1):
m501fb: don't return zero on failure path in sm501fb_probe()
Archit Taneja (7):
OMAPDSS: DPI: Use DPI driver data
OMAPDSS: DPI: Allocate driver data
OMAPDSS: DPI: Store dpi_data pointer in the DT port's data
OMAPDSS: DSS: init dss ports cleanly
OMAPDSS: DT: Get source endpoint by matching reg-id
OMAPDSS: DPI: Add support for multiple instances
OMAPDSS: DSS: add a param to dpi_select_source which specifies it's port number
Fabio Estevam (1):
fbdev: mxsfb: Add support for mx6sl and mx6sx
Hans de Goede (10):
simplefb: Add simplefb MAINTAINERS entry
dt-bindings: Add a clocks property to the simple-framebuffer binding
dt-bindings: simplefb: Specify node location and handoff related properties
of.h: Keep extern declaration of of_* variables when !CONFIG_OF
simplefb: Add support for enumerating simplefb dt nodes in /chosen
fbcon: Change fbcon_init from module_init to fs_initcall
simplefb: Change simplefb_init from module_init to fs_initcall
simplefb: Fix build errors when CONFIG_COMMON_CLK is not defined
dt-bindings: simplefb: Drop the advice about using a specific path for nodes
dt-bindings: simplefb-sunxi: Add sunxi simplefb extensions
Jyri Sarha (21):
OMAPDSS: hdmi_wp: Protect reserved bits in hdmi_wp_audio_config_format()
OMAPDSS: hdmi5_core: Initialize mandatory sample_order parameter
OMAPDSS: hdmi.h: Add HDMI_AUDIO_LAYOUT_6CH enum value
OMAPDSS: hdmi: Remove most of OMAP[45]_DSS_HDMI_AUDIO ifdefs
OMAPDSS: hdmi4_core: Remove unused hdmi4_audio_get_dma_port()
OMAPDSS: hdmi_wp: Add function for getting audio dma address
OMAPDSS: hdmi: Make hdmi structure public
OMAPDSS: hdmi: Add pdev pointer for audio_pdev in HDMI DRV data
OMAPDSS: hdmi.h: Add members to hdmi drvdata for audio implementation
ASoC: omap-hdmi-audio: Add platform device for OMAP HDMI audio support
OMAPDSS: Kconfig: Remove HDMI audio booleans from Kconfig
OMAPDSS: hdmi: Make hdmi_mode_has_audio() more user friedly
OMAPDSS: hdmi4: Remove callbacks for the old ASoC DAI driver
OMAPDSS: hdmi4: Register ASoC platform device for omap hdmi audio
OMAPDSS: hdmi5: Remove callbacks for the old ASoC DAI driver
OMAPDSS: hdmi5: Register ASoC platform device for omap hdmi audio
ASoC: omap: Remove obsolete HDMI audio code and Kconfig options
OMAPDSS: Remove all references to obsolete HDMI audio callbacks
OMAPDSS: hdmi5: Change hdmi_wp idlemode to to no_idle for audio playback
OMAPDSS: hdmi: Remove __exit qualifier from hdmi_uninit_output()
OMAPDSS: hdmi5: Fix bit field for IEC958_AES2_CON_SOURCE
Lad, Prabhakar (3):
video: fbdev: vt8623fb: suppress build warning
video: fbdev: s3fb: suppress build warning
video: fbdev: arkfb: suppress build warning
Luc Verhaegen (3):
simplefb: formalize pseudo palette handling
simplefb: add goto error path to probe
simplefb: add clock handling code
Markus Elfring (12):
video: fbdev-MMP: Fix typos for the word "destroy"
video: fbdev-MMP: Fix a typo for the word "destroyed"
video: fbdev-LCDC: Deletion of an unnecessary check before the function call "vfree"
video: uvesafb: Deletion of an unnecessary check before the function call "uvesafb_free"
video: udlfb: Deletion of unnecessary checks before the function call "vfree"
video: smscufx: Deletion of unnecessary checks before the function call "vfree"
video: fbdev-SIS: Deletion of unnecessary checks before the function call "pci_dev_put"
video: fbdev-OMAP2: Deletion of unnecessary checks before the function call "i2c_put_adapter"
video: mx3fb: Deletion of an unnecessary check before the function call "backlight_device_unregister"
video: fbdev-MMP: Deletion of an unnecessary check before the function call "mmp_unregister_path"
video: fbdev-VIA: Deletion of an unnecessary check before the function call "framebuffer_release"
video: uvesafb: Deletion of an unnecessary check before the function call "platform_device_put"
Qiang Chen (1):
video: ARM CLCD: Remove duplicated include in amba-clcd.c
Tomi Valkeinen (23):
OMAPDSS: DSI: wait for hsdiv clocks when enabling PLL
OMAPDSS: DSI: remove unused hsdiv wait funcs
OMAPDSS: DSI: always power on hsclk & hsdiv
OMAPDSS: DSI: separate LP clock info from dsi_clock_info
OMAPDSS: DSI: remove clkin from dsi_clock_info
OMAPDSS: DSI: remove pll_locked field
OMAPDSS: DSI: use struct copy instead of individual field copy
OMAPDSS: DSI: rename clkin4ddr to clkdco
OMAPDSS: DSI: turn hsdivs fields to arrays
OMAPDSS: DSI: features: combine dsi & dispc hsdivs
OMAPDSS: DSI: dsi_runtime_get/put in pll_init
OMAPDSS: Add common PLL code
OMAPDSS: DSI: use common DSS PLL support
OMAPDSS: HDMI: fix setting REFSEL
OMAPDSS: HDMI5: disable interlace modes
OMAPDSS: HDMI: rewrite HDMI PLL calculation code
OMAPDSS: HDMI: Remove HDMI PLL reset
OMAPDSS: HDMI: store WP pointer to hdmi_pll_data
OMAPDSS: HDMI: split PLL enable & config
OMAPDSS: HDMI: remove extra poweroff
OMAPDSS: HDMI: use common DSS PLL support
OMAPDSS: features: remove unused DSI PLL features
Merge branches '3.19/omapdss' and '3.19/simplefb' into fbdev
.../bindings/video/simple-framebuffer-sunxi.txt | 33 ++
.../bindings/video/simple-framebuffer.txt | 68 ++-
MAINTAINERS | 8 +
drivers/video/console/fbcon.c | 2 +-
drivers/video/fbdev/Kconfig | 2 +-
drivers/video/fbdev/amba-clcd.c | 1 -
drivers/video/fbdev/arkfb.c | 2 +-
drivers/video/fbdev/mmp/core.c | 6 +-
drivers/video/fbdev/mmp/hw/mmp_ctrl.c | 3 +-
drivers/video/fbdev/mx3fb.c | 3 +-
drivers/video/fbdev/mxsfb.c | 19 +
.../video/fbdev/omap2/displays-new/connector-dvi.c | 9 +-
.../fbdev/omap2/displays-new/connector-hdmi.c | 99 ----
.../fbdev/omap2/displays-new/encoder-tfp410.c | 1 +
.../fbdev/omap2/displays-new/encoder-tpd12s015.c | 57 +-
drivers/video/fbdev/omap2/dss/Kconfig | 7 -
drivers/video/fbdev/omap2/dss/Makefile | 2 +-
drivers/video/fbdev/omap2/dss/dispc.c | 20 +-
drivers/video/fbdev/omap2/dss/dpi.c | 327 ++++++----
drivers/video/fbdev/omap2/dss/dsi.c | 659 ++++++++-------------
drivers/video/fbdev/omap2/dss/dss-of.c | 58 +-
drivers/video/fbdev/omap2/dss/dss.c | 123 ++--
drivers/video/fbdev/omap2/dss/dss.h | 225 +++----
drivers/video/fbdev/omap2/dss/dss_features.c | 42 --
drivers/video/fbdev/omap2/dss/dss_features.h | 12 -
drivers/video/fbdev/omap2/dss/hdmi.h | 71 ++-
drivers/video/fbdev/omap2/dss/hdmi4.c | 338 +++++------
drivers/video/fbdev/omap2/dss/hdmi4_core.c | 14 -
drivers/video/fbdev/omap2/dss/hdmi4_core.h | 4 -
drivers/video/fbdev/omap2/dss/hdmi5.c | 338 ++++++-----
drivers/video/fbdev/omap2/dss/hdmi5_core.c | 11 +-
drivers/video/fbdev/omap2/dss/hdmi5_core.h | 2 -
drivers/video/fbdev/omap2/dss/hdmi_common.c | 2 -
drivers/video/fbdev/omap2/dss/hdmi_phy.c | 31 +-
drivers/video/fbdev/omap2/dss/hdmi_pll.c | 313 +++++-----
drivers/video/fbdev/omap2/dss/hdmi_wp.c | 16 +-
drivers/video/fbdev/omap2/dss/output.c | 19 +-
drivers/video/fbdev/omap2/dss/pll.c | 378 ++++++++++++
drivers/video/fbdev/omap2/dss/sdi.c | 2 +-
drivers/video/fbdev/s3fb.c | 2 +-
drivers/video/fbdev/sh_mobile_lcdcfb.c | 3 +-
drivers/video/fbdev/simplefb.c | 162 ++++-
drivers/video/fbdev/sis/sis_main.c | 14 +-
drivers/video/fbdev/sm501fb.c | 1 +
drivers/video/fbdev/smscufx.c | 6 +-
drivers/video/fbdev/udlfb.c | 9 +-
drivers/video/fbdev/uvesafb.c | 6 +-
drivers/video/fbdev/via/viafbdev.c | 3 +-
drivers/video/fbdev/vt8623fb.c | 2 +-
include/linux/of.h | 3 +-
include/sound/omap-hdmi-audio.h | 43 ++
include/video/omapdss.h | 45 +-
sound/soc/omap/Kconfig | 26 +-
sound/soc/omap/Makefile | 6 +-
sound/soc/omap/omap-hdmi-audio.c | 407 +++++++++++++
sound/soc/omap/omap-hdmi-card.c | 87 ---
sound/soc/omap/omap-hdmi.c | 364 ------------
sound/soc/omap/omap-hdmi.h | 38 --
58 files changed, 2398 insertions(+), 2156 deletions(-)
create mode 100644 Documentation/devicetree/bindings/video/simple-framebuffer-sunxi.txt
create mode 100644 drivers/video/fbdev/omap2/dss/pll.c
create mode 100644 include/sound/omap-hdmi-audio.h
create mode 100644 sound/soc/omap/omap-hdmi-audio.c
delete mode 100644 sound/soc/omap/omap-hdmi-card.c
delete mode 100644 sound/soc/omap/omap-hdmi.c
delete mode 100644 sound/soc/omap/omap-hdmi.h
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: FOSDEM15: Graphics DevRoom: call for speakers.
From: Jesse Barnes @ 2014-12-11 15:53 UTC (permalink / raw)
To: xorg
Cc: libv, mesa-dev, xorg-devel, wayland-devel, mir-devel,
directfb-dev, linux-fbdev, linux-media, xorg, xorg-announce,
dri-devel
In-Reply-To: <20141209143926.GB17341@skynet.be>
On Tue, 9 Dec 2014 15:39:26 +0100
Luc Verhaegen <libv@skynet.be> wrote:
> On Thu, Oct 02, 2014 at 07:44:57PM +0200, Luc Verhaegen wrote:
> > Hi,
> >
> > At FOSDEM on the 31st of january and the 1st of February 2015, there
> > will be another graphics DevRoom. URL: https://fosdem.org/2015/
>
> > Slots will be handed out on a first come, first serve basis. The best
> > slots will go to those who apply the earliest. The amount of slots is
> > currently not known yet, but i expect there to be around 16 available (8
> > on each day), so act quickly.
>
> > As for deadlines, i hope to have a pretty much complete schedule between
> > christmas and the new year. The rockhard printed schedule deadline is
> > probably January 9th, after that you will not be featured in the booklet
> > and you will have a lot less visitors. I will hopefully be able to lock
> > down entries and descriptions after that date.
>
> It's been more than 2 months since the original email, it's less than
> two months away from the event, and one month away from what usually is
> the deadline for the booklet. File your talk now, while there are still
> some useful slots available.
>
> Also, for those who have filed already but who have left their abstracts
> open, please get those filed in ASAP. Your talk will be only be ordered
> in when at least the basics are provided.
Hey Luc, thanks for the reminder. I just submitted a talk myself;
hopefully there's still room on the schedule! :)
--
Jesse Barnes, Intel Open Source Technology Center
^ permalink raw reply
* Re: [GIT PULL] fbdev fixes for 3.19
From: Linus Torvalds @ 2014-12-11 20:55 UTC (permalink / raw)
To: Tomi Valkeinen, Grant Likely, Rob Herring, Rafael J. Wysocki
Cc: LKML, Linux Fbdev development list, Mark Brown
In-Reply-To: <54899F0E.4090309@ti.com>
On Thu, Dec 11, 2014 at 5:41 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>
> Please pull fbdev changes for 3.19.
Ugh. I've pulled it, but I'm not a huge fan of commit 6d09dc6b74ca
("of.h: Keep extern declaration of of_* variables when !CONFIG_OF").
I guess it works, but it ends up delaying any failures from compile
time to link time, and the linker error messages likely won't be
great.
So I'm cc'ing the OF people and Rafael (who worked on OF/ACPI
unification) to see if they have comments, preferences, or other ways
to solve this.
Quite frankly, to me it smells like non-OF builds should just have an
empty "for_each_child_of_node ()" define instead of playing games with
externs that then end up not existing, and depending on the compiler
DTRT.
Comments?
Linus
^ permalink raw reply
* Re: [GIT PULL] fbdev fixes for 3.19
From: Rafael J. Wysocki @ 2014-12-11 22:58 UTC (permalink / raw)
To: Linus Torvalds
Cc: Tomi Valkeinen, Grant Likely, Rob Herring, Rafael J. Wysocki,
LKML, Linux Fbdev development list, Mark Brown
In-Reply-To: <CA+55aFyPauetupuqp0aexH2-2Z638jp-s_jyarvZW_sCSizzsg@mail.gmail.com>
On Thursday, December 11, 2014 12:55:28 PM Linus Torvalds wrote:
> On Thu, Dec 11, 2014 at 5:41 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> >
> > Please pull fbdev changes for 3.19.
>
> Ugh. I've pulled it, but I'm not a huge fan of commit 6d09dc6b74ca
> ("of.h: Keep extern declaration of of_* variables when !CONFIG_OF").
>
> I guess it works, but it ends up delaying any failures from compile
> time to link time, and the linker error messages likely won't be
> great.
>
> So I'm cc'ing the OF people and Rafael (who worked on OF/ACPI
> unification) to see if they have comments, preferences, or other ways
> to solve this.
>
> Quite frankly, to me it smells like non-OF builds should just have an
> empty "for_each_child_of_node ()" define instead of playing games with
> externs that then end up not existing, and depending on the compiler
> DTRT.
>
> Comments?
"for_each_child_of_node ()" is not a problem here AFAICS, because in the
example from the commit changelog the compiler would complain on the
of_chosen instance in the "if ()" statement already anyway if I'm not mistaken.
It wants all of the code in the given block to make sense even if that
block will be optimized away going forward. That's not specific to CONFIG_OF
too.
I stumbled over that a couple of times and I don't see a clean and simple way
to work around it at the moment. In the cases I dealt with it was sufficient
to use static inlines that were defined to return NULL (or equivalent) when
the symbol in question was not defined.
Rafael
^ permalink raw reply
* Re: Compiled tridentfb hangs but distribution kernel works fine
From: Ondrej Zary @ 2014-12-11 23:07 UTC (permalink / raw)
To: Mike Galbraith; +Cc: linux-fbdev, Kernel development list
In-Reply-To: <1418195704.5312.31.camel@marge.simpson.net>
On Wednesday 10 December 2014 08:15:04 Mike Galbraith wrote:
> On Tue, 2014-12-09 at 22:33 +0100, Ondrej Zary wrote:
> > Hello,
> > I'm doing some work on tridentfb driver but encountered a weird problem.
> >
> > When I compile custom kernel with tridentfb, it hangs with Blade3D card
> > (ID 0x9880) in blade_image_blit(). The screen is blank with some
> > artifacts and machine does not respond to ping or keyboard. However, it
> > can be rebooted by Alt+SysRq+B. It works fine with other cards (3DImage
> > 9750 and CyberBlade XP) with no blit implementation. Commenting out
> > contents of blade_image_blit() function makes the hang go away (nothing
> > useful on the screen, of course).
> >
> > The weird thing is that the Blade3D card works fine when I load Debian
> > kernels! Debian 3.16-0.bpo.3-686-pae works fine but when I compile 3.16
> > kernel, it hangs.
> >
> > Any ideas?
>
> I'd start by looking for what Debian changed in source and/or config.
Seems that the problem appears only of CONFIG_CC_OPTIMIZE_FOR_SIZE is enabled.
Really weird.
--
Ondrej Zary
^ permalink raw reply
* Re: [GIT PULL] fbdev fixes for 3.19
From: Rob Herring @ 2014-12-12 0:59 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linus Torvalds, Tomi Valkeinen, Grant Likely, Rob Herring,
Rafael J. Wysocki, LKML, Linux Fbdev development list, Mark Brown
In-Reply-To: <3272093.0A5V5UZ3cA@vostro.rjw.lan>
On Thu, Dec 11, 2014 at 4:58 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> On Thursday, December 11, 2014 12:55:28 PM Linus Torvalds wrote:
>> On Thu, Dec 11, 2014 at 5:41 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>> >
>> > Please pull fbdev changes for 3.19.
>>
>> Ugh. I've pulled it, but I'm not a huge fan of commit 6d09dc6b74ca
>> ("of.h: Keep extern declaration of of_* variables when !CONFIG_OF").
>>
>> I guess it works, but it ends up delaying any failures from compile
>> time to link time, and the linker error messages likely won't be
>> great.
>>
>> So I'm cc'ing the OF people and Rafael (who worked on OF/ACPI
>> unification) to see if they have comments, preferences, or other ways
>> to solve this.
>>
>> Quite frankly, to me it smells like non-OF builds should just have an
>> empty "for_each_child_of_node ()" define instead of playing games with
>> externs that then end up not existing, and depending on the compiler
>> DTRT.
>>
>> Comments?
>
> "for_each_child_of_node ()" is not a problem here AFAICS, because in the
> example from the commit changelog the compiler would complain on the
> of_chosen instance in the "if ()" statement already anyway if I'm not mistaken.
Really, the "if" should be completely removed here.
for_each_child_of_node should do the right thing for !OF or if
of_chosen is NULL already. Since for_each_child_of_node relies on it's
helper function to get optimized away we need of_chosen defined to
something.
I believe Linus' suggestion was we could have an empty
for_each_child_of_node() define, but we've moved away from that to
simplify the of.h header and avoid multiple definitions. Doing that
has it's own issues. Fixing up !OF problems has been somewhat painful
as we've converted ARM and people failed to test that.
Rob
^ permalink raw reply
* Re: [GIT PULL] fbdev fixes for 3.19
From: Rafael J. Wysocki @ 2014-12-12 15:25 UTC (permalink / raw)
To: Rob Herring
Cc: Linus Torvalds, Tomi Valkeinen, Grant Likely, Rob Herring,
Rafael J. Wysocki, LKML, Linux Fbdev development list, Mark Brown
In-Reply-To: <CAL_JsqKrKxSdmp5UKcGeNFzDxOxirycT0YQKsPbY3dTaJWY+ag@mail.gmail.com>
On Thursday, December 11, 2014 06:59:34 PM Rob Herring wrote:
> On Thu, Dec 11, 2014 at 4:58 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> > On Thursday, December 11, 2014 12:55:28 PM Linus Torvalds wrote:
> >> On Thu, Dec 11, 2014 at 5:41 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> >> >
> >> > Please pull fbdev changes for 3.19.
> >>
> >> Ugh. I've pulled it, but I'm not a huge fan of commit 6d09dc6b74ca
> >> ("of.h: Keep extern declaration of of_* variables when !CONFIG_OF").
> >>
> >> I guess it works, but it ends up delaying any failures from compile
> >> time to link time, and the linker error messages likely won't be
> >> great.
> >>
> >> So I'm cc'ing the OF people and Rafael (who worked on OF/ACPI
> >> unification) to see if they have comments, preferences, or other ways
> >> to solve this.
> >>
> >> Quite frankly, to me it smells like non-OF builds should just have an
> >> empty "for_each_child_of_node ()" define instead of playing games with
> >> externs that then end up not existing, and depending on the compiler
> >> DTRT.
> >>
> >> Comments?
> >
> > "for_each_child_of_node ()" is not a problem here AFAICS, because in the
> > example from the commit changelog the compiler would complain on the
> > of_chosen instance in the "if ()" statement already anyway if I'm not mistaken.
>
> Really, the "if" should be completely removed here.
> for_each_child_of_node should do the right thing for !OF or if
> of_chosen is NULL already.
This still is an example of a common pattern:
<statement optimized away for CONFIG_BLAH unset> {
<some code>
}
Now, if you use variables defined only for CONFIG_BLAH set in the above (block
or statement), you'll get compile errors for !CONFIG_BLAH.
There is a limited choice of what can be done to avoid those errors:
(a) Put the whole code in question under #ifdef CONFIG_BLAH (defeats the
purpose of the entire exercise).
(b) Define the variables unconditionally (wasted memory for !CONFIG_BLAH).
(c) Wrap the variables in static inline functions that will be empty for
!CONFIG_BLAH ("one more level of indirection" approach).
(d) Do dirty tricks like in commit 6d09dc6b74ca.
Are there any more options that I'm overlooking? If not, (a) and (b) are
unattractive, so the real choice seems to be between (c) and (d) to me.
Rafael
^ permalink raw reply
* CONFIG_CC_OPTIMIZE_FOR_SIZE breaking tridentfb
From: Ondrej Zary @ 2014-12-12 22:51 UTC (permalink / raw)
To: Kernel development list; +Cc: linux-fbdev
Hello,
I have a weird problem with CONFIG_CC_OPTIMIZE_FOR_SIZE.
When it's enabled, tridentfb hangs with Blade3D card (ID 0x9880) in
blade_image_blit(). The screen is blank with some artifacts and machine does
not respond to ping or keyboard. However, it can be rebooted by Alt+SysRq+B.
It works fine with other cards (3DImage 9750 and CyberBlade XP) with no blit
implementation. Commenting out contents of blade_image_blit() function makes
the hang go away (nothing useful on the screen, of course).
Compiled kernel without CONFIG_CC_OPTIMIZE_FOR_SIZE: works
Then inserted #pragma GCC optimize ("Os") line into tridentfb.c: hangs (1)
Then added __attribute__((optimize("O2"))) to blade_image_blit(): works (2)
Compiled kernel with CONFIG_CC_OPTIMIZE_FOR_SIZE: hangs.
Then inserted #pragma GCC optimize ("O2") line into tridentfb.c: still hangs!
Then added __attribute__((optimize("O2"))) to blade_image_blit(): still hangs
$ gcc --version
gcc (Debian 4.7.2-5) 4.7.2
WTF is going on here?
objdumps from case (1) and (2):
this one hangs:
00000965 <blade_image_blit>:
965: 55 push %ebp
966: 57 push %edi
967: 56 push %esi
968: 89 d6 mov %edx,%esi
96a: 53 push %ebx
96b: 8b 38 mov (%eax),%edi
96d: 8b 54 24 14 mov 0x14(%esp),%edx
971: 8b 5c 24 18 mov 0x18(%esp),%ebx
975: 8b 6c 24 1c mov 0x1c(%esp),%ebp
979: 8b 44 24 20 mov 0x20(%esp),%eax
97d: 89 87 60 21 00 00 mov %eax,0x2160(%edi)
983: 8b 44 24 24 mov 0x24(%esp),%eax
987: 89 87 64 21 00 00 mov %eax,0x2164(%edi)
98d: b8 00 00 18 a0 mov $0xa0180000,%eax
992: 89 87 44 21 00 00 mov %eax,0x2144(%edi)
998: 89 d0 mov %edx,%eax
99a: c1 e0 10 shl $0x10,%eax
99d: 09 c8 or %ecx,%eax
99f: 89 87 08 21 00 00 mov %eax,0x2108(%edi)
9a5: 8d 44 2a ff lea -0x1(%edx,%ebp,1),%eax
9a9: c1 e0 10 shl $0x10,%eax
9ac: 8d 54 19 ff lea -0x1(%ecx,%ebx,1),%edx
9b0: 09 d0 or %edx,%eax
9b2: 89 87 0c 21 00 00 mov %eax,0x210c(%edi)
9b8: 8d 43 1f lea 0x1f(%ebx),%eax
9bb: 8d 0c ad 00 00 00 00 lea 0x0(,%ebp,4),%ecx
9c2: c1 e8 05 shr $0x5,%eax
9c5: 8d 97 00 00 01 00 lea 0x10000(%edi),%edx
9cb: 0f af c8 imul %eax,%ecx
9ce: 89 d7 mov %edx,%edi
9d0: f3 a4 rep movsb %ds:(%esi),%es:(%edi)
9d2: 5b pop %ebx
9d3: 5e pop %esi
9d4: 5f pop %edi
9d5: 5d pop %ebp
9d6: c3 ret
this one works:
00000965 <writemmr.isra.8>:
965: 01 d0 add %edx,%eax
967: 89 08 mov %ecx,(%eax)
969: c3 ret
96a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
00000970 <blade_image_blit>:
970: 83 ec 1c sub $0x1c,%esp
973: 89 5c 24 0c mov %ebx,0xc(%esp)
977: 89 c3 mov %eax,%ebx
979: 8b 44 24 28 mov 0x28(%esp),%eax
97d: 89 74 24 10 mov %esi,0x10(%esp)
981: 89 ce mov %ecx,%esi
983: 8b 4c 24 2c mov 0x2c(%esp),%ecx
987: 89 54 24 04 mov %edx,0x4(%esp)
98b: ba 60 21 00 00 mov $0x2160,%edx
990: 89 7c 24 14 mov %edi,0x14(%esp)
994: 8b 7c 24 20 mov 0x20(%esp),%edi
998: 89 04 24 mov %eax,(%esp)
99b: 8b 44 24 30 mov 0x30(%esp),%eax
99f: 89 6c 24 18 mov %ebp,0x18(%esp)
9a3: 8b 6c 24 24 mov 0x24(%esp),%ebp
9a7: 89 44 24 08 mov %eax,0x8(%esp)
9ab: 8b 03 mov (%ebx),%eax
9ad: e8 b3 ff ff ff call 965 <writemmr.isra.8>
9b2: 8b 4c 24 08 mov 0x8(%esp),%ecx
9b6: ba 64 21 00 00 mov $0x2164,%edx
9bb: 8b 03 mov (%ebx),%eax
9bd: e8 a3 ff ff ff call 965 <writemmr.isra.8>
9c2: 8b 03 mov (%ebx),%eax
9c4: b9 00 00 18 a0 mov $0xa0180000,%ecx
9c9: ba 44 21 00 00 mov $0x2144,%edx
9ce: e8 92 ff ff ff call 965 <writemmr.isra.8>
9d3: 8b 03 mov (%ebx),%eax
9d5: 89 f9 mov %edi,%ecx
9d7: c1 e1 10 shl $0x10,%ecx
9da: ba 08 21 00 00 mov $0x2108,%edx
9df: 09 f1 or %esi,%ecx
9e1: e8 7f ff ff ff call 965 <writemmr.isra.8>
9e6: 8b 04 24 mov (%esp),%eax
9e9: ba 0c 21 00 00 mov $0x210c,%edx
9ee: 8d 4c 07 ff lea -0x1(%edi,%eax,1),%ecx
9f2: c1 e1 10 shl $0x10,%ecx
9f5: 8d 44 2e ff lea -0x1(%esi,%ebp,1),%eax
9f9: 09 c1 or %eax,%ecx
9fb: 8b 03 mov (%ebx),%eax
9fd: e8 63 ff ff ff call 965 <writemmr.isra.8>
a02: 8b 0c 24 mov (%esp),%ecx
a05: 8d 55 1f lea 0x1f(%ebp),%edx
a08: 8b 03 mov (%ebx),%eax
a0a: c1 ea 05 shr $0x5,%edx
a0d: 8b 5c 24 0c mov 0xc(%esp),%ebx
a11: 8b 74 24 10 mov 0x10(%esp),%esi
a15: c1 e1 02 shl $0x2,%ecx
a18: 8b 7c 24 14 mov 0x14(%esp),%edi
a1c: 0f af ca imul %edx,%ecx
a1f: 8b 6c 24 18 mov 0x18(%esp),%ebp
a23: 05 00 00 01 00 add $0x10000,%eax
a28: 8b 54 24 04 mov 0x4(%esp),%edx
a2c: 83 c4 1c add $0x1c,%esp
a2f: e9 fc ff ff ff jmp a30 <blade_image_blit+0xc0>
a30: R_386_PC32 memcpy
--
Ondrej Zary
^ permalink raw reply
* [patch] OMAPDSS: pll: NULL dereference in error handling
From: Dan Carpenter @ 2014-12-16 23:54 UTC (permalink / raw)
To: Tomi Valkeinen
Cc: Jean-Christophe Plagniol-Villard, linux-omap, linux-fbdev,
kernel-janitors
The regulator_disable() doesn't accept NULL pointers.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/video/fbdev/omap2/dss/pll.c b/drivers/video/fbdev/omap2/dss/pll.c
index 50bc62c5..335ffac 100644
--- a/drivers/video/fbdev/omap2/dss/pll.c
+++ b/drivers/video/fbdev/omap2/dss/pll.c
@@ -97,7 +97,8 @@ int dss_pll_enable(struct dss_pll *pll)
return 0;
err_enable:
- regulator_disable(pll->regulator);
+ if (pll->regulator)
+ regulator_disable(pll->regulator);
err_reg:
clk_disable_unprepare(pll->clkin);
return r;
^ permalink raw reply related
* Re: [patch] OMAPDSS: pll: NULL dereference in error handling
From: Tomi Valkeinen @ 2014-12-17 6:28 UTC (permalink / raw)
To: Dan Carpenter
Cc: Jean-Christophe Plagniol-Villard, linux-omap, linux-fbdev,
kernel-janitors
In-Reply-To: <20141216235442.GE31467@mwanda>
[-- Attachment #1: Type: text/plain, Size: 708 bytes --]
On 17/12/14 01:54, Dan Carpenter wrote:
> The regulator_disable() doesn't accept NULL pointers.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/video/fbdev/omap2/dss/pll.c b/drivers/video/fbdev/omap2/dss/pll.c
> index 50bc62c5..335ffac 100644
> --- a/drivers/video/fbdev/omap2/dss/pll.c
> +++ b/drivers/video/fbdev/omap2/dss/pll.c
> @@ -97,7 +97,8 @@ int dss_pll_enable(struct dss_pll *pll)
> return 0;
>
> err_enable:
> - regulator_disable(pll->regulator);
> + if (pll->regulator)
> + regulator_disable(pll->regulator);
> err_reg:
> clk_disable_unprepare(pll->clkin);
> return r;
>
Thanks! Queuing for 3.19 fbdev fixes.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* [PATCH v10 0/6] Add Skyworks SKY81452 device drivers
From: gyungoh @ 2014-12-18 5:47 UTC (permalink / raw)
To: sameo-VuQAYsv1563Yd54FQh9/CA, lee.jones-QSEj5FYQhm4dnm+yROfE0A,
grant.likely-QSEj5FYQhm4dnm+yROfE0A,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, jg1.han-Sze3O3UU22JBDgjK7y7TUQ,
cooloney-Re5JQEeQqe8AvxtiuMwx3w, pawel.moll-5wv7dgnIgG8,
mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
galak-sgV2jX0FEOL9JmXXK+q4OQ, trivial-DgEjT+Ai2ygdnm+yROfE0A
Cc: akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
jic23-DgEjT+Ai2ygdnm+yROfE0A,
thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
ktsai-GubuWUlQtMwciDkP5Hr2oA, hs-ynQEQJNshbs,
stwiss.opensource-WBD+wuPFNBhBDgjK7y7TUQ,
matti.vaittinen-OYasijW0DpE, broonie-DgEjT+Ai2ygdnm+yROfE0A,
jason-NLaQJdtUoK4Be96aLqz0jA, heiko-4mtYJXux2i+zQB+pC5nmwQ,
shawn.guo-KZfg59tc24xl57MIdRCFDg, florian.vaussard-p8DiymsW2f8,
andrew-g2DYL2Zd6BY, antonynpavlov-Re5JQEeQqe8AvxtiuMwx3w,
hytszk-Re5JQEeQqe8AvxtiuMwx3w, plagnioj-sclMFOaUSTBWk0Htik3J/w,
tomi.valkeinen-l0cyMroinI0, jack.yoo-tjhQNA90jdKqndwCJWfcng,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1417590332-4912-1-git-send-email-jack.yoo@skyworksinc.com>
From: Gyungoh Yoo <jack.yoo@skyworksinc.com>
This patch set includes regulator and backlight driver for SKY81452.
Also it includes documents for device tree and module.
sky81452-regulator was already applied. So this series doesn't
include it.
v10:
Removed trivial get_brightness implementations for sky81452-backlight
v9:
Removed the change to remove MODULE_VERSION() for sky81452-regulator
v8:
Renamed property names for backlight with vendor prefix
Modified gpio-enable property to generic property for GPIO
Made up the example for backlight DT
Changed the DT parsing of regulator using regulator_node and of_match
v7:
Modified licensing text to GPLv2
Splitted Kconfig renaming from DT patch
v6:
Added new line character at the end of line of dev_err()
v5:
Changed DT for regulator : 'lout' node should be defined under 'regulator'
Removed compatible string from sky81452-regulator driver
Modified sky81452-regulator to return EINVAL when of_node is NULL
Move sky81452-backlight.h to include/linux/platform_data
v4:
Removed MODULE_VERSION()
Modified license to GPLv2
Removed calling to backlight_device_unregister() in sky81452-backlight
v3:
Cleaned-up DBG messages
Cleaned-up DT
Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight'
Assigned mfd_cell.of_compatible for binding device node
Modified error messages
Modified sky81452-regulator to return ENODATA when of_node is NULL
v2:
Split the patches for each sub-system
Added 'reg' attribute for I2C address in device tree documents
Added 'compatible' attribute in child drivers
Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452
Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452
Added message for exception or errors.
Added vendor prefix for Skyworks Solutions, Inc.
Add SKY81452 to the Trivial Devices list
Gyungoh Yoo (6):
mfd: Add support for Skyworks SKY81452 driver
backlight: Add support Skyworks SKY81452 backlight driver
devicetree: mfd: Add new SKY81452 mfd binding
devicetree: backlight: Add new SKY81452 backlight binding
devicetree: Add vendor prefix for Skyworks Solutions, Inc.
devicetree: i2c: Add SKY81452 to the Trivial Devices list
.../devicetree/bindings/i2c/trivial-devices.txt | 1 +
Documentation/devicetree/bindings/mfd/sky81452.txt | 36 +++
.../devicetree/bindings/vendor-prefixes.txt | 1 +
.../video/backlight/sky81452-backlight.txt | 29 ++
drivers/mfd/Kconfig | 12 +
drivers/mfd/Makefile | 1 +
drivers/mfd/sky81452.c | 108 +++++++
drivers/video/backlight/Kconfig | 10 +
drivers/video/backlight/Makefile | 1 +
drivers/video/backlight/sky81452-backlight.c | 334 +++++++++++++++++++++
include/linux/mfd/sky81452.h | 31 ++
include/linux/platform_data/sky81452-backlight.h | 46 +++
12 files changed, 610 insertions(+)
create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt
create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt
create mode 100644 drivers/mfd/sky81452.c
create mode 100644 drivers/video/backlight/sky81452-backlight.c
create mode 100644 include/linux/mfd/sky81452.h
create mode 100644 include/linux/platform_data/sky81452-backlight.h
--
1.9.1
^ permalink raw reply
* [PATCH v10 1/6] mfd: Add support for Skyworks SKY81452 driver
From: gyungoh @ 2014-12-18 5:47 UTC (permalink / raw)
To: sameo-VuQAYsv1563Yd54FQh9/CA, lee.jones-QSEj5FYQhm4dnm+yROfE0A,
grant.likely-QSEj5FYQhm4dnm+yROfE0A,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, jg1.han-Sze3O3UU22JBDgjK7y7TUQ,
cooloney-Re5JQEeQqe8AvxtiuMwx3w, pawel.moll-5wv7dgnIgG8,
mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
galak-sgV2jX0FEOL9JmXXK+q4OQ, trivial-DgEjT+Ai2ygdnm+yROfE0A
Cc: akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
jic23-DgEjT+Ai2ygdnm+yROfE0A,
thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
ktsai-GubuWUlQtMwciDkP5Hr2oA, hs-ynQEQJNshbs,
stwiss.opensource-WBD+wuPFNBhBDgjK7y7TUQ,
matti.vaittinen-OYasijW0DpE, broonie-DgEjT+Ai2ygdnm+yROfE0A,
jason-NLaQJdtUoK4Be96aLqz0jA, heiko-4mtYJXux2i+zQB+pC5nmwQ,
shawn.guo-KZfg59tc24xl57MIdRCFDg, florian.vaussard-p8DiymsW2f8,
andrew-g2DYL2Zd6BY, antonynpavlov-Re5JQEeQqe8AvxtiuMwx3w,
hytszk-Re5JQEeQqe8AvxtiuMwx3w, plagnioj-sclMFOaUSTBWk0Htik3J/w,
tomi.valkeinen-l0cyMroinI0, jack.yoo-tjhQNA90jdKqndwCJWfcng,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1418881671-3495-1-git-send-email-jack.yoo-tjhQNA90jdKqndwCJWfcng@public.gmane.org>
From: Gyungoh Yoo <jack.yoo@skyworksinc.com>
Signed-off-by: Gyungoh Yoo <jack.yoo@skyworksinc.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
---
Changes v10:
Nothing
Changes v9:
Nothing
Changes v8:
Nothing
Changes v7:
Modified licensing text to GPLv2
Changes v6:
Added new line character at the end of line of dev_err()
Changes v5:
Move sky81452-backlight.h to include/linux/platform_data
Changes v4:
Removed MODULE_VERSION()
Modified license to GPLv2
Changes v3:
Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight'
Assigned mfd_cell.of_compatible for binding device node
Modified error messages
Changes v2:
Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452
Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452
Added message for exception or errors
drivers/mfd/Kconfig | 12 +++++
drivers/mfd/Makefile | 1 +
drivers/mfd/sky81452.c | 108 +++++++++++++++++++++++++++++++++++++++++++
include/linux/mfd/sky81452.h | 31 +++++++++++++
4 files changed, 152 insertions(+)
create mode 100644 drivers/mfd/sky81452.c
create mode 100644 include/linux/mfd/sky81452.h
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 1456ea7..a54244c 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -693,6 +693,18 @@ config MFD_SM501_GPIO
lines on the SM501. The platform data is used to supply the
base number for the first GPIO line to register.
+config MFD_SKY81452
+ tristate "Skyworks Solutions SKY81452"
+ select MFD_CORE
+ select REGMAP_I2C
+ depends on I2C
+ help
+ This is the core driver for the Skyworks SKY81452 backlight and
+ voltage regulator device.
+
+ This driver can also be built as a module. If so, the module
+ will be called sky81452.
+
config MFD_SMSC
bool "SMSC ECE1099 series chips"
depends on I2C=y
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 8bd54b1..d9683ea 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -174,6 +174,7 @@ obj-$(CONFIG_MFD_STW481X) += stw481x.o
obj-$(CONFIG_MFD_IPAQ_MICRO) += ipaq-micro.o
obj-$(CONFIG_MFD_MENF21BMC) += menf21bmc.o
obj-$(CONFIG_MFD_HI6421_PMIC) += hi6421-pmic-core.o
+obj-$(CONFIG_MFD_SKY81452) += sky81452.o
intel-soc-pmic-objs := intel_soc_pmic_core.o intel_soc_pmic_crc.o
obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o
diff --git a/drivers/mfd/sky81452.c b/drivers/mfd/sky81452.c
new file mode 100644
index 0000000..b0c9b04
--- /dev/null
+++ b/drivers/mfd/sky81452.c
@@ -0,0 +1,108 @@
+/*
+ * sky81452.c SKY81452 MFD driver
+ *
+ * Copyright 2014 Skyworks Solutions Inc.
+ * Author : Gyungoh Yoo <jack.yoo@skyworksinc.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/err.h>
+#include <linux/slab.h>
+#include <linux/i2c.h>
+#include <linux/regmap.h>
+#include <linux/mfd/core.h>
+#include <linux/mfd/sky81452.h>
+
+static const struct regmap_config sky81452_config = {
+ .reg_bits = 8,
+ .val_bits = 8,
+};
+
+static int sky81452_probe(struct i2c_client *client,
+ const struct i2c_device_id *id)
+{
+ struct device *dev = &client->dev;
+ const struct sky81452_platform_data *pdata = dev_get_platdata(dev);
+ struct mfd_cell cells[2];
+ struct regmap *regmap;
+ int ret;
+
+ if (!pdata) {
+ pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+ if (!pdata)
+ return -ENOMEM;
+ }
+
+ regmap = devm_regmap_init_i2c(client, &sky81452_config);
+ if (IS_ERR(regmap)) {
+ dev_err(dev, "failed to initialize.err=%ld\n", PTR_ERR(regmap));
+ return PTR_ERR(regmap);
+ }
+
+ i2c_set_clientdata(client, regmap);
+
+ memset(cells, 0, sizeof(cells));
+ cells[0].name = "sky81452-backlight";
+ cells[0].of_compatible = "skyworks,sky81452-backlight";
+ cells[0].platform_data = pdata->bl_pdata;
+ cells[0].pdata_size = sizeof(*pdata->bl_pdata);
+ cells[1].name = "sky81452-regulator";
+ cells[1].platform_data = pdata->regulator_init_data;
+ cells[1].pdata_size = sizeof(*pdata->regulator_init_data);
+
+ ret = mfd_add_devices(dev, -1, cells, ARRAY_SIZE(cells), NULL, 0, NULL);
+ if (ret)
+ dev_err(dev, "failed to add child devices. err=%d\n", ret);
+
+ return ret;
+}
+
+static int sky81452_remove(struct i2c_client *client)
+{
+ mfd_remove_devices(&client->dev);
+ return 0;
+}
+
+static const struct i2c_device_id sky81452_ids[] = {
+ { "sky81452" },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, sky81452_ids);
+
+#ifdef CONFIG_OF
+static const struct of_device_id sky81452_of_match[] = {
+ { .compatible = "skyworks,sky81452", },
+ { }
+};
+MODULE_DEVICE_TABLE(of, sky81452_of_match);
+#endif
+
+static struct i2c_driver sky81452_driver = {
+ .driver = {
+ .name = "sky81452",
+ .of_match_table = of_match_ptr(sky81452_of_match),
+ },
+ .probe = sky81452_probe,
+ .remove = sky81452_remove,
+ .id_table = sky81452_ids,
+};
+
+module_i2c_driver(sky81452_driver);
+
+MODULE_DESCRIPTION("Skyworks SKY81452 MFD driver");
+MODULE_AUTHOR("Gyungoh Yoo <jack.yoo@skyworksinc.com>");
+MODULE_LICENSE("GPL v2");
diff --git a/include/linux/mfd/sky81452.h b/include/linux/mfd/sky81452.h
new file mode 100644
index 0000000..b0925fa
--- /dev/null
+++ b/include/linux/mfd/sky81452.h
@@ -0,0 +1,31 @@
+/*
+ * sky81452.h SKY81452 MFD driver
+ *
+ * Copyright 2014 Skyworks Solutions Inc.
+ * Author : Gyungoh Yoo <jack.yoo@skyworksinc.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _SKY81452_H
+#define _SKY81452_H
+
+#include <linux/platform_data/sky81452-backlight.h>
+#include <linux/regulator/machine.h>
+
+struct sky81452_platform_data {
+ struct sky81452_bl_platform_data *bl_pdata;
+ struct regulator_init_data *regulator_init_data;
+};
+
+#endif
--
1.9.1
^ permalink raw reply related
* [PATCH v10 2/6] backlight: Add support Skyworks SKY81452 backlight driver
From: gyungoh @ 2014-12-18 5:47 UTC (permalink / raw)
To: sameo, lee.jones, grant.likely, robh+dt, jg1.han, cooloney,
pawel.moll, mark.rutland, ijc+devicetree, galak, trivial
Cc: akpm, jic23, thomas.petazzoni, ktsai, hs, stwiss.opensource,
matti.vaittinen, broonie, jason, heiko, shawn.guo,
florian.vaussard, andrew, antonynpavlov, hytszk, plagnioj,
tomi.valkeinen, jack.yoo, linux-fbdev, linux-kernel, devicetree
In-Reply-To: <1418881671-3495-1-git-send-email-jack.yoo@skyworksinc.com>
From: Gyungoh Yoo <jack.yoo@skyworksinc.com>
Signed-off-by: Gyungoh Yoo <jack.yoo@skyworksinc.com>
---
Changes v10:
Removed trivial get_brightness implementations
Changes v9:
Nothing
Changes v8:
Renamed property names for backlight with vendor prefix
Modified gpio-enable property to generic property for GPIO
Changes v7:
Modified licensing text to GPLv2
Changes v6:
Added new line character at the end of line of dev_err()
Changes v5:
Move sky81452-backlight.h to include/linux/platform_data
Changes v4:
Reordering header files for readability
Removed calling to backlight_device_unregister()
Removed MODULE_VERSION()
Modified license to GPLv2
Changes v3:
Modified DBG messages
Changes v2:
Added 'compatible' attribute in the driver
Added message for exception or errors
drivers/video/backlight/Kconfig | 10 +
drivers/video/backlight/Makefile | 1 +
drivers/video/backlight/sky81452-backlight.c | 334 +++++++++++++++++++++++
include/linux/platform_data/sky81452-backlight.h | 46 ++++
4 files changed, 391 insertions(+)
create mode 100644 drivers/video/backlight/sky81452-backlight.c
create mode 100644 include/linux/platform_data/sky81452-backlight.h
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
index 8d03924..2586fdd 100644
--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -409,6 +409,16 @@ config BACKLIGHT_PANDORA
If you have a Pandora console, say Y to enable the
backlight driver.
+config BACKLIGHT_SKY81452
+ tristate "Backlight driver for SKY81452"
+ depends on BACKLIGHT_CLASS_DEVICE && MFD_SKY81452
+ help
+ If you have a Skyworks SKY81452, say Y to enable the
+ backlight driver.
+
+ To compile this driver as a module, choose M here: the module will
+ be called sky81452-backlight
+
config BACKLIGHT_TPS65217
tristate "TPS65217 Backlight"
depends on BACKLIGHT_CLASS_DEVICE && MFD_TPS65217
diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile
index fcd50b73..d67073f 100644
--- a/drivers/video/backlight/Makefile
+++ b/drivers/video/backlight/Makefile
@@ -50,6 +50,7 @@ obj-$(CONFIG_BACKLIGHT_PANDORA) += pandora_bl.o
obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o
obj-$(CONFIG_BACKLIGHT_PWM) += pwm_bl.o
obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o
+obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o
obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o
obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o
obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o
diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c
new file mode 100644
index 0000000..8105597
--- /dev/null
+++ b/drivers/video/backlight/sky81452-backlight.c
@@ -0,0 +1,334 @@
+/*
+ * sky81452-backlight.c SKY81452 backlight driver
+ *
+ * Copyright 2014 Skyworks Solutions Inc.
+ * Author : Gyungoh Yoo <jack.yoo@skyworksinc.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/backlight.h>
+#include <linux/err.h>
+#include <linux/gpio.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_gpio.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+#include <linux/platform_data/sky81452-backlight.h>
+#include <linux/slab.h>
+
+/* registers */
+#define SKY81452_REG0 0x00
+#define SKY81452_REG1 0x01
+#define SKY81452_REG2 0x02
+#define SKY81452_REG4 0x04
+#define SKY81452_REG5 0x05
+
+/* bit mask */
+#define SKY81452_CS 0xFF
+#define SKY81452_EN 0x3F
+#define SKY81452_IGPW 0x20
+#define SKY81452_PWMMD 0x10
+#define SKY81452_PHASE 0x08
+#define SKY81452_ILIM 0x04
+#define SKY81452_VSHRT 0x03
+#define SKY81452_OCP 0x80
+#define SKY81452_OTMP 0x40
+#define SKY81452_SHRT 0x3F
+#define SKY81452_OPN 0x3F
+
+#define SKY81452_DEFAULT_NAME "lcd-backlight"
+#define SKY81452_MAX_BRIGHTNESS (SKY81452_CS + 1)
+
+#define CTZ(b) __builtin_ctz(b)
+
+static int sky81452_bl_update_status(struct backlight_device *bd)
+{
+ const struct sky81452_bl_platform_data *pdata + dev_get_platdata(bd->dev.parent);
+ const unsigned int brightness = (unsigned int)bd->props.brightness;
+ struct regmap *regmap = bl_get_data(bd);
+ int ret;
+
+ if (brightness > 0) {
+ ret = regmap_write(regmap, SKY81452_REG0, brightness - 1);
+ if (IS_ERR_VALUE(ret))
+ return ret;
+
+ return regmap_update_bits(regmap, SKY81452_REG1, SKY81452_EN,
+ pdata->enable << CTZ(SKY81452_EN));
+ }
+
+ return regmap_update_bits(regmap, SKY81452_REG1, SKY81452_EN, 0);
+}
+
+static const struct backlight_ops sky81452_bl_ops = {
+ .update_status = sky81452_bl_update_status,
+};
+
+static ssize_t sky81452_bl_store_enable(struct device *dev,
+ struct device_attribute *attr, const char *buf, size_t count)
+{
+ struct regmap *regmap = bl_get_data(to_backlight_device(dev));
+ unsigned long value;
+ int ret;
+
+ ret = kstrtoul(buf, 16, &value);
+ if (IS_ERR_VALUE(ret))
+ return ret;
+
+ ret = regmap_update_bits(regmap, SKY81452_REG1, SKY81452_EN,
+ value << CTZ(SKY81452_EN));
+ if (IS_ERR_VALUE(ret))
+ return ret;
+
+ return count;
+}
+
+static ssize_t sky81452_bl_show_open_short(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct regmap *regmap = bl_get_data(to_backlight_device(dev));
+ unsigned int reg, value = 0;
+ char tmp[3];
+ int i, ret;
+
+ reg = !strcmp(attr->attr.name, "open") ? SKY81452_REG5 : SKY81452_REG4;
+ ret = regmap_read(regmap, reg, &value);
+ if (IS_ERR_VALUE(ret))
+ return ret;
+
+ if (value & SKY81452_SHRT) {
+ *buf = 0;
+ for (i = 0; i < 6; i++) {
+ if (value & 0x01) {
+ sprintf(tmp, "%d ", i + 1);
+ strcat(buf, tmp);
+ }
+ value >>= 1;
+ }
+ strcat(buf, "\n");
+ } else {
+ strcpy(buf, "none\n");
+ }
+
+ return strlen(buf);
+}
+
+static ssize_t sky81452_bl_show_fault(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct regmap *regmap = bl_get_data(to_backlight_device(dev));
+ unsigned int value = 0;
+ int ret;
+
+ ret = regmap_read(regmap, SKY81452_REG4, &value);
+ if (IS_ERR_VALUE(ret))
+ return ret;
+
+ *buf = 0;
+
+ if (value & SKY81452_OCP)
+ strcat(buf, "over-current ");
+
+ if (value & SKY81452_OTMP)
+ strcat(buf, "over-temperature");
+
+ strcat(buf, "\n");
+ return strlen(buf);
+}
+
+static DEVICE_ATTR(enable, S_IWGRP | S_IWUSR, NULL, sky81452_bl_store_enable);
+static DEVICE_ATTR(open, S_IRUGO, sky81452_bl_show_open_short, NULL);
+static DEVICE_ATTR(short, S_IRUGO, sky81452_bl_show_open_short, NULL);
+static DEVICE_ATTR(fault, S_IRUGO, sky81452_bl_show_fault, NULL);
+
+static struct attribute *sky81452_bl_attribute[] = {
+ &dev_attr_enable.attr,
+ &dev_attr_open.attr,
+ &dev_attr_short.attr,
+ &dev_attr_fault.attr,
+ NULL
+};
+
+static const struct attribute_group sky81452_bl_attr_group = {
+ .attrs = sky81452_bl_attribute,
+};
+
+#ifdef CONFIG_OF
+static struct sky81452_bl_platform_data *sky81452_bl_parse_dt(
+ struct device *dev)
+{
+ struct device_node *np = of_node_get(dev->of_node);
+ struct sky81452_bl_platform_data *pdata;
+ int ret;
+
+ if (!np) {
+ dev_err(dev, "backlight node not found.\n");
+ return ERR_PTR(-ENODATA);
+ }
+
+ pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+ if (!pdata) {
+ of_node_put(np);
+ return ERR_PTR(-ENOMEM);
+ }
+
+ of_property_read_string(np, "name", &pdata->name);
+ pdata->ignore_pwm = of_property_read_bool(np, "skyworks,ignore-pwm");
+ pdata->dpwm_mode = of_property_read_bool(np, "skyworks,dpwm-mode");
+ pdata->phase_shift = of_property_read_bool(np, "skyworks,phase-shift");
+ pdata->gpio_enable = of_get_gpio(np, 0);
+
+ ret = of_property_read_u32(np, "skyworks,en-channels", &pdata->enable);
+ if (IS_ERR_VALUE(ret))
+ pdata->enable = SKY81452_EN >> CTZ(SKY81452_EN);
+
+ ret = of_property_read_u32(np, "skyworks,short-detection-threshold",
+ &pdata->short_detection_threshold);
+ if (IS_ERR_VALUE(ret))
+ pdata->short_detection_threshold = 7;
+
+ ret = of_property_read_u32(np, "skyworks,current-limit",
+ &pdata->boost_current_limit);
+ if (IS_ERR_VALUE(ret))
+ pdata->boost_current_limit = 2750;
+
+ of_node_put(np);
+ return pdata;
+}
+#else
+static struct sky81452_bl_platform_data *sky81452_bl_parse_dt(
+ struct device *dev)
+{
+ return ERR_PTR(-EINVAL);
+}
+#endif
+
+static int sky81452_bl_init_device(struct regmap *regmap,
+ struct sky81452_bl_platform_data *pdata)
+{
+ unsigned int value;
+
+ value = pdata->ignore_pwm ? SKY81452_IGPW : 0;
+ value |= pdata->dpwm_mode ? SKY81452_PWMMD : 0;
+ value |= pdata->phase_shift ? 0 : SKY81452_PHASE;
+
+ if (pdata->boost_current_limit = 2300)
+ value |= SKY81452_ILIM;
+ else if (pdata->boost_current_limit != 2750)
+ return -EINVAL;
+
+ if (pdata->short_detection_threshold < 4 ||
+ pdata->short_detection_threshold > 7)
+ return -EINVAL;
+ value |= (7 - pdata->short_detection_threshold) << CTZ(SKY81452_VSHRT);
+
+ return regmap_write(regmap, SKY81452_REG2, value);
+}
+
+static int sky81452_bl_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct regmap *regmap = dev_get_drvdata(dev->parent);
+ struct sky81452_bl_platform_data *pdata = dev_get_platdata(dev);
+ struct backlight_device *bd;
+ struct backlight_properties props;
+ const char *name;
+ int ret;
+
+ if (!pdata) {
+ pdata = sky81452_bl_parse_dt(dev);
+ if (IS_ERR(pdata))
+ return PTR_ERR(pdata);
+ }
+
+ if (gpio_is_valid(pdata->gpio_enable)) {
+ ret = devm_gpio_request_one(dev, pdata->gpio_enable,
+ GPIOF_OUT_INIT_HIGH, "sky81452-en");
+ if (IS_ERR_VALUE(ret)) {
+ dev_err(dev, "failed to request GPIO. err=%d\n", ret);
+ return ret;
+ }
+ }
+
+ ret = sky81452_bl_init_device(regmap, pdata);
+ if (IS_ERR_VALUE(ret)) {
+ dev_err(dev, "failed to initialize. err=%d\n", ret);
+ return ret;
+ }
+
+ memset(&props, 0, sizeof(props));
+ props.max_brightness = SKY81452_MAX_BRIGHTNESS,
+ name = pdata->name ? pdata->name : SKY81452_DEFAULT_NAME;
+ bd = devm_backlight_device_register(dev, name, dev, regmap,
+ &sky81452_bl_ops, &props);
+ if (IS_ERR(bd)) {
+ dev_err(dev, "failed to register. err=%ld\n", PTR_ERR(bd));
+ return PTR_ERR(bd);
+ }
+
+ platform_set_drvdata(pdev, bd);
+
+ ret = sysfs_create_group(&bd->dev.kobj, &sky81452_bl_attr_group);
+ if (IS_ERR_VALUE(ret)) {
+ dev_err(dev, "failed to create attribute. err=%d\n", ret);
+ return ret;
+ }
+
+ return ret;
+}
+
+static int sky81452_bl_remove(struct platform_device *pdev)
+{
+ const struct sky81452_bl_platform_data *pdata + dev_get_platdata(&pdev->dev);
+ struct backlight_device *bd = platform_get_drvdata(pdev);
+
+ sysfs_remove_group(&bd->dev.kobj, &sky81452_bl_attr_group);
+
+ bd->props.power = FB_BLANK_UNBLANK;
+ bd->props.brightness = 0;
+ backlight_update_status(bd);
+
+ if (gpio_is_valid(pdata->gpio_enable))
+ gpio_set_value_cansleep(pdata->gpio_enable, 0);
+
+ return 0;
+}
+
+#ifdef CONFIG_OF
+static const struct of_device_id sky81452_bl_of_match[] = {
+ { .compatible = "skyworks,sky81452-backlight", },
+ { }
+};
+MODULE_DEVICE_TABLE(of, sky81452_bl_of_match);
+#endif
+
+static struct platform_driver sky81452_bl_driver = {
+ .driver = {
+ .name = "sky81452-backlight",
+ .of_match_table = of_match_ptr(sky81452_bl_of_match),
+ },
+ .probe = sky81452_bl_probe,
+ .remove = sky81452_bl_remove,
+};
+
+module_platform_driver(sky81452_bl_driver);
+
+MODULE_DESCRIPTION("Skyworks SKY81452 backlight driver");
+MODULE_AUTHOR("Gyungoh Yoo <jack.yoo@skyworksinc.com>");
+MODULE_LICENSE("GPL v2");
diff --git a/include/linux/platform_data/sky81452-backlight.h b/include/linux/platform_data/sky81452-backlight.h
new file mode 100644
index 0000000..1231e9b
--- /dev/null
+++ b/include/linux/platform_data/sky81452-backlight.h
@@ -0,0 +1,46 @@
+/*
+ * sky81452.h SKY81452 backlight driver
+ *
+ * Copyright 2014 Skyworks Solutions Inc.
+ * Author : Gyungoh Yoo <jack.yoo@skyworksinc.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _SKY81452_BACKLIGHT_H
+#define _SKY81452_BACKLIGHT_H
+
+/**
+ * struct sky81452_platform_data
+ * @name: backlight driver name.
+ If it is not defined, default name is lcd-backlight.
+ * @gpio_enable:GPIO number which control EN pin
+ * @enable: Enable mask for current sink channel 1, 2, 3, 4, 5 and 6.
+ * @ignore_pwm: true if DPWMI should be ignored.
+ * @dpwm_mode: true is DPWM dimming mode, otherwise Analog dimming mode.
+ * @phase_shift:true is phase shift mode.
+ * @short_detecion_threshold: It should be one of 4, 5, 6 and 7V.
+ * @boost_current_limit: It should be one of 2300, 2750mA.
+ */
+struct sky81452_bl_platform_data {
+ const char *name;
+ int gpio_enable;
+ unsigned int enable;
+ bool ignore_pwm;
+ bool dpwm_mode;
+ bool phase_shift;
+ unsigned int short_detection_threshold;
+ unsigned int boost_current_limit;
+};
+
+#endif
--
1.9.1
^ permalink raw reply related
* [PATCH v10 3/6] devicetree: mfd: Add new SKY81452 mfd binding
From: gyungoh @ 2014-12-18 5:47 UTC (permalink / raw)
To: sameo, lee.jones, grant.likely, robh+dt, jg1.han, cooloney,
pawel.moll, mark.rutland, ijc+devicetree, galak, trivial
Cc: akpm, jic23, thomas.petazzoni, ktsai, hs, stwiss.opensource,
matti.vaittinen, broonie, jason, heiko, shawn.guo,
florian.vaussard, andrew, antonynpavlov, hytszk, plagnioj,
tomi.valkeinen, jack.yoo, linux-fbdev, linux-kernel, devicetree
In-Reply-To: <1418881671-3495-1-git-send-email-jack.yoo@skyworksinc.com>
From: Gyungoh Yoo <jack.yoo@skyworksinc.com>
Signed-off-by: Gyungoh Yoo <jack.yoo@skyworksinc.com>
---
Changes v10:
Nothing
Changes v9:
Nothing
Changes v8:
Made up the example for backlight DT
Changes v7:
Nothing
Changes v6:
Nothing
Changes v5:
Changed DT for regulator : 'lout' node should be defined under 'regulator'
Removed compatible string from sky81452-regulator driver
Changes v4:
Nothing
Changes v3:
Nothing
Changes v2:
Added reg attribute for I2C slave address
Documentation/devicetree/bindings/mfd/sky81452.txt | 36 ++++++++++++++++++++++
1 file changed, 36 insertions(+)
create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt
diff --git a/Documentation/devicetree/bindings/mfd/sky81452.txt b/Documentation/devicetree/bindings/mfd/sky81452.txt
new file mode 100644
index 0000000..ab71473
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/sky81452.txt
@@ -0,0 +1,36 @@
+SKY81452 bindings
+
+Required properties:
+- compatible : Must be "skyworks,sky81452"
+- reg : I2C slave address
+
+Required child nodes:
+- backlight : container node for backlight following the binding
+ in video/backlight/sky81452-backlight.txt
+- regulator : container node for regulators following the binding
+ in regulator/sky81452-regulator.txt
+
+Example:
+
+ sky81452@2c {
+ compatible = "skyworks,sky81452";
+ reg = <0x2c>;
+
+ backlight {
+ compatible = "skyworks,sky81452-backlight";
+ name = "pwm-backlight";
+ skyworks,en-channels = <0x3f>;
+ skyworks,ignore-pwm;
+ skyworks,phase-shift;
+ skyworks,ovp-level = <20>;
+ skyworks,current-limit = <2300>;
+ };
+
+ regulator {
+ lout {
+ regulator-name = "sky81452-lout";
+ regulator-min-microvolt = <4500000>;
+ regulator-max-microvolt = <8000000>;
+ };
+ };
+ };
--
1.9.1
^ permalink raw reply related
* [PATCH v10 4/6] devicetree: backlight: Add new SKY81452 backlight binding
From: gyungoh @ 2014-12-18 5:47 UTC (permalink / raw)
To: sameo, lee.jones, grant.likely, robh+dt, jg1.han, cooloney,
pawel.moll, mark.rutland, ijc+devicetree, galak, trivial
Cc: akpm, jic23, thomas.petazzoni, ktsai, hs, stwiss.opensource,
matti.vaittinen, broonie, jason, heiko, shawn.guo,
florian.vaussard, andrew, antonynpavlov, hytszk, plagnioj,
tomi.valkeinen, jack.yoo, linux-fbdev, linux-kernel, devicetree
In-Reply-To: <1418881671-3495-1-git-send-email-jack.yoo@skyworksinc.com>
From: Gyungoh Yoo <jack.yoo@skyworksinc.com>
Signed-off-by: Gyungoh Yoo <jack.yoo@skyworksinc.com>
Acked-by: Bryan Wu <cooloney@gmail.com>
---
Changes v10:
Nothing
Changes v9:
Nothing
Changes v8:
Renamed property names for backlight with vendor prefix
Modified gpio-enable property to generic property for GPIO
Made up the example for backlight DT
Changes v7:
Nothing
Changes v6:
Nothing
Changes v5:
Nothing
Changes v4:
Nothing
Changes v3:
Nothing
Changes v2:
Added reg attribute for I2C slave address
.../video/backlight/sky81452-backlight.txt | 29 ++++++++++++++++++++++
1 file changed, 29 insertions(+)
create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt
diff --git a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt
new file mode 100644
index 0000000..8daebf5
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt
@@ -0,0 +1,29 @@
+SKY81452-backlight bindings
+
+Required properties:
+- compatible : Must be "skyworks,sky81452-backlight"
+
+Optional properties:
+- name : Name of backlight device. Default is 'lcd-backlight'.
+- gpios : GPIO to use to EN pin.
+ See Documentation/devicetree/bindings/gpio/gpio.txt
+- skyworks,en-channels : Enable mask for current sink channel 1 to 6.
+- skyworks,ignore-pwm : Ignore both PWM input
+- skyworks,dpwm-mode : Enable DPWM dimming mode, otherwise Analog dimming.
+- skyworks,phase-shift : Enable phase shift mode
+- skyworks,ovp-level : Over-voltage protection level.
+ Should be between 14 or 28V.
+- skyworks,short-detection-threshold : It should be one of 4, 5, 6 and 7V.
+- skyworks,current-limit : It should be 2300mA or 2750mA.
+
+Example:
+
+ backlight {
+ compatible = "skyworks,sky81452-backlight";
+ name = "pwm-backlight";
+ skyworks,en-channels = <0x3f>;
+ skyworks,ignore-pwm;
+ skyworks,phase-shift;
+ skyworks,ovp-level = <20>;
+ skyworks,current-limit = <2300>;
+ };
--
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