* Re: [RFC PATCH 14/15] regulator: pwm: implement ->enable(), ->disable() and ->is_enabled methods
From: Mark Brown @ 2015-07-14 10:50 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1435738921-25027-15-git-send-email-boris.brezillon@free-electrons.com>
[-- Attachment #1: Type: text/plain, Size: 226 bytes --]
On Wed, Jul 01, 2015 at 10:22:00AM +0200, Boris Brezillon wrote:
> Implement the ->enable(), ->disable() and ->is_enabled methods and remove
> the PWM call in ->set_voltage_sel().
This doesn't apply, please check and resend.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply
* Re: [RFC v4 17/25] powerpc, fbdev: Use arch_nvram_ops methods instead of nvram_read_byte() and nvram
From: Finn Thain @ 2015-07-14 7:58 UTC (permalink / raw)
To: linux-kernel, linux-m68k, linuxppc-dev, Benjamin Herrenschmidt,
Paul Mackerras, Michael Ellerman, Arnd Bergmann,
Greg Kroah-Hartman, Jean-Christophe Plagniol-Villard,
Tomi Valkeinen, linux-fbdev
In-Reply-To: <20150712102531.505897278@telegraphics.com.au>
Make use of arch_nvram_ops in device drivers so that the nvram_* function
exports can be removed.
Since they are no longer global symbols, rename the PPC32 nvram_*
functions appropriately.
Add the missing CONFIG_NVRAM test to imsttfb to avoid a build failure.
Add a CONFIG_PPC32 test to matroxfb because PPC64 doesn't implement the
read_byte() method.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
---
Changed since v4:
- Added CONFIG_PPC32 test to matroxfb.
---
arch/powerpc/kernel/setup_32.c | 8 ++++----
drivers/char/generic_nvram.c | 4 ++--
drivers/video/fbdev/controlfb.c | 4 ++--
drivers/video/fbdev/imsttfb.c | 7 +++----
drivers/video/fbdev/matrox/matroxfb_base.c | 4 ++--
drivers/video/fbdev/platinumfb.c | 4 ++--
drivers/video/fbdev/valkyriefb.c | 4 ++--
7 files changed, 17 insertions(+), 18 deletions(-)
Index: linux/arch/powerpc/kernel/setup_32.c
=================================--- linux.orig/arch/powerpc/kernel/setup_32.c 2015-07-13 21:33:01.000000000 +1000
+++ linux/arch/powerpc/kernel/setup_32.c 2015-07-13 21:33:02.000000000 +1000
@@ -170,20 +170,18 @@ __setup("l3cr=", ppc_setup_l3cr);
#ifdef CONFIG_GENERIC_NVRAM
-unsigned char nvram_read_byte(int addr)
+static unsigned char ppc_nvram_read_byte(int addr)
{
if (ppc_md.nvram_read_val)
return ppc_md.nvram_read_val(addr);
return 0xff;
}
-EXPORT_SYMBOL(nvram_read_byte);
-void nvram_write_byte(unsigned char val, int addr)
+static void ppc_nvram_write_byte(unsigned char val, int addr)
{
if (ppc_md.nvram_write_val)
ppc_md.nvram_write_val(addr, val);
}
-EXPORT_SYMBOL(nvram_write_byte);
static ssize_t ppc_nvram_get_size(void)
{
@@ -200,6 +198,8 @@ static long ppc_nvram_sync(void)
}
const struct nvram_ops arch_nvram_ops = {
+ .read_byte = ppc_nvram_read_byte,
+ .write_byte = ppc_nvram_write_byte,
.get_size = ppc_nvram_get_size,
.sync = ppc_nvram_sync,
};
Index: linux/drivers/char/generic_nvram.c
=================================--- linux.orig/drivers/char/generic_nvram.c 2015-07-13 21:33:01.000000000 +1000
+++ linux/drivers/char/generic_nvram.c 2015-07-13 21:33:02.000000000 +1000
@@ -64,7 +64,7 @@ static ssize_t read_nvram(struct file *f
if (*ppos >= nvram_len)
return 0;
for (i = *ppos; count > 0 && i < nvram_len; ++i, ++p, --count)
- if (__put_user(nvram_read_byte(i), p))
+ if (__put_user(arch_nvram_ops.read_byte(i), p))
return -EFAULT;
*ppos = i;
return p - buf;
@@ -84,7 +84,7 @@ static ssize_t write_nvram(struct file *
for (i = *ppos; count > 0 && i < nvram_len; ++i, ++p, --count) {
if (__get_user(c, p))
return -EFAULT;
- nvram_write_byte(c, i);
+ arch_nvram_ops.write_byte(c, i);
}
*ppos = i;
return p - buf;
Index: linux/drivers/video/fbdev/controlfb.c
=================================--- linux.orig/drivers/video/fbdev/controlfb.c 2015-07-13 21:32:43.000000000 +1000
+++ linux/drivers/video/fbdev/controlfb.c 2015-07-13 21:33:02.000000000 +1000
@@ -415,7 +415,7 @@ static int __init init_control(struct fb
/* Try to pick a video mode out of NVRAM if we have one. */
#ifdef CONFIG_NVRAM
if (default_cmode = CMODE_NVRAM) {
- cmode = nvram_read_byte(NV_CMODE);
+ cmode = arch_nvram_ops.read_byte(NV_CMODE);
if(cmode < CMODE_8 || cmode > CMODE_32)
cmode = CMODE_8;
} else
@@ -423,7 +423,7 @@ static int __init init_control(struct fb
cmodeÞfault_cmode;
#ifdef CONFIG_NVRAM
if (default_vmode = VMODE_NVRAM) {
- vmode = nvram_read_byte(NV_VMODE);
+ vmode = arch_nvram_ops.read_byte(NV_VMODE);
if (vmode < 1 || vmode > VMODE_MAX ||
control_mac_modes[vmode - 1].m[full] < cmode) {
sense = read_control_sense(p);
Index: linux/drivers/video/fbdev/matrox/matroxfb_base.c
=================================--- linux.orig/drivers/video/fbdev/matrox/matroxfb_base.c 2015-07-13 21:32:57.000000000 +1000
+++ linux/drivers/video/fbdev/matrox/matroxfb_base.c 2015-07-13 21:33:02.000000000 +1000
@@ -1886,9 +1886,9 @@ static int initMatrox2(struct matrox_fb_
struct fb_var_screeninfo var;
if (default_vmode <= 0 || default_vmode > VMODE_MAX)
default_vmode = VMODE_640_480_60;
-#ifdef CONFIG_NVRAM
+#if defined(CONFIG_NVRAM) && defined(CONFIG_PPC32)
if (default_cmode = CMODE_NVRAM)
- default_cmode = nvram_read_byte(NV_CMODE);
+ default_cmode = arch_nvram_ops.read_byte(NV_CMODE);
#endif
if (default_cmode < CMODE_8 || default_cmode > CMODE_32)
default_cmode = CMODE_8;
Index: linux/drivers/video/fbdev/platinumfb.c
=================================--- linux.orig/drivers/video/fbdev/platinumfb.c 2015-07-13 21:32:43.000000000 +1000
+++ linux/drivers/video/fbdev/platinumfb.c 2015-07-13 21:33:02.000000000 +1000
@@ -349,7 +349,7 @@ static int platinum_init_fb(struct fb_in
printk(KERN_INFO "platinumfb: Monitor sense value = 0x%x, ", sense);
if (default_vmode = VMODE_NVRAM) {
#ifdef CONFIG_NVRAM
- default_vmode = nvram_read_byte(NV_VMODE);
+ default_vmode = arch_nvram_ops.read_byte(NV_VMODE);
if (default_vmode <= 0 || default_vmode > VMODE_MAX ||
!platinum_reg_init[default_vmode-1])
#endif
@@ -362,7 +362,7 @@ static int platinum_init_fb(struct fb_in
default_vmode = VMODE_640_480_60;
#ifdef CONFIG_NVRAM
if (default_cmode = CMODE_NVRAM)
- default_cmode = nvram_read_byte(NV_CMODE);
+ default_cmode = arch_nvram_ops.read_byte(NV_CMODE);
#endif
if (default_cmode < CMODE_8 || default_cmode > CMODE_32)
default_cmode = CMODE_8;
Index: linux/drivers/video/fbdev/valkyriefb.c
=================================--- linux.orig/drivers/video/fbdev/valkyriefb.c 2015-07-13 21:32:43.000000000 +1000
+++ linux/drivers/video/fbdev/valkyriefb.c 2015-07-13 21:33:02.000000000 +1000
@@ -287,7 +287,7 @@ static void __init valkyrie_choose_mode(
/* Try to pick a video mode out of NVRAM if we have one. */
#if !defined(CONFIG_MAC) && defined(CONFIG_NVRAM)
if (default_vmode = VMODE_NVRAM) {
- default_vmode = nvram_read_byte(NV_VMODE);
+ default_vmode = arch_nvram_ops.read_byte(NV_VMODE);
if (default_vmode <= 0
|| default_vmode > VMODE_MAX
|| !valkyrie_reg_init[default_vmode - 1])
@@ -300,7 +300,7 @@ static void __init valkyrie_choose_mode(
default_vmode = VMODE_640_480_67;
#if !defined(CONFIG_MAC) && defined(CONFIG_NVRAM)
if (default_cmode = CMODE_NVRAM)
- default_cmode = nvram_read_byte(NV_CMODE);
+ default_cmode = arch_nvram_ops.read_byte(NV_CMODE);
#endif
/*
Index: linux/drivers/video/fbdev/imsttfb.c
=================================--- linux.orig/drivers/video/fbdev/imsttfb.c 2015-07-13 21:32:43.000000000 +1000
+++ linux/drivers/video/fbdev/imsttfb.c 2015-07-13 21:33:02.000000000 +1000
@@ -328,7 +328,6 @@ enum {
TVP = 1
};
-#define USE_NV_MODES 1
#define INIT_BPP 8
#define INIT_XRES 640
#define INIT_YRES 480
@@ -1391,17 +1390,17 @@ static void init_imstt(struct fb_info *i
}
}
-#if USE_NV_MODES && defined(CONFIG_PPC32)
+#if defined(CONFIG_NVRAM) && defined(CONFIG_PPC32)
{
int vmode = init_vmode, cmode = init_cmode;
if (vmode = -1) {
- vmode = nvram_read_byte(NV_VMODE);
+ vmode = arch_nvram_ops.read_byte(NV_VMODE);
if (vmode <= 0 || vmode > VMODE_MAX)
vmode = VMODE_640_480_67;
}
if (cmode = -1) {
- cmode = nvram_read_byte(NV_CMODE);
+ cmode = arch_nvram_ops.read_byte(NV_CMODE);
if (cmode < CMODE_8 || cmode > CMODE_32)
cmode = CMODE_8;
}
^ permalink raw reply
* Re: [alsa-devel] [PATCH v2 11/12] ASoC: tegra: register dependency parser for firmware nodes
From: Tomeu Vizoso @ 2015-07-14 7:34 UTC (permalink / raw)
To: Mark Brown
Cc: devicetree@vger.kernel.org, linux-fbdev, Stephen Warren,
linux-kernel@vger.kernel.org, linux-gpio, Rafael J. Wysocki,
alsa-devel, dri-devel@lists.freedesktop.org, Liam Girdwood,
linux-acpi, Linux PWM List, linux-tegra@vger.kernel.org,
Alexandre Courbot
In-Reply-To: <20150713154254.GH11162@sirena.org.uk>
On 13 July 2015 at 17:42, Mark Brown <broonie@kernel.org> wrote:
> On Mon, Jul 13, 2015 at 02:10:45PM +0200, Tomeu Vizoso wrote:
>> On 1 July 2015 at 19:38, Mark Brown <broonie@kernel.org> wrote:
>> > On Wed, Jul 01, 2015 at 11:41:06AM +0200, Tomeu Vizoso wrote:
>
>> >> +static void tegra_max98090_get_dependencies(struct fwnode_handle *fwnode,
>> >> + struct list_head *deps)
>> >> +{
>> >> + add_dependency(fwnode, "nvidia,i2s-controller", deps);
>> >> + add_dependency(fwnode, "nvidia,audio-codec", deps);
>> >> +}
>
>> > Why is this all being open coded in an individual driver (we already
>> > know about and manage all these dependencies in the core...)? If we're
>> > going to do this I'd expect the interface for specifying DT nodes to the
>> > core to be changed to support this.
>
>> Are you thinking of changing drivers to acquire their resources
>> through Arnd's devm_probe (only that the resource table would have to
>> be in struct device_driver)?
>
>> https://lkml.kernel.org/g/4742258.TBitC3hVuO@wuerfel
>
> No, I'm looking at how we already have all the "did all my dependencies
> appear" logic in the core based on data provided by the drivers.
Sorry, but I still don't get what you mean.
Information about dependencies is currently available only after
probe() starts executing, and used to decide whether we want to defer
the probe.
The goal of this series is to eliminate most or all of the deferred
probes by checking that all dependencies are available before probe()
is called.
Because currently we only have dependency information after probe()
starts executing, we have to make it available earlier. In this
particular version, in callbacks that are registered from the
initcalls that register subsystems, classes, drivers, etc. Whatever
knows how these dependencies are expressed in the firmware data.
I thought you were pointing out that the property names would be
duplicated, once in the probe() implementation and also in the
implementation of the get_dependencies callback.
A way to consolidate the code and remove that duplication would be
having a declarative API for expressing dependencies, which could be
used for both fetching dependencies and for preventing deferred
probes. That's why I mentioned devm_probe.
Thanks,
Tomeu
^ permalink raw reply
* [PATCH] staging: sm750fb: coding style fixes
From: Vinay Simha BN @ 2015-07-14 6:58 UTC (permalink / raw)
To: linux-fbdev
kernel coding style fixes for below messages from
scripts/checkpatch.pl
WARNING: line over 80 character
WARNING: Possible unnecessary 'out of memory' message
WARNING: unnecessary whitespace before a quoted newline
WARNING: Avoid line continuations in quoted strings
ERROR: "foo * bar" should be "foo *bar"
ERROR: do not initialise globals to 0 or NULL
Signed-off-by: Vinay Simha BN <simhavcs@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 49 ++++++++++++++++++++++++-----------------
1 file changed, 29 insertions(+), 20 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 6b642d7..12214f7 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -24,7 +24,7 @@
#include "modedb.h"
-int smi_indent = 0;
+int smi_indent;
/*
@@ -47,9 +47,9 @@ static int g_noaccel;
static int g_nomtrr;
static const char *g_fbmode[] = {NULL, NULL};
static const char *g_def_fbmode = "800x600-16@60";
-static char *g_settings = NULL;
+static char *g_settings;
static int g_dualview;
-static char *g_option = NULL;
+static char *g_option;
static const struct fb_videomode lynx750_ext[] = {
@@ -150,12 +150,16 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor)
u16 fg, bg;
fg = ((info->cmap.red[fbcursor->image.fg_color] & 0xf800))|
- ((info->cmap.green[fbcursor->image.fg_color] & 0xfc00) >> 5)|
- ((info->cmap.blue[fbcursor->image.fg_color] & 0xf800) >> 11);
+ ((info->cmap.green[fbcursor->image.fg_color]
+ & 0xfc00) >> 5)|
+ ((info->cmap.blue[fbcursor->image.fg_color]
+ & 0xf800) >> 11);
bg = ((info->cmap.red[fbcursor->image.bg_color] & 0xf800))|
- ((info->cmap.green[fbcursor->image.bg_color] & 0xfc00) >> 5)|
- ((info->cmap.blue[fbcursor->image.bg_color] & 0xf800) >> 11);
+ ((info->cmap.green[fbcursor->image.bg_color] &
+ 0xfc00) >> 5)|
+ ((info->cmap.blue[fbcursor->image.bg_color] &
+ 0xf800) >> 11);
cursor->setColor(cursor, fg, bg);
}
@@ -194,7 +198,8 @@ static void lynxfb_ops_fillrect(struct fb_info *info,
pitch = info->fix.line_length;
Bpp = info->var.bits_per_pixel >> 3;
- color = (Bpp = 1)?region->color:((u32 *)info->pseudo_palette)[region->color];
+ color = (Bpp = 1) ?
+ region->color : ((u32 *)info->pseudo_palette)[region->color];
rop = (region->rop != ROP_COPY) ? HW_ROP2_XOR:HW_ROP2_COPY;
/*
@@ -445,7 +450,8 @@ static int lynxfb_suspend(struct pci_dev *pdev, pm_message_t mesg)
pci_disable_device(pdev);
ret = pci_set_power_state(pdev, pci_choose_state(pdev, mesg));
if (ret) {
- pr_err("error:%d occurred in pci_set_power_state\n", ret);
+ pr_err("error:%d occurred in
+ pci_set_power_state\n", ret);
return ret;
}
}
@@ -699,7 +705,8 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
output = &par->output;
crtc = &par->crtc;
- crtc->vidmem_size = (share->dual)?share->vidmem_size>>1:share->vidmem_size;
+ crtc->vidmem_size = (share->dual) ?
+ share->vidmem_size>>1 : share->vidmem_size;
/* setup crtc and output member */
spec_share->hwCursor = g_hwcursor;
@@ -716,10 +723,12 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
output->proc_setMode = hw_sm750_output_setMode;
output->proc_checkMode = hw_sm750_output_checkMode;
- output->proc_setBLANK = (share->revid = SM750LE_REVISION_ID)?hw_sm750le_setBLANK:hw_sm750_setBLANK;
+ output->proc_setBLANK = (share->revid = SM750LE_REVISION_ID) ?
+ hw_sm750le_setBLANK : hw_sm750_setBLANK;
output->clear = hw_sm750_output_clear;
/* chip specific phase */
- share->accel.de_wait = (share->revid = SM750LE_REVISION_ID)?hw_sm750le_deWait : hw_sm750_deWait;
+ share->accel.de_wait = (share->revid = SM750LE_REVISION_ID) ?
+ hw_sm750le_deWait : hw_sm750_deWait;
switch (spec_share->state.dataflow) {
case sm750_simul_pri:
output->paths = sm750_pnc;
@@ -743,7 +752,8 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
} else {
output->paths = sm750_crt;
crtc->channel = sm750_secondary;
- /* not consider of padding stuffs for oScreen,need fix */
+ /* not consider of padding stuffs
+ for oScreen,need fix */
crtc->oScreen = (share->vidmem_size >> 1);
crtc->vScreen = share->pvMem + crtc->oScreen;
}
@@ -757,7 +767,8 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
} else {
output->paths = sm750_crt;
crtc->channel = sm750_primary;
- /* not consider of padding stuffs for oScreen,need fix */
+ /* not consider of padding stuffs
+ for oScreen,need fix */
crtc->oScreen = (share->vidmem_size >> 1);
crtc->vScreen = share->pvMem + crtc->oScreen;
}
@@ -895,7 +906,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
/* some member of info->var had been set by fb_find_mode */
- pr_info("Member of info->var is :\n\
+ pr_info("Member of info->var is :\n
xres=%d\n\
yres=%d\n\
xres_virtual=%d\n\
@@ -967,7 +978,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
var->accel_flags = 0;
var->vmode = FB_VMODE_NONINTERLACED;
- pr_debug("#1 show info->cmap : \nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n",
+ pr_debug("#1 show info->cmap :\nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n",
info->cmap.start, info->cmap.len,
info->cmap.red, info->cmap.green, info->cmap.blue,
info->cmap.transp);
@@ -1087,7 +1098,7 @@ NO_PARAM:
}
static int lynxfb_pci_probe(struct pci_dev *pdev,
- const struct pci_device_id * ent)
+ const struct pci_device_id *ent)
{
struct fb_info *info[] = {NULL, NULL};
struct lynx_share *share = NULL;
@@ -1108,10 +1119,8 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
spec_offset = offsetof(struct sm750_share, share);
spec_share = kzalloc(sizeof(*spec_share), GFP_KERNEL);
- if (!spec_share) {
- pr_err("Could not allocate memory for share.\n");
+ if (!spec_share)
goto err_share;
- }
/* setting share structure */
share = (struct lynx_share *)(&(spec_share->share));
--
2.1.2
^ permalink raw reply related
* [PATCH] staging: sm750fb: ddk750_chip: use consistent spacing
From: Sunil Shahu @ 2015-07-14 6:32 UTC (permalink / raw)
To: linux-fbdev
Remove all checkpatch error by using consistent spacing.
Signed-off-by: Sunil Shahu <shshahu@gmail.com>
---
drivers/staging/sm750fb/ddk750_chip.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c
index f4975d2..1564c04 100644
--- a/drivers/staging/sm750fb/ddk750_chip.c
+++ b/drivers/staging/sm750fb/ddk750_chip.c
@@ -268,7 +268,7 @@ int ddk750_initHw(initchip_param_t *pInitParam)
#endif
- if (pInitParam->powerMode != 0 )
+ if (pInitParam->powerMode != 0)
pInitParam->powerMode = 0;
setPowerMode(pInitParam->powerMode);
@@ -464,17 +464,17 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll)
RN = N * request;
quo = RN / input;
rem = RN % input;/* rem always small than 14318181 */
- fl_quo = (rem * 10000 /input);
+ fl_quo = (rem * 10000 / input);
for (d = xcnt - 1; d >= 0; d--) {
X = xparm[d].value;
M = quo*X;
M += fl_quo * X / 10000;
/* round step */
- M += (fl_quo*X % 10000)>5000?1:0;
+ M += (fl_quo*X % 10000) > 5000 ? 1 : 0;
if (M < 256 && M > 0) {
unsigned int diff;
- tmpClock = pll->inputFreq *M / N / X;
+ tmpClock = pll->inputFreq * M / N / X;
diff = absDiff(tmpClock, request_orig);
if (diff < miniDiff) {
pll->M = M;
@@ -599,9 +599,9 @@ unsigned int formatPllReg(pll_value_t *pPLL)
On returning a 32 bit number, the value can be applied to any PLL in the calling function.
*/
ulPllReg - FIELD_SET( 0, PANEL_PLL_CTRL, BYPASS, OFF)
- | FIELD_SET( 0, PANEL_PLL_CTRL, POWER, ON)
- | FIELD_SET( 0, PANEL_PLL_CTRL, INPUT, OSC)
+ FIELD_SET(0, PANEL_PLL_CTRL, BYPASS, OFF)
+ | FIELD_SET(0, PANEL_PLL_CTRL, POWER, ON)
+ | FIELD_SET(0, PANEL_PLL_CTRL, INPUT, OSC)
#ifndef VALIDATION_CHIP
| FIELD_VALUE(0, PANEL_PLL_CTRL, POD, pPLL->POD)
#endif
--
1.9.1
^ permalink raw reply related
* Re: [alsa-devel] [PATCH v2 11/12] ASoC: tegra: register dependency parser for firmware nodes
From: Mark Brown @ 2015-07-13 15:42 UTC (permalink / raw)
To: Tomeu Vizoso
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
linux-gpio-u79uwXL29TY76Z2rM5mHXA, Takashi Iwai, Liam Girdwood,
Stephen Warren, Rafael J. Wysocki,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
linux-acpi-u79uwXL29TY76Z2rM5mHXA, Thierry Reding, Linux PWM List,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Alexandre Courbot
In-Reply-To: <CAAObsKDsEuDS46rW9CMuviDEDV-OVXe5q-kiWmw0D_n2D3Tf5A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1122 bytes --]
On Mon, Jul 13, 2015 at 02:10:45PM +0200, Tomeu Vizoso wrote:
> On 1 July 2015 at 19:38, Mark Brown <broonie@kernel.org> wrote:
> > On Wed, Jul 01, 2015 at 11:41:06AM +0200, Tomeu Vizoso wrote:
> >> +static void tegra_max98090_get_dependencies(struct fwnode_handle *fwnode,
> >> + struct list_head *deps)
> >> +{
> >> + add_dependency(fwnode, "nvidia,i2s-controller", deps);
> >> + add_dependency(fwnode, "nvidia,audio-codec", deps);
> >> +}
> > Why is this all being open coded in an individual driver (we already
> > know about and manage all these dependencies in the core...)? If we're
> > going to do this I'd expect the interface for specifying DT nodes to the
> > core to be changed to support this.
> Are you thinking of changing drivers to acquire their resources
> through Arnd's devm_probe (only that the resource table would have to
> be in struct device_driver)?
> https://lkml.kernel.org/g/4742258.TBitC3hVuO@wuerfel
No, I'm looking at how we already have all the "did all my dependencies
appear" logic in the core based on data provided by the drivers.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply
* Re: [PATCH] Const-qualify, WARNING, out-of memory usage fixes
From: Sudip Mukherjee @ 2015-07-13 13:30 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1436725139-32636-1-git-send-email-simhavcs@gmail.com>
On Mon, Jul 13, 2015 at 03:24:28PM +0300, Dan Carpenter wrote:
> Subject is bad.
I guess I missed this patch because of the subject.
Vinay - the subject should be "staging: sm750fb: xyz ".
You place your subject in place of xyz.
regards
sudip
^ permalink raw reply
* Re: [PATCH] Const-qualify, WARNING, out-of memory usage fixes
From: Dan Carpenter @ 2015-07-13 12:24 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1436725139-32636-1-git-send-email-simhavcs@gmail.com>
Subject is bad.
No patch description.
Mixing too many types of cleanups.
The const thing seems like it will break things (buggy).
regards,
dan carpenter
^ permalink raw reply
* Re: [alsa-devel] [PATCH v2 11/12] ASoC: tegra: register dependency parser for firmware nodes
From: Tomeu Vizoso @ 2015-07-13 12:10 UTC (permalink / raw)
To: Mark Brown
Cc: devicetree@vger.kernel.org, linux-fbdev, linux-acpi, alsa-devel,
Stephen Warren, Rafael J. Wysocki, Liam Girdwood,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
linux-gpio, Linux PWM List, linux-tegra@vger.kernel.org,
Alexandre Courbot
In-Reply-To: <20150701173802.GW11162@sirena.org.uk>
On 1 July 2015 at 19:38, Mark Brown <broonie@kernel.org> wrote:
> On Wed, Jul 01, 2015 at 11:41:06AM +0200, Tomeu Vizoso wrote:
>
>> +static void tegra_max98090_get_dependencies(struct fwnode_handle *fwnode,
>> + struct list_head *deps)
>> +{
>> + add_dependency(fwnode, "nvidia,i2s-controller", deps);
>> + add_dependency(fwnode, "nvidia,audio-codec", deps);
>> +}
>
> Why is this all being open coded in an individual driver (we already
> know about and manage all these dependencies in the core...)? If we're
> going to do this I'd expect the interface for specifying DT nodes to the
> core to be changed to support this.
Are you thinking of changing drivers to acquire their resources
through Arnd's devm_probe (only that the resource table would have to
be in struct device_driver)?
https://lkml.kernel.org/g/4742258.TBitC3hVuO@wuerfel
Sounds like lots of fun, but that means that any given machine will
get ordered probe only after all the drivers it uses have been moved
to the new declarative API.
TBH, that seems really far away.
Regards,
Tomeu
^ permalink raw reply
* Re: [PATCH] pwm-backlight: Avoid backlight flicker when probed from DT
From: Philipp Zabel @ 2015-07-13 9:40 UTC (permalink / raw)
To: Thierry Reding, Lee Jones, Jingoo Han, Ajay Kumar
Cc: linux-pwm, linux-fbdev, linux-kernel, kernel
In-Reply-To: <1434126377-22545-1-git-send-email-p.zabel@pengutronix.de>
Hi,
Am Freitag, den 12.06.2015, 18:26 +0200 schrieb Philipp Zabel:
> If the driver is probed from the device tree, and there is a phandle
> property set on it, and the enable GPIO is already configured as output,
> and the backlight is currently disabled, keep it disabled.
> If all these conditions are met, assume there will be some other driver
> that can enable the backlight at the appropriate time.
>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
> I have seen the thread at https://lkml.org/lkml/2014/7/31/259, but I'm not
> sure if it has come to a resolution. This is what I think could be useful
> to keep the current default behaviour of enabling the backlight while at the
> same time allowing to keep it disabled if we are absolutely certain that the
> backlight is currently off, and we think there is some other driver that will
> control it:
do you have any comments on this? Would the conditions mentioned above
be sufficient for your use cases?
best regards
Philipp
> ---
> drivers/video/backlight/pwm_bl.c | 19 +++++++++++++++++--
> 1 file changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
> index 6897f1c..dcb6bfb 100644
> --- a/drivers/video/backlight/pwm_bl.c
> +++ b/drivers/video/backlight/pwm_bl.c
> @@ -199,6 +199,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)
> struct backlight_properties props;
> struct backlight_device *bl;
> struct pwm_bl_data *pb;
> + int initial_blank = FB_BLANK_UNBLANK;
> int ret;
>
> if (!data) {
> @@ -263,8 +264,21 @@ static int pwm_backlight_probe(struct platform_device *pdev)
> pb->enable_gpio = gpio_to_desc(data->enable_gpio);
> }
>
> - if (pb->enable_gpio)
> - gpiod_direction_output(pb->enable_gpio, 1);
> + if (pb->enable_gpio) {
> + /*
> + * If the driver is probed from the device tree and there is a
> + * phandle link pointing to the backlight node, it is safe to
> + * assume that another driver will enable the backlight at the
> + * appropriate time. Therefore, if it is disabled, keep it so.
> + */
> + if (of_find_property(pdev->dev.of_node, "phandle", NULL) &&
> + gpiod_get_direction(pb->enable_gpio) = GPIOF_DIR_OUT &&
> + gpiod_get_value(pb->enable_gpio) = 0) {
> + initial_blank = FB_BLANK_POWERDOWN;
> + } else {
> + gpiod_direction_output(pb->enable_gpio, 1);
> + }
> + }
>
> pb->power_supply = devm_regulator_get(&pdev->dev, "power");
> if (IS_ERR(pb->power_supply)) {
> @@ -323,6 +337,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)
> }
>
> bl->props.brightness = data->dft_brightness;
> + bl->props.power = initial_blank;
> backlight_update_status(bl);
>
> platform_set_drvdata(pdev, bl);
^ permalink raw reply
* [PATCH] Const-qualify, WARNING, out-of memory usage fixes
From: Vinay Simha BN @ 2015-07-12 18:30 UTC (permalink / raw)
To: linux-fbdev
Signed-off-by: Vinay Simha BN <simhavcs@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 53 +++++++++++++++++++++++++----------------
1 file changed, 32 insertions(+), 21 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 6b642d7..f378843 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -24,7 +24,7 @@
#include "modedb.h"
-int smi_indent = 0;
+int smi_indent;
/*
@@ -45,11 +45,11 @@ typedef int (*PROC_SPEC_INITHW)(struct lynx_share*, struct pci_dev*);
static int g_hwcursor = 1;
static int g_noaccel;
static int g_nomtrr;
-static const char *g_fbmode[] = {NULL, NULL};
-static const char *g_def_fbmode = "800x600-16@60";
-static char *g_settings = NULL;
+static const char *const g_fbmode[] = {NULL, NULL};
+static const char *const g_def_fbmode = "800x600-16@60";
+static char *g_settings;
static int g_dualview;
-static char *g_option = NULL;
+static char *g_option;
static const struct fb_videomode lynx750_ext[] = {
@@ -150,12 +150,16 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor)
u16 fg, bg;
fg = ((info->cmap.red[fbcursor->image.fg_color] & 0xf800))|
- ((info->cmap.green[fbcursor->image.fg_color] & 0xfc00) >> 5)|
- ((info->cmap.blue[fbcursor->image.fg_color] & 0xf800) >> 11);
+ ((info->cmap.green[fbcursor->image.fg_color]
+ & 0xfc00) >> 5)|
+ ((info->cmap.blue[fbcursor->image.fg_color]
+ & 0xf800) >> 11);
bg = ((info->cmap.red[fbcursor->image.bg_color] & 0xf800))|
- ((info->cmap.green[fbcursor->image.bg_color] & 0xfc00) >> 5)|
- ((info->cmap.blue[fbcursor->image.bg_color] & 0xf800) >> 11);
+ ((info->cmap.green[fbcursor->image.bg_color] &
+ 0xfc00) >> 5)|
+ ((info->cmap.blue[fbcursor->image.bg_color] &
+ 0xf800) >> 11);
cursor->setColor(cursor, fg, bg);
}
@@ -194,7 +198,8 @@ static void lynxfb_ops_fillrect(struct fb_info *info,
pitch = info->fix.line_length;
Bpp = info->var.bits_per_pixel >> 3;
- color = (Bpp = 1)?region->color:((u32 *)info->pseudo_palette)[region->color];
+ color = (Bpp = 1) ?
+ region->color : ((u32 *)info->pseudo_palette)[region->color];
rop = (region->rop != ROP_COPY) ? HW_ROP2_XOR:HW_ROP2_COPY;
/*
@@ -445,7 +450,8 @@ static int lynxfb_suspend(struct pci_dev *pdev, pm_message_t mesg)
pci_disable_device(pdev);
ret = pci_set_power_state(pdev, pci_choose_state(pdev, mesg));
if (ret) {
- pr_err("error:%d occurred in pci_set_power_state\n", ret);
+ pr_err("error:%d occurred in
+ pci_set_power_state\n", ret);
return ret;
}
}
@@ -699,7 +705,8 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
output = &par->output;
crtc = &par->crtc;
- crtc->vidmem_size = (share->dual)?share->vidmem_size>>1:share->vidmem_size;
+ crtc->vidmem_size = (share->dual) ?
+ share->vidmem_size>>1 : share->vidmem_size;
/* setup crtc and output member */
spec_share->hwCursor = g_hwcursor;
@@ -716,10 +723,12 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
output->proc_setMode = hw_sm750_output_setMode;
output->proc_checkMode = hw_sm750_output_checkMode;
- output->proc_setBLANK = (share->revid = SM750LE_REVISION_ID)?hw_sm750le_setBLANK:hw_sm750_setBLANK;
+ output->proc_setBLANK = (share->revid = SM750LE_REVISION_ID) ?
+ hw_sm750le_setBLANK : hw_sm750_setBLANK;
output->clear = hw_sm750_output_clear;
/* chip specific phase */
- share->accel.de_wait = (share->revid = SM750LE_REVISION_ID)?hw_sm750le_deWait : hw_sm750_deWait;
+ share->accel.de_wait = (share->revid = SM750LE_REVISION_ID) ?
+ hw_sm750le_deWait : hw_sm750_deWait;
switch (spec_share->state.dataflow) {
case sm750_simul_pri:
output->paths = sm750_pnc;
@@ -743,7 +752,8 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
} else {
output->paths = sm750_crt;
crtc->channel = sm750_secondary;
- /* not consider of padding stuffs for oScreen,need fix */
+ /* not consider of padding stuffs
+ for oScreen,need fix */
crtc->oScreen = (share->vidmem_size >> 1);
crtc->vScreen = share->pvMem + crtc->oScreen;
}
@@ -757,7 +767,8 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
} else {
output->paths = sm750_crt;
crtc->channel = sm750_primary;
- /* not consider of padding stuffs for oScreen,need fix */
+ /* not consider of padding stuffs
+ for oScreen,need fix */
crtc->oScreen = (share->vidmem_size >> 1);
crtc->vScreen = share->pvMem + crtc->oScreen;
}
@@ -797,7 +808,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
lynx750_ext, NULL, vesa_modes,
};
int cdb[] = {ARRAY_SIZE(lynx750_ext), 0, VESA_MODEDB_SIZE};
- static const char *mdb_desc[] = {
+ static const char *const mdb_desc[] = {
"driver prepared modes",
"kernel prepared default modedb",
"kernel HELPERS prepared vesa_modes",
@@ -895,7 +906,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
/* some member of info->var had been set by fb_find_mode */
- pr_info("Member of info->var is :\n\
+ pr_info("Member of info->var is :\n
xres=%d\n\
yres=%d\n\
xres_virtual=%d\n\
@@ -967,7 +978,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
var->accel_flags = 0;
var->vmode = FB_VMODE_NONINTERLACED;
- pr_debug("#1 show info->cmap : \nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n",
+ pr_debug("#1 show info->cmap :\nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n",
info->cmap.start, info->cmap.len,
info->cmap.red, info->cmap.green, info->cmap.blue,
info->cmap.transp);
@@ -1087,7 +1098,7 @@ NO_PARAM:
}
static int lynxfb_pci_probe(struct pci_dev *pdev,
- const struct pci_device_id * ent)
+ const struct pci_device_id *ent)
{
struct fb_info *info[] = {NULL, NULL};
struct lynx_share *share = NULL;
@@ -1109,7 +1120,7 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
spec_share = kzalloc(sizeof(*spec_share), GFP_KERNEL);
if (!spec_share) {
- pr_err("Could not allocate memory for share.\n");
+ /*pr_err("Could not allocate memory for share.\n");*/
goto err_share;
}
--
2.1.2
^ permalink raw reply related
* [RFC v4 17/25] powerpc, fbdev: Use arch_nvram_ops methods instead of nvram_read_byte() and nvram_wri
From: Finn Thain @ 2015-07-12 10:25 UTC (permalink / raw)
To: linux-kernel, linux-m68k, linuxppc-dev, Benjamin Herrenschmidt,
Paul Mackerras, Michael Ellerman, Arnd Bergmann,
Greg Kroah-Hartman, Jean-Christophe Plagniol-Villard,
Tomi Valkeinen, linux-fbdev
In-Reply-To: <20150712102527.356151908@telegraphics.com.au>
Make use of arch_nvram_ops in device drivers so that the nvram_*
function exports can be removed.
Since they are no longer global symbols, rename the PPC32 nvram_* functions
appropriately.
Add the missing CONFIG_NVRAM test to imsttfb to avoid a build failure.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
---
arch/powerpc/kernel/setup_32.c | 8 ++++----
drivers/char/generic_nvram.c | 4 ++--
drivers/video/fbdev/controlfb.c | 4 ++--
drivers/video/fbdev/imsttfb.c | 7 +++----
drivers/video/fbdev/matrox/matroxfb_base.c | 2 +-
drivers/video/fbdev/platinumfb.c | 4 ++--
drivers/video/fbdev/valkyriefb.c | 4 ++--
7 files changed, 16 insertions(+), 17 deletions(-)
Index: linux/arch/powerpc/kernel/setup_32.c
=================================--- linux.orig/arch/powerpc/kernel/setup_32.c 2015-07-12 20:25:11.000000000 +1000
+++ linux/arch/powerpc/kernel/setup_32.c 2015-07-12 20:25:13.000000000 +1000
@@ -170,20 +170,18 @@ __setup("l3cr=", ppc_setup_l3cr);
#ifdef CONFIG_GENERIC_NVRAM
-unsigned char nvram_read_byte(int addr)
+static unsigned char ppc_nvram_read_byte(int addr)
{
if (ppc_md.nvram_read_val)
return ppc_md.nvram_read_val(addr);
return 0xff;
}
-EXPORT_SYMBOL(nvram_read_byte);
-void nvram_write_byte(unsigned char val, int addr)
+static void ppc_nvram_write_byte(unsigned char val, int addr)
{
if (ppc_md.nvram_write_val)
ppc_md.nvram_write_val(addr, val);
}
-EXPORT_SYMBOL(nvram_write_byte);
static ssize_t ppc_nvram_get_size(void)
{
@@ -200,6 +198,8 @@ static long ppc_nvram_sync(void)
}
const struct nvram_ops arch_nvram_ops = {
+ .read_byte = ppc_nvram_read_byte,
+ .write_byte = ppc_nvram_write_byte,
.get_size = ppc_nvram_get_size,
.sync = ppc_nvram_sync,
};
Index: linux/drivers/char/generic_nvram.c
=================================--- linux.orig/drivers/char/generic_nvram.c 2015-07-12 20:25:11.000000000 +1000
+++ linux/drivers/char/generic_nvram.c 2015-07-12 20:25:13.000000000 +1000
@@ -64,7 +64,7 @@ static ssize_t read_nvram(struct file *f
if (*ppos >= nvram_len)
return 0;
for (i = *ppos; count > 0 && i < nvram_len; ++i, ++p, --count)
- if (__put_user(nvram_read_byte(i), p))
+ if (__put_user(arch_nvram_ops.read_byte(i), p))
return -EFAULT;
*ppos = i;
return p - buf;
@@ -84,7 +84,7 @@ static ssize_t write_nvram(struct file *
for (i = *ppos; count > 0 && i < nvram_len; ++i, ++p, --count) {
if (__get_user(c, p))
return -EFAULT;
- nvram_write_byte(c, i);
+ arch_nvram_ops.write_byte(c, i);
}
*ppos = i;
return p - buf;
Index: linux/drivers/video/fbdev/controlfb.c
=================================--- linux.orig/drivers/video/fbdev/controlfb.c 2015-07-12 20:24:53.000000000 +1000
+++ linux/drivers/video/fbdev/controlfb.c 2015-07-12 20:25:13.000000000 +1000
@@ -415,7 +415,7 @@ static int __init init_control(struct fb
/* Try to pick a video mode out of NVRAM if we have one. */
#ifdef CONFIG_NVRAM
if (default_cmode = CMODE_NVRAM) {
- cmode = nvram_read_byte(NV_CMODE);
+ cmode = arch_nvram_ops.read_byte(NV_CMODE);
if(cmode < CMODE_8 || cmode > CMODE_32)
cmode = CMODE_8;
} else
@@ -423,7 +423,7 @@ static int __init init_control(struct fb
cmodeÞfault_cmode;
#ifdef CONFIG_NVRAM
if (default_vmode = VMODE_NVRAM) {
- vmode = nvram_read_byte(NV_VMODE);
+ vmode = arch_nvram_ops.read_byte(NV_VMODE);
if (vmode < 1 || vmode > VMODE_MAX ||
control_mac_modes[vmode - 1].m[full] < cmode) {
sense = read_control_sense(p);
Index: linux/drivers/video/fbdev/matrox/matroxfb_base.c
=================================--- linux.orig/drivers/video/fbdev/matrox/matroxfb_base.c 2015-07-12 20:25:08.000000000 +1000
+++ linux/drivers/video/fbdev/matrox/matroxfb_base.c 2015-07-12 20:25:13.000000000 +1000
@@ -1888,7 +1888,7 @@ static int initMatrox2(struct matrox_fb_
default_vmode = VMODE_640_480_60;
#ifdef CONFIG_NVRAM
if (default_cmode = CMODE_NVRAM)
- default_cmode = nvram_read_byte(NV_CMODE);
+ default_cmode = arch_nvram_ops.read_byte(NV_CMODE);
#endif
if (default_cmode < CMODE_8 || default_cmode > CMODE_32)
default_cmode = CMODE_8;
Index: linux/drivers/video/fbdev/platinumfb.c
=================================--- linux.orig/drivers/video/fbdev/platinumfb.c 2015-07-12 20:24:53.000000000 +1000
+++ linux/drivers/video/fbdev/platinumfb.c 2015-07-12 20:25:13.000000000 +1000
@@ -349,7 +349,7 @@ static int platinum_init_fb(struct fb_in
printk(KERN_INFO "platinumfb: Monitor sense value = 0x%x, ", sense);
if (default_vmode = VMODE_NVRAM) {
#ifdef CONFIG_NVRAM
- default_vmode = nvram_read_byte(NV_VMODE);
+ default_vmode = arch_nvram_ops.read_byte(NV_VMODE);
if (default_vmode <= 0 || default_vmode > VMODE_MAX ||
!platinum_reg_init[default_vmode-1])
#endif
@@ -362,7 +362,7 @@ static int platinum_init_fb(struct fb_in
default_vmode = VMODE_640_480_60;
#ifdef CONFIG_NVRAM
if (default_cmode = CMODE_NVRAM)
- default_cmode = nvram_read_byte(NV_CMODE);
+ default_cmode = arch_nvram_ops.read_byte(NV_CMODE);
#endif
if (default_cmode < CMODE_8 || default_cmode > CMODE_32)
default_cmode = CMODE_8;
Index: linux/drivers/video/fbdev/valkyriefb.c
=================================--- linux.orig/drivers/video/fbdev/valkyriefb.c 2015-07-12 20:24:53.000000000 +1000
+++ linux/drivers/video/fbdev/valkyriefb.c 2015-07-12 20:25:13.000000000 +1000
@@ -287,7 +287,7 @@ static void __init valkyrie_choose_mode(
/* Try to pick a video mode out of NVRAM if we have one. */
#if !defined(CONFIG_MAC) && defined(CONFIG_NVRAM)
if (default_vmode = VMODE_NVRAM) {
- default_vmode = nvram_read_byte(NV_VMODE);
+ default_vmode = arch_nvram_ops.read_byte(NV_VMODE);
if (default_vmode <= 0
|| default_vmode > VMODE_MAX
|| !valkyrie_reg_init[default_vmode - 1])
@@ -300,7 +300,7 @@ static void __init valkyrie_choose_mode(
default_vmode = VMODE_640_480_67;
#if !defined(CONFIG_MAC) && defined(CONFIG_NVRAM)
if (default_cmode = CMODE_NVRAM)
- default_cmode = nvram_read_byte(NV_CMODE);
+ default_cmode = arch_nvram_ops.read_byte(NV_CMODE);
#endif
/*
Index: linux/drivers/video/fbdev/imsttfb.c
=================================--- linux.orig/drivers/video/fbdev/imsttfb.c 2015-07-12 20:24:53.000000000 +1000
+++ linux/drivers/video/fbdev/imsttfb.c 2015-07-12 20:25:13.000000000 +1000
@@ -328,7 +328,6 @@ enum {
TVP = 1
};
-#define USE_NV_MODES 1
#define INIT_BPP 8
#define INIT_XRES 640
#define INIT_YRES 480
@@ -1391,17 +1390,17 @@ static void init_imstt(struct fb_info *i
}
}
-#if USE_NV_MODES && defined(CONFIG_PPC32)
+#if defined(CONFIG_NVRAM) && defined(CONFIG_PPC32)
{
int vmode = init_vmode, cmode = init_cmode;
if (vmode = -1) {
- vmode = nvram_read_byte(NV_VMODE);
+ vmode = arch_nvram_ops.read_byte(NV_VMODE);
if (vmode <= 0 || vmode > VMODE_MAX)
vmode = VMODE_640_480_67;
}
if (cmode = -1) {
- cmode = nvram_read_byte(NV_CMODE);
+ cmode = arch_nvram_ops.read_byte(NV_CMODE);
if (cmode < CMODE_8 || cmode > CMODE_32)
cmode = CMODE_8;
}
^ permalink raw reply
* [RFC v4 13/25] powerpc: Cleanup nvram includes
From: Finn Thain @ 2015-07-12 10:25 UTC (permalink / raw)
To: linux-kernel, linux-m68k, linuxppc-dev, Benjamin Herrenschmidt,
Paul Mackerras, Michael Ellerman, Arnd Bergmann,
Greg Kroah-Hartman, Jean-Christophe Plagniol-Villard,
Tomi Valkeinen, linux-fbdev
In-Reply-To: <20150712102527.356151908@telegraphics.com.au>
The nvram_read_byte() and nvram_write_byte() definitions in asm/nvram.h
duplicate those in linux/nvram.h. Get rid of the former to prepare for
adoption of struct arch_nvram_ops (which is defined in linux/nvram.h for
general use).
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
---
arch/powerpc/include/asm/nvram.h | 3 ---
arch/powerpc/kernel/setup_32.c | 1 +
drivers/char/generic_nvram.c | 4 +++-
drivers/video/fbdev/matrox/matroxfb_base.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
Index: linux/arch/powerpc/include/asm/nvram.h
=================================--- linux.orig/arch/powerpc/include/asm/nvram.h 2015-07-12 20:24:53.000000000 +1000
+++ linux/arch/powerpc/include/asm/nvram.h 2015-07-12 20:25:08.000000000 +1000
@@ -101,7 +101,4 @@ extern int nvram_write_os_partition(stru
/* Determine NVRAM size */
extern ssize_t nvram_get_size(void);
-/* Normal access to NVRAM */
-extern unsigned char nvram_read_byte(int i);
-extern void nvram_write_byte(unsigned char c, int i);
#endif /* _ASM_POWERPC_NVRAM_H */
Index: linux/arch/powerpc/kernel/setup_32.c
=================================--- linux.orig/arch/powerpc/kernel/setup_32.c 2015-07-12 20:24:53.000000000 +1000
+++ linux/arch/powerpc/kernel/setup_32.c 2015-07-12 20:25:08.000000000 +1000
@@ -16,6 +16,7 @@
#include <linux/cpu.h>
#include <linux/console.h>
#include <linux/memblock.h>
+#include <linux/nvram.h>
#include <asm/io.h>
#include <asm/prom.h>
Index: linux/drivers/char/generic_nvram.c
=================================--- linux.orig/drivers/char/generic_nvram.c 2015-07-12 20:24:53.000000000 +1000
+++ linux/drivers/char/generic_nvram.c 2015-07-12 20:25:08.000000000 +1000
@@ -20,9 +20,11 @@
#include <linux/fcntl.h>
#include <linux/init.h>
#include <linux/mutex.h>
+#include <linux/nvram.h>
#include <asm/uaccess.h>
-#include <asm/nvram.h>
+
#ifdef CONFIG_PPC_PMAC
+#include <asm/nvram.h>
#include <asm/machdep.h>
#endif
Index: linux/drivers/video/fbdev/matrox/matroxfb_base.c
=================================--- linux.orig/drivers/video/fbdev/matrox/matroxfb_base.c 2015-07-12 20:24:53.000000000 +1000
+++ linux/drivers/video/fbdev/matrox/matroxfb_base.c 2015-07-12 20:25:08.000000000 +1000
@@ -111,12 +111,12 @@
#include "matroxfb_g450.h"
#include <linux/matroxfb.h>
#include <linux/interrupt.h>
+#include <linux/nvram.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#ifdef CONFIG_PPC_PMAC
#include <asm/machdep.h>
-unsigned char nvram_read_byte(int);
static int default_vmode = VMODE_NVRAM;
static int default_cmode = CMODE_NVRAM;
#endif
^ permalink raw reply
* [PATCH] video: Fix possible leak in of_get_videomode()
From: Christian Engelmayer @ 2015-07-11 17:46 UTC (permalink / raw)
To: linux-fbdev
In case videomode_from_timings() fails in function of_get_videomode(), the
allocated display timing data is not freed in the exit path. Make sure that
display_timings_release() is called in any case. Detected by Coverity CID
1309681.
Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
---
Compile tested only. Applies against linux-next.
---
drivers/video/of_videomode.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/video/of_videomode.c b/drivers/video/of_videomode.c
index 111c2d1911d3..3495b48c6805 100644
--- a/drivers/video/of_videomode.c
+++ b/drivers/video/of_videomode.c
@@ -44,11 +44,7 @@ int of_get_videomode(struct device_node *np, struct videomode *vm,
index = disp->native_mode;
ret = videomode_from_timings(disp, vm, index);
- if (ret)
- return ret;
-
display_timings_release(disp);
-
- return 0;
+ return ret;
}
EXPORT_SYMBOL_GPL(of_get_videomode);
--
1.9.1
^ permalink raw reply related
* [PATCH 2/2] drivers: video: fbdev: vga: fixed coding style
From: Cristian Ardelean @ 2015-07-11 5:27 UTC (permalink / raw)
To: plagnioj, tomi.valkeinen; +Cc: linux-fbdev, linux-kernel, Cristian Ardelean
Fixed most of the coding style issues suggested by checkpatch.pl
tool. Mainly converted spaces to tabs. Left remaining errors and
warnings up to decision of the developers.
Signed-off-by: Cristian Ardelean <cristian97.ardelean@gmail.com>
---
drivers/video/fbdev/vga16fb.c | 386 ++++++++++++++++++++---------------------
1 file changed, 193 insertions(+), 193 deletions(-)
diff --git a/drivers/video/fbdev/vga16fb.c b/drivers/video/fbdev/vga16fb.c
index 283d335..2c035a7 100644
--- a/drivers/video/fbdev/vga16fb.c
+++ b/drivers/video/fbdev/vga16fb.c
@@ -1,13 +1,13 @@
/*
* linux/drivers/video/vga16.c -- VGA 16-color framebuffer driver
- *
+ *
* Copyright 1999 Ben Pfaff <pfaffben@debian.org> and Petr Vandrovec <VANDROVE@vc.cvut.cz>
* Based on VGA info at http://www.goodnet.com/~tinara/FreeVGA/home.htm
* Based on VESA framebuffer (c) 1998 Gerd Knorr <kraxel@goldbach.in-berlin.de>
*
* 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>
@@ -41,7 +41,7 @@
struct vga16fb_par {
/* structure holding original VGA register settings when the
- screen is blanked */
+ screen is blanked */
struct {
unsigned char SeqCtrlIndex; /* Sequencer Index reg. */
unsigned char CrtCtrlIndex; /* CRT-Contr. Index reg. */
@@ -70,7 +70,7 @@ static struct fb_var_screeninfo vga16fb_defined = {
.yres = 480,
.xres_virtual = 640,
.yres_virtual = 480,
- .bits_per_pixel = 4,
+ .bits_per_pixel = 4,
.activate = FB_ACTIVATE_TEST,
.height = -1,
.width = -1,
@@ -120,7 +120,7 @@ static inline void rmw(volatile char __iomem *p)
static inline int setmode(int mode)
{
int oldmode;
-
+
oldmode = vga_io_rgfx(VGA_GFX_MODE);
vga_io_w(VGA_GFX_D, mode);
return oldmode;
@@ -139,19 +139,19 @@ static inline void setmask(int mask)
vga_io_w(VGA_GFX_D, mask);
}
-/* Set the Data Rotate Register and return its old value.
+/* Set the Data Rotate Register and return its old value.
Bits 0-2 are rotate count, bits 3-4 are logical operation
(0=NOP, 1=AND, 2=OR, 3=XOR). */
static inline int setop(int op)
{
int oldop;
-
+
oldop = vga_io_rgfx(VGA_GFX_DATA_ROTATE);
vga_io_w(VGA_GFX_D, op);
return oldop;
}
-/* Set the Enable Set/Reset Register and return its old value.
+/* Set the Enable Set/Reset Register and return its old value.
The code here always uses value 0xf for this register. */
static inline int setsr(int sr)
{
@@ -184,7 +184,7 @@ static inline void setindex(int index)
vga_io_w(VGA_GFX_I, index);
}
-static void vga16fb_pan_var(struct fb_info *info,
+static void vga16fb_pan_var(struct fb_info *info,
struct fb_var_screeninfo *var)
{
struct vga16fb_par *par = info->par;
@@ -194,7 +194,7 @@ static void vga16fb_pan_var(struct fb_info *info,
if (info->var.bits_per_pixel = 8) {
pos = (info->var.xres_virtual * var->yoffset + xoffset) >> 2;
} else if (par->mode & MODE_TEXT) {
- int fh = 16; // FIXME !!! font height. Fugde for now.
+ int fh = 16; /* FIXME !!! font height. Fugde for now. */
pos = (info->var.xres_virtual * (var->yoffset / fh) + xoffset) >> 3;
} else {
if (info->var.nonstd)
@@ -262,12 +262,14 @@ static void vga16fb_clock_chip(struct vga16fb_par *par,
pixclock = (pixclock * mul) / div;
best = vgaclocks;
err = pixclock - best->pixclock;
- if (err < 0) err = -err;
+ if (err < 0)
+ err = -err;
for (ptr = vgaclocks + 1; ptr->pixclock; ptr++) {
int tmp;
tmp = pixclock - ptr->pixclock;
- if (tmp < 0) tmp = -tmp;
+ if (tmp < 0)
+ tmp = -tmp;
if (tmp < err) {
err = tmp;
best = ptr;
@@ -275,9 +277,9 @@ static void vga16fb_clock_chip(struct vga16fb_par *par,
}
par->misc |= best->misc;
par->clkdiv = best->seq_clock_mode;
- pixclock = (best->pixclock * div) / mul;
+ pixclock = (best->pixclock * div) / mul;
}
-
+
#define FAIL(X) return -EINVAL
static int vga16fb_open(struct fb_info *info, int user)
@@ -439,8 +441,10 @@ static int vga16fb_check_var(struct fb_var_screeninfo *var,
FAIL("vslen too big");
par->crtc[VGA_CRTC_V_TOTAL] = ytotal - 2;
r7 = 0x10; /* disable linecompare */
- if (ytotal & 0x100) r7 |= 0x01;
- if (ytotal & 0x200) r7 |= 0x20;
+ if (ytotal & 0x100)
+ r7 |= 0x01;
+ if (ytotal & 0x200)
+ r7 |= 0x20;
par->crtc[VGA_CRTC_PRESET_ROW] = 0;
par->crtc[VGA_CRTC_MAX_SCAN] = 0x40; /* 1 scanline, no linecmp */
if (var->vmode & FB_VMODE_DOUBLE)
@@ -473,7 +477,7 @@ static int vga16fb_check_var(struct fb_var_screeninfo *var,
par->crtc[VGA_CRTC_V_SYNC_END] = (pos & 0x0F) & ~0x10; /* disabled IRQ */
pos += upper - 1; /* blank_end + 1 <= ytotal + 2 */
par->crtc[VGA_CRTC_V_BLANK_END] = pos & 0xFF; /* 0x7F for original VGA,
- but some SVGA chips requires all 8 bits to set */
+ but some SVGA chips requires all 8 bits to set */
if (vxres >= 512)
FAIL("vxres too long");
par->crtc[VGA_CRTC_OFFSET] = vxres >> 1;
@@ -492,7 +496,7 @@ static int vga16fb_check_var(struct fb_var_screeninfo *var,
par->misc &= ~0x40;
if (var->sync & FB_SYNC_VERT_HIGH_ACT)
par->misc &= ~0x80;
-
+
par->mode = mode;
if (mode & MODE_8BPP)
@@ -501,8 +505,8 @@ static int vga16fb_check_var(struct fb_var_screeninfo *var,
else
/* pixel clock = vga clock */
vga16fb_clock_chip(par, var->pixclock, info, 1, 1);
-
- var->red.offset = var->green.offset = var->blue.offset =
+
+ var->red.offset = var->green.offset = var->blue.offset var->transp.offset = 0;
var->red.length = var->green.length = var->blue.length (par->isVGA) ? 6 : 2;
@@ -569,10 +573,10 @@ static int vga16fb_set_par(struct fb_info *info)
else
atc[VGA_ATC_PEL] = info->var.xoffset & 7;
atc[VGA_ATC_COLOR_PAGE] = 0x00;
-
+
if (par->mode & MODE_TEXT) {
- fh = 16; // FIXME !!! Fudge font height.
- par->crtc[VGA_CRTC_MAX_SCAN] = (par->crtc[VGA_CRTC_MAX_SCAN]
+ fh = 16; /* FIXME !!! Fudge font height. */
+ par->crtc[VGA_CRTC_MAX_SCAN] = (par->crtc[VGA_CRTC_MAX_SCAN]
& ~0x1F) | (fh - 1);
}
@@ -583,10 +587,10 @@ static int vga16fb_set_par(struct fb_info *info)
vga_io_w(EGA_GFX_E0, 0x00);
vga_io_w(EGA_GFX_E1, 0x01);
}
-
+
/* update misc output register */
vga_io_w(VGA_MIS_W, par->misc);
-
+
/* synchronous reset on */
vga_io_wseq(0x00, 0x01);
@@ -595,10 +599,9 @@ static int vga16fb_set_par(struct fb_info *info)
/* write sequencer registers */
vga_io_wseq(VGA_SEQ_CLOCK_MODE, seq[VGA_SEQ_CLOCK_MODE] | 0x20);
- for (i = 2; i < VGA_SEQ_C; i++) {
+ for (i = 2; i < VGA_SEQ_C; i++)
vga_io_wseq(i, seq[i]);
- }
-
+
/* synchronous reset off */
vga_io_wseq(0x00, 0x03);
@@ -606,15 +609,13 @@ static int vga16fb_set_par(struct fb_info *info)
vga_io_wcrt(VGA_CRTC_V_SYNC_END, par->crtc[VGA_CRTC_V_SYNC_END]);
/* write CRT registers */
- for (i = 0; i < VGA_CRTC_REGS; i++) {
+ for (i = 0; i < VGA_CRTC_REGS; i++)
vga_io_wcrt(i, par->crtc[i]);
- }
-
+
/* write graphics controller registers */
- for (i = 0; i < VGA_GFX_C; i++) {
+ for (i = 0; i < VGA_GFX_C; i++)
vga_io_wgfx(i, gdc[i]);
- }
-
+
/* write attribute controller registers */
for (i = 0; i < VGA_ATT_C; i++) {
vga_io_r(VGA_IS1_RC); /* reset flip-flop */
@@ -637,7 +638,7 @@ static void ega16_setpalette(int regno, unsigned red, unsigned green, unsigned b
{
static const unsigned char map[] = { 000, 001, 010, 011 };
int val;
-
+
if (regno >= 16)
return;
val = map[red>>14] | ((map[green>>14]) << 1) | ((map[blue>>14]) << 2);
@@ -668,25 +669,25 @@ static int vga16fb_setcolreg(unsigned regno, unsigned red, unsigned green,
* (according to the entries in the `var' structure). Return
* != 0 for invalid regno.
*/
-
+
if (regno >= 256)
return 1;
gray = info->var.grayscale;
-
+
if (gray) {
/* gray = 0.30*R + 0.59*G + 0.11*B */
red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8;
}
- if (par->isVGA)
- vga16_setpalette(regno,red,green,blue);
+ if (par->isVGA)
+ vga16_setpalette(regno, red, green, blue);
else
- ega16_setpalette(regno,red,green,blue);
+ ega16_setpalette(regno, red, green, blue);
return 0;
}
static int vga16fb_pan_display(struct fb_var_screeninfo *var,
- struct fb_info *info)
+ struct fb_info *info)
{
vga16fb_pan_var(info, var);
return 0;
@@ -701,11 +702,11 @@ static void vga_vesa_blank(struct vga16fb_par *par, int mode)
{
unsigned char SeqCtrlIndex = vga_io_r(VGA_SEQ_I);
unsigned char CrtCtrlIndex = vga_io_r(VGA_CRT_IC);
-
+
/* save original values of VGA controller registers */
- if(!par->vesa_blanked) {
+ if (!par->vesa_blanked) {
par->vga_state.CrtMiscIO = vga_io_r(VGA_MIS_R);
- //sti();
+ /* sti(); */
par->vga_state.HorizontalTotal = vga_io_rcrt(0x00); /* HorizontalTotal */
par->vga_state.HorizDisplayEnd = vga_io_rcrt(0x01); /* HorizDisplayEnd */
@@ -757,7 +758,7 @@ static void vga_vesa_unblank(struct vga16fb_par *par)
{
unsigned char SeqCtrlIndex = vga_io_r(VGA_SEQ_I);
unsigned char CrtCtrlIndex = vga_io_r(VGA_CRT_IC);
-
+
/* restore original values of VGA controller registers */
vga_io_w(VGA_MIS_W, par->vga_state.CrtMiscIO);
@@ -789,7 +790,7 @@ static void vga_pal_blank(void)
{
int i;
- for (i=0; i<16; i++) {
+ for (i = 0; i < 16; i++) {
outb_p(i, VGA_PEL_IW);
outb_p(0, VGA_PEL_D);
outb_p(0, VGA_PEL_D);
@@ -808,9 +809,8 @@ static int vga16fb_blank(int blank, struct fb_info *info)
vga_vesa_unblank(par);
par->vesa_blanked = 0;
}
- if (par->palette_blanked) {
+ if (par->palette_blanked)
par->palette_blanked = 0;
- }
break;
case FB_BLANK_NORMAL: /* blank */
vga_pal_blank();
@@ -827,55 +827,55 @@ static int vga16fb_blank(int blank, struct fb_info *info)
static void vga_8planes_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
{
u32 dx = rect->dx, width = rect->width;
- char oldindex = getindex();
- char oldmode = setmode(0x40);
- char oldmask = selectmask();
- int line_ofs, height;
- char oldop, oldsr;
- char __iomem *where;
-
- dx /= 4;
- where = info->screen_base + dx + rect->dy * info->fix.line_length;
-
- if (rect->rop = ROP_COPY) {
- oldop = setop(0);
- oldsr = setsr(0);
-
- width /= 4;
- line_ofs = info->fix.line_length - width;
- setmask(0xff);
-
- height = rect->height;
-
- while (height--) {
- int x;
-
- /* we can do memset... */
- for (x = width; x > 0; --x) {
- writeb(rect->color, where);
- where++;
- }
- where += line_ofs;
- }
- } else {
- char oldcolor = setcolor(0xf);
- int y;
-
- oldop = setop(0x18);
- oldsr = setsr(0xf);
- setmask(0x0F);
- for (y = 0; y < rect->height; y++) {
- rmw(where);
- rmw(where+1);
- where += info->fix.line_length;
- }
- setcolor(oldcolor);
- }
- setmask(oldmask);
- setsr(oldsr);
- setop(oldop);
- setmode(oldmode);
- setindex(oldindex);
+ char oldindex = getindex();
+ char oldmode = setmode(0x40);
+ char oldmask = selectmask();
+ int line_ofs, height;
+ char oldop, oldsr;
+ char __iomem *where;
+
+ dx /= 4;
+ where = info->screen_base + dx + rect->dy * info->fix.line_length;
+
+ if (rect->rop = ROP_COPY) {
+ oldop = setop(0);
+ oldsr = setsr(0);
+
+ width /= 4;
+ line_ofs = info->fix.line_length - width;
+ setmask(0xff);
+
+ height = rect->height;
+
+ while (height--) {
+ int x;
+
+ /* we can do memset... */
+ for (x = width; x > 0; --x) {
+ writeb(rect->color, where);
+ where++;
+ }
+ where += line_ofs;
+ }
+ } else {
+ char oldcolor = setcolor(0xf);
+ int y;
+
+ oldop = setop(0x18);
+ oldsr = setsr(0xf);
+ setmask(0x0F);
+ for (y = 0; y < rect->height; y++) {
+ rmw(where);
+ rmw(where+1);
+ where += info->fix.line_length;
+ }
+ setcolor(oldcolor);
+ }
+ setmask(oldmask);
+ setsr(oldsr);
+ setop(oldop);
+ setmode(oldmode);
+ setindex(oldindex);
}
static void vga16fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
@@ -943,7 +943,7 @@ static void vga16fb_fillrect(struct fb_info *info, const struct fb_fillrect *rec
}
break;
}
- } else
+ } else
vga_8planes_fillrect(info, rect);
break;
case FB_TYPE_PACKED_PIXELS:
@@ -955,62 +955,62 @@ static void vga16fb_fillrect(struct fb_info *info, const struct fb_fillrect *rec
static void vga_8planes_copyarea(struct fb_info *info, const struct fb_copyarea *area)
{
- char oldindex = getindex();
- char oldmode = setmode(0x41);
- char oldop = setop(0);
- char oldsr = setsr(0xf);
- int height, line_ofs, x;
+ char oldindex = getindex();
+ char oldmode = setmode(0x41);
+ char oldop = setop(0);
+ char oldsr = setsr(0xf);
+ int height, line_ofs, x;
u32 sx, dx, width;
char __iomem *dest;
char __iomem *src;
- height = area->height;
-
- sx = area->sx / 4;
- dx = area->dx / 4;
- width = area->width / 4;
-
- if (area->dy < area->sy || (area->dy = area->sy && dx < sx)) {
- line_ofs = info->fix.line_length - width;
- dest = info->screen_base + dx + area->dy * info->fix.line_length;
- src = info->screen_base + sx + area->sy * info->fix.line_length;
- while (height--) {
- for (x = 0; x < width; x++) {
- readb(src);
- writeb(0, dest);
- src++;
- dest++;
- }
- src += line_ofs;
- dest += line_ofs;
- }
- } else {
- line_ofs = info->fix.line_length - width;
- dest = info->screen_base + dx + width +
+ height = area->height;
+
+ sx = area->sx / 4;
+ dx = area->dx / 4;
+ width = area->width / 4;
+
+ if (area->dy < area->sy || (area->dy = area->sy && dx < sx)) {
+ line_ofs = info->fix.line_length - width;
+ dest = info->screen_base + dx + area->dy * info->fix.line_length;
+ src = info->screen_base + sx + area->sy * info->fix.line_length;
+ while (height--) {
+ for (x = 0; x < width; x++) {
+ readb(src);
+ writeb(0, dest);
+ src++;
+ dest++;
+ }
+ src += line_ofs;
+ dest += line_ofs;
+ }
+ } else {
+ line_ofs = info->fix.line_length - width;
+ dest = info->screen_base + dx + width +
(area->dy + height - 1) * info->fix.line_length;
- src = info->screen_base + sx + width +
+ src = info->screen_base + sx + width +
(area->sy + height - 1) * info->fix.line_length;
- while (height--) {
- for (x = 0; x < width; x++) {
- --src;
- --dest;
- readb(src);
- writeb(0, dest);
- }
- src -= line_ofs;
- dest -= line_ofs;
- }
- }
-
- setsr(oldsr);
- setop(oldop);
- setmode(oldmode);
- setindex(oldindex);
+ while (height--) {
+ for (x = 0; x < width; x++) {
+ --src;
+ --dest;
+ readb(src);
+ writeb(0, dest);
+ }
+ src -= line_ofs;
+ dest -= line_ofs;
+ }
+ }
+
+ setsr(oldsr);
+ setop(oldop);
+ setmode(oldmode);
+ setindex(oldindex);
}
static void vga16fb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
{
- u32 dx = area->dx, dy = area->dy, sx = area->sx, sy = area->sy;
+ u32 dx = area->dx, dy = area->dy, sx = area->sx, sy = area->sy;
int x, x2, y2, old_dx, old_dy, vxres, vyres;
int height, width, line_ofs;
char __iomem *dst = NULL;
@@ -1076,9 +1076,9 @@ static void vga16fb_copyarea(struct fb_info *info, const struct fb_copyarea *are
dst += line_ofs;
}
} else {
- dst = info->screen_base + (dx/8) + width +
+ dst = info->screen_base + (dx/8) + width +
(dy + height - 1) * info->fix.line_length;
- src = info->screen_base + (sx/8) + width +
+ src = info->screen_base + (sx/8) + width +
(sy + height - 1) * info->fix.line_length;
while (height--) {
for (x = 0; x < width; x++) {
@@ -1091,7 +1091,7 @@ static void vga16fb_copyarea(struct fb_info *info, const struct fb_copyarea *are
dst -= line_ofs;
}
}
- } else
+ } else
vga_8planes_copyarea(info, area);
break;
case FB_TYPE_PACKED_PIXELS:
@@ -1101,7 +1101,8 @@ static void vga16fb_copyarea(struct fb_info *info, const struct fb_copyarea *are
}
}
-#define TRANS_MASK_LOW {0x0,0x8,0x4,0xC,0x2,0xA,0x6,0xE,0x1,0x9,0x5,0xD,0x3,0xB,0x7,0xF}
+#define TRANS_MASK_LOW {0x0, 0x8, 0x4, 0xC, 0x2, 0xA, 0x6, 0xE, \
+ 0x1, 0x9, 0x5, 0xD, 0x3, 0xB, 0x7, 0xF}
#define TRANS_MASK_HIGH {0x000, 0x800, 0x400, 0xC00, 0x200, 0xA00, 0x600, 0xE00, \
0x100, 0x900, 0x500, 0xD00, 0x300, 0xB00, 0x700, 0xF00}
@@ -1117,33 +1118,33 @@ static const u16 transl_h[] = TRANS_MASK_LOW;
static void vga_8planes_imageblit(struct fb_info *info, const struct fb_image *image)
{
- char oldindex = getindex();
- char oldmode = setmode(0x40);
- char oldop = setop(0);
- char oldsr = setsr(0);
- char oldmask = selectmask();
- const char *cdat = image->data;
+ char oldindex = getindex();
+ char oldmode = setmode(0x40);
+ char oldop = setop(0);
+ char oldsr = setsr(0);
+ char oldmask = selectmask();
+ const char *cdat = image->data;
u32 dx = image->dx;
- char __iomem *where;
- int y;
-
- dx /= 4;
- where = info->screen_base + dx + image->dy * info->fix.line_length;
-
- setmask(0xff);
- writeb(image->bg_color, where);
- readb(where);
- selectmask();
- setmask(image->fg_color ^ image->bg_color);
- setmode(0x42);
- setop(0x18);
- for (y = 0; y < image->height; y++, where += info->fix.line_length)
- writew(transl_h[cdat[y]&0xF] | transl_l[cdat[y] >> 4], where);
- setmask(oldmask);
- setsr(oldsr);
- setop(oldop);
- setmode(oldmode);
- setindex(oldindex);
+ char __iomem *where;
+ int y;
+
+ dx /= 4;
+ where = info->screen_base + dx + image->dy * info->fix.line_length;
+
+ setmask(0xff);
+ writeb(image->bg_color, where);
+ readb(where);
+ selectmask();
+ setmask(image->fg_color ^ image->bg_color);
+ setmode(0x42);
+ setop(0x18);
+ for (y = 0; y < image->height; y++, where += info->fix.line_length)
+ writew(transl_h[cdat[y]&0xF] | transl_l[cdat[y] >> 4], where);
+ setmask(oldmask);
+ setsr(oldsr);
+ setop(oldop);
+ setmode(oldmode);
+ setindex(oldindex);
}
static void vga_imageblit_expand(struct fb_info *info, const struct fb_image *image)
@@ -1164,7 +1165,6 @@ static void vga_imageblit_expand(struct fb_info *info, const struct fb_image *im
setsr(0xf);
setcolor(image->fg_color);
selectmask();
-
setmask(0xff);
writeb(image->bg_color, where);
rmb();
@@ -1173,7 +1173,7 @@ static void vga_imageblit_expand(struct fb_info *info, const struct fb_image *im
wmb();
for (y = 0; y < image->height; y++) {
dst = where;
- for (x = image->width/8; x--;)
+ for (x = image->width/8; x--;)
writeb(*cdat++, dst++);
where += info->fix.line_length;
}
@@ -1184,11 +1184,10 @@ static void vga_imageblit_expand(struct fb_info *info, const struct fb_image *im
setsr(0xf);
setcolor(image->bg_color);
selectmask();
-
setmask(0xff);
for (y = 0; y < image->height; y++) {
dst = where;
- for (x=image->width/8; x--;){
+ for (x = image->width/8; x--;) {
rmw(dst);
setcolor(image->fg_color);
selectmask();
@@ -1200,7 +1199,7 @@ static void vga_imageblit_expand(struct fb_info *info, const struct fb_image *im
where += info->fix.line_length;
}
}
- } else
+ } else
vga_8planes_imageblit(info, image);
break;
case FB_TYPE_PACKED_PIXELS:
@@ -1213,7 +1212,7 @@ static void vga_imageblit_expand(struct fb_info *info, const struct fb_image *im
static void vga_imageblit_color(struct fb_info *info, const struct fb_image *image)
{
/*
- * Draw logo
+ * Draw logo
*/
struct vga16fb_par *par = info->par;
char __iomem *where @@ -1230,7 +1229,7 @@ static void vga_imageblit_color(struct fb_info *info, const struct fb_image *ima
setsr(0xf);
setop(0);
setmode(0);
-
+
for (y = 0; y < image->height; y++) {
for (x = 0; x < image->width; x++) {
dst = where + x/8;
@@ -1254,7 +1253,7 @@ static void vga_imageblit_color(struct fb_info *info, const struct fb_image *ima
break;
}
}
-
+
static void vga16fb_imageblit(struct fb_info *info, const struct fb_image *image)
{
if (image->depth = 1)
@@ -1273,14 +1272,14 @@ static void vga16fb_destroy(struct fb_info *info)
static struct fb_ops vga16fb_ops = {
.owner = THIS_MODULE,
- .fb_open = vga16fb_open,
- .fb_release = vga16fb_release,
+ .fb_open = vga16fb_open,
+ .fb_release = vga16fb_release,
.fb_destroy = vga16fb_destroy,
.fb_check_var = vga16fb_check_var,
.fb_set_par = vga16fb_set_par,
- .fb_setcolreg = vga16fb_setcolreg,
- .fb_pan_display = vga16fb_pan_display,
- .fb_blank = vga16fb_blank,
+ .fb_setcolreg = vga16fb_setcolreg,
+ .fb_pan_display = vga16fb_pan_display,
+ .fb_blank = vga16fb_blank,
.fb_fillrect = vga16fb_fillrect,
.fb_copyarea = vga16fb_copyarea,
.fb_imageblit = vga16fb_imageblit,
@@ -1290,12 +1289,13 @@ static struct fb_ops vga16fb_ops = {
static int __init vga16fb_setup(char *options)
{
char *this_opt;
-
+
if (!options || !*options)
return 0;
-
+
while ((this_opt = strsep(&options, ",")) != NULL) {
- if (!*this_opt) continue;
+ if (!*this_opt)
+ continue;
}
return 0;
}
@@ -1337,11 +1337,11 @@ static int vga16fb_probe(struct platform_device *dev)
par->palette_blanked = 0;
par->vesa_blanked = 0;
- i = par->isVGA? 6 : 2;
-
+ i = par->isVGA ? 6 : 2;
+
vga16fb_defined.red.length = i;
vga16fb_defined.green.length = i;
- vga16fb_defined.blue.length = i;
+ vga16fb_defined.blue.length = i;
/* name should not depend on EGA/VGA */
info->fbops = &vga16fb_ops;
--
1.7.9.5
^ permalink raw reply related
* Re: [alsa-devel] [PATCH v2 02/12] device: property: find dependencies of a firmware node
From: Rafael J. Wysocki @ 2015-07-11 2:52 UTC (permalink / raw)
To: Tomeu Vizoso
Cc: devicetree@vger.kernel.org, linux-fbdev, linux-acpi,
Greg Kroah-Hartman, alsa-devel, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, linux-gpio, Mark Brown,
Linux PWM List
In-Reply-To: <CAAObsKC-71GsBWZdNjm5Cxek07=9dwzTp8mYezVXkt_k3mzKVw@mail.gmail.com>
On Friday, July 10, 2015 03:14:38 PM Tomeu Vizoso wrote:
> On 2 July 2015 at 02:02, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> > On Wednesday, July 01, 2015 11:40:57 AM Tomeu Vizoso wrote:
> >> Adds API that allows callers to find out what other firmware nodes a
> >> node depends on.
> >>
> >> Implementors of bindings documentation can register callbacks that
> >> return the dependencies of a node.
> >>
> >> Dependency information can be used to change the order in which devices
> >> are probed, or to print a warning when a device node is going to be
> >> probed without all its dependencies fulfilled.
> >>
> >> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> >
> > I'd like to see a description of the new API in English in the changelog.
>
> Agreed.
>
> >> ---
> >>
> >> Changes in v2:
> >> - Allow bindings implementations register a function instead of using
> >> class callbacks, as not only subsystems implement firmware bindings.
> >>
> >> drivers/base/property.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++
> >> include/linux/fwnode.h | 5 +++
> >> include/linux/property.h | 12 +++++++
> >> 3 files changed, 108 insertions(+)
> >>
> >> diff --git a/drivers/base/property.c b/drivers/base/property.c
> >> index 8ead1ba..9d38ede 100644
> >> --- a/drivers/base/property.c
> >> +++ b/drivers/base/property.c
> >> @@ -19,7 +19,13 @@
> >> #include <linux/platform_device.h>
> >> #include <linux/property.h>
> >>
> >
> > Please add a comment describing this structure. In particular, what it is
> > supposed to be used for and how it is supposed to be used.
>
> Ok.
>
> >> +struct dependency_parser {
> >> + struct list_head parser;
> >
> > I'd rather call this "list_node" or something like that.
>
> Ok.
>
> >> + void (*func)(struct fwnode_handle *fwnode, struct list_head *deps);
> >> +};
> >> +
> >> static bool fwnode_match_enable = false;
> >> +static LIST_HEAD(dependency_parsers);
> >>
> >> /**
> >> * device_add_property_set - Add a collection of properties to a device object.
> >> @@ -553,6 +559,27 @@ bool device_dma_is_coherent(struct device *dev)
> >> EXPORT_SYMBOL_GPL(device_dma_is_coherent);
> >>
> >> /**
> >> + * fwnode_add_dependency - add firmware node to the passed dependency list
> >> + * @fwnode: Firmware node to add to dependency list
> >> + * @list: Dependency list to add the fwnode to
> >> + */
> >> +void fwnode_add_dependency(struct fwnode_handle *fwnode,
> >> + struct list_head *list)
> >> +{
> >> + struct fwnode_dependency *dep;
> >> +
> >> + dep = kzalloc(sizeof(*dep), GFP_KERNEL);
> >> + if (!dep)
> >> + return;
> >> +
> >> + INIT_LIST_HEAD(&dep->dependency);
> >> + dep->fwnode = fwnode;
> >> +
> >> + list_add_tail(&dep->dependency, list);
> >> +}
> >> +EXPORT_SYMBOL_GPL(fwnode_add_dependency);
> >> +
> >> +/**
> >> * fwnode_get_parent - return the parent node of a device node
> >> * @fwnode: Device node to find the parent node of
> >> */
> >> @@ -600,6 +627,70 @@ bool fwnode_is_compatible(struct fwnode_handle *fwnode, const char *compatible)
> >> EXPORT_SYMBOL_GPL(fwnode_is_compatible);
> >>
> >> /**
> >> + * fwnode_add_dependency_parser - register dependency parser
> >> + * @func: Function that will be called to find out dependencies of a node
> >> + *
> >> + * Registers a callback that will be called when collecting the dependencies
> >> + * of a firmware node. The callback should inspect the properties of the node
> >> + * and call fwnode_add_dependency() for each dependency it recognizes, from
> >> + * the bindings documentation.
> >> + */
> >> +void fwnode_add_dependency_parser(
> >> + void (*func)(struct fwnode_handle *fwnode, struct list_head *deps))
> >> +{
> >> + struct dependency_parser *parser;
> >> +
> >> + parser = kzalloc(sizeof(*parser), GFP_KERNEL);
> >> + if (!parser)
> >> + return;
> >> +
> >> + INIT_LIST_HEAD(&parser->parser);
> >> + parser->func = func;
> >> +
> >> + list_add_tail(&parser->parser, &dependency_parsers);
> >
> > We're modifying a global list here. Any locking needed? RCU? Whatever?
>
> Oops.
>
> >> +}
> >> +EXPORT_SYMBOL_GPL(fwnode_add_dependency_parser);
> >> +
> >> +/**
> >> + * fwnode_remove_dependency_parser - unregister dependency parser
> >> + * @func: Function that was to be called to find out dependencies of a node
> >> + */
> >> +void fwnode_remove_dependency_parser(
> >> + void (*func)(struct fwnode_handle *fwnode, struct list_head *deps))
> >> +{
> >> + struct dependency_parser *parser, *tmp;
> >> +
> >> + list_for_each_entry_safe(parser, tmp, &dependency_parsers, parser) {
> >> + if (parser->func = func) {
> >> + list_del(&parser->parser);
> >> + kfree(parser);
> >> + return;
> >> + }
> >> + }
> >> +}
> >> +EXPORT_SYMBOL_GPL(fwnode_remove_dependency_parser);
> >> +
> >> +/**
> >> + * fwnode_get_dependencies - find out what dependencies a firmware node has
> >> + * @fwnode: firmware node to find its dependencies
> >> + * @deps: list of struct fwnode_dependency in which dependencies will be placed
> >> + */
> >> +void fwnode_get_dependencies(struct fwnode_handle *fwnode,
> >> + struct list_head *deps)
> >> +{
> >> + struct dependency_parser *parser;
> >> + struct fwnode_handle *child;
> >> +
> >> + list_for_each_entry(parser, &dependency_parsers, parser)
> >> + parser->func(fwnode, deps);
> >> +
> >> + /* Some device nodes will have dependencies in non-device sub-nodes */
> >> + fwnode_for_each_child_node(fwnode, child)
> >> + if (!fwnode_property_present(child, "compatible"))
> >
> > This is a blatant OF-ism. We need to think about a generic way to express that.
>
> My impression from reading the existing usage of fwnode in gpiolib and
> the examples in the link below was that we were going to share the
> bindings between DT and ACPI. Doesn't that extend to the meaning of
> the compatible property?
>
> http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf
Not entirely.
An ACPI device object without the "compatible" property may still represent a valid
device (and usually does), so it is not enough to check whether or not the "compatible"
property is present for that in general.
Thanks,
Rafael
^ permalink raw reply
* Re: [alsa-devel] [PATCH v2 02/12] device: property: find dependencies of a firmware node
From: Tomeu Vizoso @ 2015-07-10 13:14 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: devicetree@vger.kernel.org, linux-fbdev, linux-acpi,
Greg Kroah-Hartman, alsa-devel, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, linux-gpio, Mark Brown,
Linux PWM List
In-Reply-To: <2589152.el9mWEWqDg@vostro.rjw.lan>
On 2 July 2015 at 02:02, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> On Wednesday, July 01, 2015 11:40:57 AM Tomeu Vizoso wrote:
>> Adds API that allows callers to find out what other firmware nodes a
>> node depends on.
>>
>> Implementors of bindings documentation can register callbacks that
>> return the dependencies of a node.
>>
>> Dependency information can be used to change the order in which devices
>> are probed, or to print a warning when a device node is going to be
>> probed without all its dependencies fulfilled.
>>
>> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
>
> I'd like to see a description of the new API in English in the changelog.
Agreed.
>> ---
>>
>> Changes in v2:
>> - Allow bindings implementations register a function instead of using
>> class callbacks, as not only subsystems implement firmware bindings.
>>
>> drivers/base/property.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++
>> include/linux/fwnode.h | 5 +++
>> include/linux/property.h | 12 +++++++
>> 3 files changed, 108 insertions(+)
>>
>> diff --git a/drivers/base/property.c b/drivers/base/property.c
>> index 8ead1ba..9d38ede 100644
>> --- a/drivers/base/property.c
>> +++ b/drivers/base/property.c
>> @@ -19,7 +19,13 @@
>> #include <linux/platform_device.h>
>> #include <linux/property.h>
>>
>
> Please add a comment describing this structure. In particular, what it is
> supposed to be used for and how it is supposed to be used.
Ok.
>> +struct dependency_parser {
>> + struct list_head parser;
>
> I'd rather call this "list_node" or something like that.
Ok.
>> + void (*func)(struct fwnode_handle *fwnode, struct list_head *deps);
>> +};
>> +
>> static bool fwnode_match_enable = false;
>> +static LIST_HEAD(dependency_parsers);
>>
>> /**
>> * device_add_property_set - Add a collection of properties to a device object.
>> @@ -553,6 +559,27 @@ bool device_dma_is_coherent(struct device *dev)
>> EXPORT_SYMBOL_GPL(device_dma_is_coherent);
>>
>> /**
>> + * fwnode_add_dependency - add firmware node to the passed dependency list
>> + * @fwnode: Firmware node to add to dependency list
>> + * @list: Dependency list to add the fwnode to
>> + */
>> +void fwnode_add_dependency(struct fwnode_handle *fwnode,
>> + struct list_head *list)
>> +{
>> + struct fwnode_dependency *dep;
>> +
>> + dep = kzalloc(sizeof(*dep), GFP_KERNEL);
>> + if (!dep)
>> + return;
>> +
>> + INIT_LIST_HEAD(&dep->dependency);
>> + dep->fwnode = fwnode;
>> +
>> + list_add_tail(&dep->dependency, list);
>> +}
>> +EXPORT_SYMBOL_GPL(fwnode_add_dependency);
>> +
>> +/**
>> * fwnode_get_parent - return the parent node of a device node
>> * @fwnode: Device node to find the parent node of
>> */
>> @@ -600,6 +627,70 @@ bool fwnode_is_compatible(struct fwnode_handle *fwnode, const char *compatible)
>> EXPORT_SYMBOL_GPL(fwnode_is_compatible);
>>
>> /**
>> + * fwnode_add_dependency_parser - register dependency parser
>> + * @func: Function that will be called to find out dependencies of a node
>> + *
>> + * Registers a callback that will be called when collecting the dependencies
>> + * of a firmware node. The callback should inspect the properties of the node
>> + * and call fwnode_add_dependency() for each dependency it recognizes, from
>> + * the bindings documentation.
>> + */
>> +void fwnode_add_dependency_parser(
>> + void (*func)(struct fwnode_handle *fwnode, struct list_head *deps))
>> +{
>> + struct dependency_parser *parser;
>> +
>> + parser = kzalloc(sizeof(*parser), GFP_KERNEL);
>> + if (!parser)
>> + return;
>> +
>> + INIT_LIST_HEAD(&parser->parser);
>> + parser->func = func;
>> +
>> + list_add_tail(&parser->parser, &dependency_parsers);
>
> We're modifying a global list here. Any locking needed? RCU? Whatever?
Oops.
>> +}
>> +EXPORT_SYMBOL_GPL(fwnode_add_dependency_parser);
>> +
>> +/**
>> + * fwnode_remove_dependency_parser - unregister dependency parser
>> + * @func: Function that was to be called to find out dependencies of a node
>> + */
>> +void fwnode_remove_dependency_parser(
>> + void (*func)(struct fwnode_handle *fwnode, struct list_head *deps))
>> +{
>> + struct dependency_parser *parser, *tmp;
>> +
>> + list_for_each_entry_safe(parser, tmp, &dependency_parsers, parser) {
>> + if (parser->func = func) {
>> + list_del(&parser->parser);
>> + kfree(parser);
>> + return;
>> + }
>> + }
>> +}
>> +EXPORT_SYMBOL_GPL(fwnode_remove_dependency_parser);
>> +
>> +/**
>> + * fwnode_get_dependencies - find out what dependencies a firmware node has
>> + * @fwnode: firmware node to find its dependencies
>> + * @deps: list of struct fwnode_dependency in which dependencies will be placed
>> + */
>> +void fwnode_get_dependencies(struct fwnode_handle *fwnode,
>> + struct list_head *deps)
>> +{
>> + struct dependency_parser *parser;
>> + struct fwnode_handle *child;
>> +
>> + list_for_each_entry(parser, &dependency_parsers, parser)
>> + parser->func(fwnode, deps);
>> +
>> + /* Some device nodes will have dependencies in non-device sub-nodes */
>> + fwnode_for_each_child_node(fwnode, child)
>> + if (!fwnode_property_present(child, "compatible"))
>
> This is a blatant OF-ism. We need to think about a generic way to express that.
My impression from reading the existing usage of fwnode in gpiolib and
the examples in the link below was that we were going to share the
bindings between DT and ACPI. Doesn't that extend to the meaning of
the compatible property?
http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf
>> + fwnode_get_dependencies(child, deps);
>> +}
>> +
>> +/**
>> * fwnode_driver_match_device - Tell if a driver matches a device.
>> * @drv: the device_driver structure to test
>> * @dev: the device structure to match against
>> diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
>> index 0408545..68ab558 100644
>> --- a/include/linux/fwnode.h
>> +++ b/include/linux/fwnode.h
>> @@ -24,4 +24,9 @@ struct fwnode_handle {
>> struct fwnode_handle *secondary;
>> };
>>
>> +struct fwnode_dependency {
>> + struct fwnode_handle *fwnode;
>> + struct list_head dependency;
>
> So this is a node in the list of dependencies, right?
>
> I'd call that field "list_node", then.
Right, fwnode_dependency is just there so we can have a list of fwnodes.
>> +};
>
> And fwnode is a firmware node that the owner of the list depends on, right?
Yes, will make it clearer in the next revision.
Thanks,
Tomeu
>> +
>> #endif
>> diff --git a/include/linux/property.h b/include/linux/property.h
>> index 4e453c4..b8b86ea 100644
>> --- a/include/linux/property.h
>> +++ b/include/linux/property.h
>> @@ -86,6 +86,18 @@ bool fwnode_is_compatible(struct fwnode_handle *fwnode, const char *compatible);
>> bool fwnode_driver_match_device(struct device *dev,
>> const struct device_driver *drv);
>>
>> +void fwnode_add_dependency(struct fwnode_handle *fwnode,
>> + struct list_head *list);
>> +
>> +void fwnode_add_dependency_parser(
>> + void (*func)(struct fwnode_handle *fwnode, struct list_head *deps));
>> +
>> +void fwnode_remove_dependency_parser(
>> + void (*func)(struct fwnode_handle *fwnode, struct list_head *deps));
>> +
>> +void fwnode_get_dependencies(struct fwnode_handle *fwnode,
>> + struct list_head *list);
>> +
>> unsigned int device_get_child_node_count(struct device *dev);
>>
>> static inline bool device_property_read_bool(struct device *dev,
>>
>
> --
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply
* Re: [PATCH v2 01/12] device: property: delay device-driver matches
From: Tomeu Vizoso @ 2015-07-10 11:39 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: devicetree@vger.kernel.org, linux-fbdev, alsa-devel, linux-gpio,
Greg Kroah-Hartman, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org, linux-acpi, Mark Brown,
Linux PWM List
In-Reply-To: <17310138.6IxCgARibq@vostro.rjw.lan>
On 2 July 2015 at 01:29, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> On Wednesday, July 01, 2015 11:40:56 AM Tomeu Vizoso wrote:
>> Delay matches of platform devices until late_initcall, when we are sure
>> that all built-in drivers have been registered already. This is needed
>> to prevent deferred probes because of some dependencies' drivers not
>> having registered yet.
>>
>> This reduces the total amount of work that the kernel does during boot
>> because it won't try to match devices to drivers when built-in drivers
>> are still registering but also reduces some parallelism, so total boot
>> time might slightly increase or decrease depending on the platform and
>> kernel configuration.
>>
>> This change will make make possible to prevent any deferred probes once
>> devices are probed in dependency order.
>>
>> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
>> ---
>>
>> Changes in v2:
>> - Instead of delaying all probes until late_initcall, only delay matches
>> of platform devices that have a firmware node attached.
>>
>> drivers/base/property.c | 29 +++++++++++++++++++++++++++++
>> 1 file changed, 29 insertions(+)
>>
>> diff --git a/drivers/base/property.c b/drivers/base/property.c
>> index 8528eb9..8ead1ba 100644
>> --- a/drivers/base/property.c
>> +++ b/drivers/base/property.c
>> @@ -16,8 +16,11 @@
>> #include <linux/of.h>
>> #include <linux/of_address.h>
>> #include <linux/of_device.h>
>> +#include <linux/platform_device.h>
>> #include <linux/property.h>
>>
>> +static bool fwnode_match_enable = false;
>> +
>> /**
>> * device_add_property_set - Add a collection of properties to a device object.
>> * @dev: Device to add properties to.
>> @@ -604,6 +607,15 @@ EXPORT_SYMBOL_GPL(fwnode_is_compatible);
>> bool fwnode_driver_match_device(struct device *dev,
>> const struct device_driver *drv)
>> {
>> + /*
>> + * Delay matches of platform devices until late_initcall, when we are
>> + * sure that all built-in drivers have been registered already. This
>> + * is needed to prevent deferred probes because of some drivers
>> + * not having registered yet.
>> + */
>> + if(dev->bus = &platform_bus_type && !fwnode_match_enable)
>> + return false;
>
> I'm not particularly enthusiastic about referring to specific bus types in
> generic code like that.
Agreed.
> What about having a special version of fwnode_driver_match_device() specifically
> for the platform bus type that will do the check?
Have moved all this code to base/platform.c instead, as I don't see
any reason to have it in property.c.
Thanks,
Tomeu
>> +
>> if (is_of_node(dev->fwnode))
>> return of_driver_match_device(dev, drv);
>> else if (is_acpi_node(dev->fwnode))
>> @@ -612,3 +624,20 @@ bool fwnode_driver_match_device(struct device *dev,
>> return false;
>> }
>> EXPORT_SYMBOL_GPL(fwnode_driver_match_device);
>> +
>> +static int __device_attach(struct device *dev, void *data)
>> +{
>> + device_initial_probe(dev);
>> +
>> + return 0;
>> +}
>> +
>> +static int fwnode_match_initcall(void)
>> +{
>> + fwnode_match_enable = true;
>> +
>> + bus_for_each_dev(&platform_bus_type, NULL, NULL, __device_attach);
>> +
>> + return 0;
>> +}
>> +late_initcall(fwnode_match_initcall);
>>
>
> --
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply
* Re: [PATCH] Staging: sm750fb: ddk750_dvi.h: Fix brace coding style issue
From: Dan Carpenter @ 2015-07-10 7:03 UTC (permalink / raw)
To: Anders Fridlund
Cc: Sudip Mukherjee, devel, gregkh, linux-fbdev, teddy.wang,
linux-kernel
In-Reply-To: <CAOcrEa6gTQCwovGEGw-pF-LECfr-nFaWJ=A42+qKA6e+yr=0UA@mail.gmail.com>
On Fri, Jul 10, 2015 at 08:56:05AM +0200, Anders Fridlund wrote:
> Sorry, for that. Do I need to re-submit the patch(es), or should I
> only change it for future patches?
For future patches.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH] Staging: sm750fb: ddk750_dvi.h: Fix brace coding style issue
From: Anders Fridlund @ 2015-07-10 6:56 UTC (permalink / raw)
To: Sudip Mukherjee; +Cc: teddy.wang, gregkh, linux-fbdev, devel, linux-kernel
In-Reply-To: <20150710053332.GA21349@sudip-PC>
Sorry, for that. Do I need to re-submit the patch(es), or should I
only change it for future patches?
Cheers,
Anders Fridlund
On Fri, Jul 10, 2015 at 7:33 AM, Sudip Mukherjee
<sudipm.mukherjee@gmail.com> wrote:
> On Thu, Jul 09, 2015 at 02:45:22PM +0200, anders.fridlund@gmail.com wrote:
>> From: Anders Fridlund <anders.fridlund@gmail.com>
> same comment that I gave to your another patch.
> "No need to mention this From: here. Please fix your .gitconfig so that
> git send-email will put your name in the email From: header."
>
> regards
> sudip
^ permalink raw reply
* [PATCH 2/2] video: fbdev: Drop owner assignment from platform_driver
From: Krzysztof Kozlowski @ 2015-07-10 6:37 UTC (permalink / raw)
To: Tomi Valkeinen, Jean-Christophe Plagniol-Villard, linux-omap,
linux-fbdev, linux-kernel
Cc: Krzysztof Kozlowski
In-Reply-To: <1436510250-5633-1-git-send-email-k.kozlowski@samsung.com>
platform_driver does not need to set an owner because
platform_driver_register() will set it.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
The coccinelle script which generated the patch was sent here:
http://www.spinics.net/lists/kernel/msg2029903.html
---
drivers/video/fbdev/omap2/displays-new/encoder-opa362.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/video/fbdev/omap2/displays-new/encoder-opa362.c b/drivers/video/fbdev/omap2/displays-new/encoder-opa362.c
index a14d993f719d..8c246c213e06 100644
--- a/drivers/video/fbdev/omap2/displays-new/encoder-opa362.c
+++ b/drivers/video/fbdev/omap2/displays-new/encoder-opa362.c
@@ -266,7 +266,6 @@ static struct platform_driver opa362_driver = {
.remove = __exit_p(opa362_remove),
.driver = {
.name = "amplifier-opa362",
- .owner = THIS_MODULE,
.of_match_table = opa362_of_match,
.suppress_bind_attrs = true,
},
--
1.9.1
^ permalink raw reply related
* [PATCH 1/2] video: fbdev: Drop owner assignment from i2c_driver
From: Krzysztof Kozlowski @ 2015-07-10 6:37 UTC (permalink / raw)
To: Tomi Valkeinen, Jean-Christophe Plagniol-Villard, linux-omap,
linux-fbdev, linux-kernel
Cc: Krzysztof Kozlowski
In-Reply-To: <1436510250-5633-1-git-send-email-k.kozlowski@samsung.com>
i2c_driver does not need to set an owner because i2c_register_driver()
will set it.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
The coccinelle script which generated the patch was sent here:
http://www.spinics.net/lists/kernel/msg2029903.html
---
drivers/video/fbdev/ssd1307fb.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
index 3e153c06131a..b6edd28b267f 100644
--- a/drivers/video/fbdev/ssd1307fb.c
+++ b/drivers/video/fbdev/ssd1307fb.c
@@ -719,7 +719,6 @@ static struct i2c_driver ssd1307fb_driver = {
.driver = {
.name = "ssd1307fb",
.of_match_table = ssd1307fb_of_match,
- .owner = THIS_MODULE,
},
};
--
1.9.1
^ permalink raw reply related
* [PATCH] Drop owner assignment from i2c_driver (and platform left-overs)
From: Krzysztof Kozlowski @ 2015-07-10 6:37 UTC (permalink / raw)
To: Tomi Valkeinen, Jean-Christophe Plagniol-Villard, linux-omap,
linux-fbdev, linux-kernel
Cc: Krzysztof Kozlowski
Hi,
The i2c drivers also do not have to set 'owner' field because
i2c_register_driver() will do it instead.
'owner' is removed from i2c drivers, which I was able to compile
with allyesconfig (arm, arm64, i386, x86_64, ppc64).
Only compile-tested.
The coccinelle script which generated the patch was sent here:
http://www.spinics.net/lists/kernel/msg2029903.html
Best regards,
Krzysztof
Krzysztof Kozlowski (2):
video: fbdev: Drop owner assignment from i2c_driver
video: fbdev: Drop owner assignment from platform_driver
drivers/video/fbdev/omap2/displays-new/encoder-opa362.c | 1 -
drivers/video/fbdev/ssd1307fb.c | 1 -
2 files changed, 2 deletions(-)
--
1.9.1
^ permalink raw reply
* Re: [PATCH] Staging: sm750fb: ddk750_dvi.h: Fix brace coding style issue
From: Sudip Mukherjee @ 2015-07-10 5:45 UTC (permalink / raw)
To: anders.fridlund; +Cc: teddy.wang, gregkh, linux-fbdev, devel, linux-kernel
In-Reply-To: <1436445922-5218-1-git-send-email-anders.fridlund@gmail.com>
On Thu, Jul 09, 2015 at 02:45:22PM +0200, anders.fridlund@gmail.com wrote:
> From: Anders Fridlund <anders.fridlund@gmail.com>
same comment that I gave to your another patch.
"No need to mention this From: here. Please fix your .gitconfig so that
git send-email will put your name in the email From: header."
regards
sudip
^ permalink raw reply
* [PATCH v6 4/4] drivers/video/fbdev/atyfb: Use arch_phys_wc_add() and ioremap_wc()
From: Luis R. Rodriguez @ 2015-07-10 1:24 UTC (permalink / raw)
To: mingo
Cc: bp, tomi.valkeinen, airlied, arnd, dan.j.williams, hch, luto, hpa,
tglx, geert, ralf, hmh, ross.zwisler, akpm, jgross, benh, mpe, tj,
x86, mst, toshi.kani, stefan.bader, syrjala, ville.syrjala,
linux-pci, linux-mm, linux-fbdev, linux-kernel, Luis R. Rodriguez,
Andrzej Hajda, Antonino Daplas, Daniel Vetter, Davidlohr Bueso,
Jean-Christophe Plagniol-Villard, Mathias Krause, Mel Gorman,
Rob Clark, Suresh Siddha, Vlastimil Babka
In-Reply-To: <1436491499-3289-1-git-send-email-mcgrof@do-not-panic.com>
From: "Luis R. Rodriguez" <mcgrof@suse.com>
This driver uses strong UC for the MMIO region, and ioremap_wc() for the
framebuffer to whitelist for the WC MTRR that can be changed to WC. On
PAT systems we don't need the MTRR call so just use arch_phys_wc_add()
there, this lets us remove all those ifdefs. Let's also be consistent
and use ioremap_wc() for ATARI as well.
There are a few motivations for this:
a) Take advantage of PAT when available.
b) Help bury MTRR code away, MTRR is architecture specific and on
x86 it is being replaced by PAT.
c) Help with the goal of eventually using _PAGE_CACHE_UC over
_PAGE_CACHE_UC_MINUS on x86 on ioremap_nocache() (see commit
de33c442e titled "x86 PAT: fix performance drop for glx,
use UC minus for ioremap(), ioremap_nocache() and
pci_mmap_page_range()").
The conversion done is expressed by the following Coccinelle
SmPL patch, it additionally required manual intervention to
address all the ifdeffery and removal of redundant things which
arch_phys_wc_add() already addresses such as verbose message about
when MTRR fails and doing nothing when we didn't get an MTRR.
@ mtrr_found @
expression index, base, size;
@@
-index = mtrr_add(base, size, MTRR_TYPE_WRCOMB, 1);
+index = arch_phys_wc_add(base, size);
@ mtrr_rm depends on mtrr_found @
expression mtrr_found.index, mtrr_found.base, mtrr_found.size;
@@
-mtrr_del(index, base, size);
+arch_phys_wc_del(index);
@ mtrr_rm_zero_arg depends on mtrr_found @
expression mtrr_found.index;
@@
-mtrr_del(index, 0, 0);
+arch_phys_wc_del(index);
@ mtrr_rm_fb_info depends on mtrr_found @
struct fb_info *info;
expression mtrr_found.index;
@@
-mtrr_del(index, info->fix.smem_start, info->fix.smem_len);
+arch_phys_wc_del(index);
@ ioremap_replace_nocache depends on mtrr_found @
struct fb_info *info;
expression base, size;
@@
-info->screen_base = ioremap_nocache(base, size);
+info->screen_base = ioremap_wc(base, size);
@ ioremap_replace_default depends on mtrr_found @
struct fb_info *info;
expression base, size;
@@
-info->screen_base = ioremap(base, size);
+info->screen_base = ioremap_wc(base, size);
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
Cc: airlied@redhat.com
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: benh@kernel.crashing.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Davidlohr Bueso <dbueso@suse.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Cc: Mathias Krause <minipli@googlemail.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: mst@redhat.com
Cc: Rob Clark <robdclark@gmail.com>
Cc: Suresh Siddha <sbsiddha@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Toshi Kani <toshi.kani@hp.com>
Cc: Ville Syrjälä <syrjala@sci.fi>
Cc: Vlastimil Babka <vbabka@suse.cz>
Link: http://lkml.kernel.org/r/1435196060-27350-4-git-send-email-mcgrof@do-not-panic.com
Signed-off-by: Borislav Petkov <bp@suse.de>
---
drivers/video/fbdev/aty/atyfb.h | 4 +---
drivers/video/fbdev/aty/atyfb_base.c | 36 +++++++-----------------------------
2 files changed, 8 insertions(+), 32 deletions(-)
diff --git a/drivers/video/fbdev/aty/atyfb.h b/drivers/video/fbdev/aty/atyfb.h
index 89ec4398d201..63c4842eb224 100644
--- a/drivers/video/fbdev/aty/atyfb.h
+++ b/drivers/video/fbdev/aty/atyfb.h
@@ -182,9 +182,7 @@ struct atyfb_par {
unsigned long irq_flags;
unsigned int irq;
spinlock_t int_lock;
-#ifdef CONFIG_MTRR
- int mtrr_aper;
-#endif
+ int wc_cookie;
u32 mem_cntl;
struct crtc saved_crtc;
union aty_pll saved_pll;
diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c
index ea27ba3e5e6d..a807c0196464 100644
--- a/drivers/video/fbdev/aty/atyfb_base.c
+++ b/drivers/video/fbdev/aty/atyfb_base.c
@@ -98,9 +98,6 @@
#ifdef CONFIG_PMAC_BACKLIGHT
#include <asm/backlight.h>
#endif
-#ifdef CONFIG_MTRR
-#include <asm/mtrr.h>
-#endif
/*
* Debug flags.
@@ -303,9 +300,7 @@ static struct fb_ops atyfb_ops = {
};
static bool noaccel;
-#ifdef CONFIG_MTRR
static bool nomtrr;
-#endif
static int vram;
static int pll;
static int mclk;
@@ -2628,17 +2623,13 @@ static int aty_init(struct fb_info *info)
aty_st_le32(BUS_CNTL, aty_ld_le32(BUS_CNTL, par) |
BUS_APER_REG_DIS, par);
-#ifdef CONFIG_MTRR
- par->mtrr_aper = -1;
- if (!nomtrr) {
+ if (!nomtrr)
/*
* Only the ioremap_wc()'d area will get WC here
* since ioremap_uc() was used on the entire PCI BAR.
*/
- par->mtrr_aper = mtrr_add(par->res_start, par->res_size,
- MTRR_TYPE_WRCOMB, 1);
- }
-#endif
+ par->wc_cookie = arch_phys_wc_add(par->res_start,
+ par->res_size);
info->fbops = &atyfb_ops;
info->pseudo_palette = par->pseudo_palette;
@@ -2766,13 +2757,8 @@ aty_init_exit:
/* restore video mode */
aty_set_crtc(par, &par->saved_crtc);
par->pll_ops->set_pll(info, &par->saved_pll);
+ arch_phys_wc_del(par->wc_cookie);
-#ifdef CONFIG_MTRR
- if (par->mtrr_aper >= 0) {
- mtrr_del(par->mtrr_aper, 0, 0);
- par->mtrr_aper = -1;
- }
-#endif
return ret;
}
@@ -3672,7 +3658,8 @@ static int __init atyfb_atari_probe(void)
* Map the video memory (physical address given)
* to somewhere in the kernel address space.
*/
- info->screen_base = ioremap(phys_vmembase[m64_num], phys_size[m64_num]);
+ info->screen_base = ioremap_wc(phys_vmembase[m64_num],
+ phys_size[m64_num]);
info->fix.smem_start = (unsigned long)info->screen_base; /* Fake! */
par->ati_regbase = ioremap(phys_guiregbase[m64_num], 0x10000) +
0xFC00ul;
@@ -3738,13 +3725,8 @@ static void atyfb_remove(struct fb_info *info)
if (M64_HAS(MOBIL_BUS))
aty_bl_exit(info->bl_dev);
#endif
+ arch_phys_wc_del(par->wc_cookie);
-#ifdef CONFIG_MTRR
- if (par->mtrr_aper >= 0) {
- mtrr_del(par->mtrr_aper, 0, 0);
- par->mtrr_aper = -1;
- }
-#endif
#ifndef __sparc__
if (par->ati_regbase)
iounmap(par->ati_regbase);
@@ -3860,10 +3842,8 @@ static int __init atyfb_setup(char *options)
while ((this_opt = strsep(&options, ",")) != NULL) {
if (!strncmp(this_opt, "noaccel", 7)) {
noaccel = 1;
-#ifdef CONFIG_MTRR
} else if (!strncmp(this_opt, "nomtrr", 6)) {
nomtrr = 1;
-#endif
} else if (!strncmp(this_opt, "vram:", 5))
vram = simple_strtoul(this_opt + 5, NULL, 0);
else if (!strncmp(this_opt, "pll:", 4))
@@ -4033,7 +4013,5 @@ module_param(comp_sync, int, 0);
MODULE_PARM_DESC(comp_sync, "Set composite sync signal to low (0) or high (1)");
module_param(mode, charp, 0);
MODULE_PARM_DESC(mode, "Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\" ");
-#ifdef CONFIG_MTRR
module_param(nomtrr, bool, 0);
MODULE_PARM_DESC(nomtrr, "bool: disable use of MTRR registers");
-#endif
--
2.3.2.209.gd67f9d5.dirty
^ 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