* [PATCH] fbcon: unconditionally initialize cursor blink interval
From: Scot Doyle @ 2015-08-04 12:33 UTC (permalink / raw)
To: Tomi Valkeinen, Jean-Christophe Plagniol-Villard
Cc: Thierry Reding, Kevin Hilman, Greg Kroah-Hartman, Jiri Slaby,
Pavel Machek, Geert Uytterhoeven, linux-fbdev, linux-kernel
A sun7i-a20-olinuxino-micro fails to boot when kernel parameter
vt.global_cursor_default=0. The value is copied to vc->vc_deccm
causing the initialization of ops->cur_blink_jiffies to be skipped.
Unconditionally initialize it.
Reported-and-tested-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Scot Doyle <lkml14@scotdoyle.com>
---
drivers/video/console/fbcon.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 658c34b..1aaf893 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -1306,10 +1306,11 @@ static void fbcon_cursor(struct vc_data *vc, int mode)
int y;
int c = scr_readw((u16 *) vc->vc_pos);
+ ops->cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms);
+
if (fbcon_is_inactive(vc, info) || vc->vc_deccm != 1)
return;
- ops->cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms);
if (vc->vc_cursor_type & 0x10)
fbcon_del_cursor_timer(info);
else
--
2.1.4
^ permalink raw reply related
* [PATCH] video: fbdev: pxa3xx_gcu: prepare the clocks
From: Robert Jarzmik @ 2015-08-03 20:15 UTC (permalink / raw)
To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
Cc: linux-fbdev, linux-kernel, Robert Jarzmik
The clocks need to be prepared before being enabled. Without it a
warning appears in the drivers probe path :
WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:707 clk_core_enable+0x84/0xa0()
Modules linked in:
CPU: 0 PID: 1 Comm: swapper Not tainted 4.2.0-rc3-cm-x300+ #804
Hardware name: CM-X300 module
[<c000ed50>] (unwind_backtrace) from [<c000ce08>] (show_stack+0x10/0x14)
[<c000ce08>] (show_stack) from [<c0017eb4>] (warn_slowpath_common+0x7c/0xb4)
[<c0017eb4>] (warn_slowpath_common) from [<c0017f88>] (warn_slowpath_null+0x1c/0x24)
[<c0017f88>] (warn_slowpath_null) from [<c02d30dc>] (clk_core_enable+0x84/0xa0)
[<c02d30dc>] (clk_core_enable) from [<c02d3118>] (clk_enable+0x20/0x34)
[<c02d3118>] (clk_enable) from [<c0200dfc>] (pxa3xx_gcu_probe+0x148/0x338)
[<c0200dfc>] (pxa3xx_gcu_probe) from
[<c022eccc>] (platform_drv_probe+0x30/0x94)
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
drivers/video/fbdev/pxa3xx-gcu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c
index 86bd457d039d..50bce45e7f3d 100644
--- a/drivers/video/fbdev/pxa3xx-gcu.c
+++ b/drivers/video/fbdev/pxa3xx-gcu.c
@@ -653,7 +653,7 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev)
goto err_free_dma;
}
- ret = clk_enable(priv->clk);
+ ret = clk_prepare_enable(priv->clk);
if (ret < 0) {
dev_err(dev, "failed to enable clock\n");
goto err_misc_deregister;
@@ -685,7 +685,7 @@ err_misc_deregister:
misc_deregister(&priv->misc_dev);
err_disable_clk:
- clk_disable(priv->clk);
+ clk_disable_unprepare(priv->clk);
return ret;
}
--
2.1.4
^ permalink raw reply related
* Re: [PATCH 1/2] ARM: integrator: move framebuffers to driver
From: Linus Walleij @ 2015-08-03 7:30 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20150729193846.GQ7557@n2100.arm.linux.org.uk>
On Wed, Jul 29, 2015 at 9:38 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Wed, Jul 29, 2015 at 02:27:11PM +0200, Linus Walleij wrote:
>> Commit 11c32d7b6274cb0f554943d65bd4a126c4a86dcd
>> "video: move Versatile CLCD helpers" already moved the
>> CLCD mode setting helpers for Versatile and Integrator/CP
>> to drivers/video/fbdev. Let's do the same for the IM-PD1
>> add-on board, copy the missing displays into the database
>> and simplify the code.
>
> And thereby break the support. The IM-PD1 CLCD can only access the memory
> on the IM-PD1. That's why the CLCD driver itself doesn't just allocate
> the frame buffer using dma_alloc_writecombine(). Where the memory comes
> from is platform specific. In this case...
>
>> -static int impd1fb_clcd_setup(struct clcd_fb *fb)
>> -{
>> - unsigned long framebase = fb->dev->res.start + 0x01000000;
>> - unsigned long framesize = SZ_1M;
>
> It's a chunk of SRAM offset by the specified value and of the specified
> size above.
Argh how typical. I need to get one of these PROSPECTOR displays
so I can actually test this stuff. I have tried to get VGA out working with
the IM-PD1 but it just doesn't seem to come up no matter how I
try.
Yours,
Linus Walleij
^ permalink raw reply
* [PATCH 1/7] cpufreq: remove redundant CPUFREQ_INCOMPATIBLE notifier event
From: Viresh Kumar @ 2015-08-03 3:18 UTC (permalink / raw)
To: Rafael Wysocki
Cc: linaro-kernel, linux-pm, Viresh Kumar, Dmitry Eremin-Solenikov,
Fabian Frederick, Jean-Christophe Plagniol-Villard,
Jonathan Corbet, Len Brown, open list:ACPI,
open list:DOCUMENTATION, open list:FRAMEBUFFER LAYER, open list,
Nicholas Mc Guire, Russell King, Tomi Valkeinen, Wolfram Sang
In-Reply-To: <cover.1438571116.git.viresh.kumar@linaro.org>
What's being done from CPUFREQ_INCOMPATIBLE, can also be done with
CPUFREQ_ADJUST. There is nothing special with CPUFREQ_INCOMPATIBLE
notifier.
Kill CPUFREQ_INCOMPATIBLE and fix its usage sites.
This also updates the numbering of notifier events to remove holes.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
Documentation/cpu-freq/core.txt | 7 ++-----
drivers/acpi/processor_perflib.c | 2 +-
drivers/cpufreq/cpufreq.c | 4 ----
drivers/cpufreq/ppc_cbe_cpufreq_pmi.c | 4 ++--
drivers/video/fbdev/pxafb.c | 1 -
drivers/video/fbdev/sa1100fb.c | 1 -
include/linux/cpufreq.h | 9 ++++-----
7 files changed, 9 insertions(+), 19 deletions(-)
diff --git a/Documentation/cpu-freq/core.txt b/Documentation/cpu-freq/core.txt
index 70933eadc308..ba78e7c2a069 100644
--- a/Documentation/cpu-freq/core.txt
+++ b/Documentation/cpu-freq/core.txt
@@ -55,16 +55,13 @@ transition notifiers.
----------------------------
These are notified when a new policy is intended to be set. Each
-CPUFreq policy notifier is called three times for a policy transition:
+CPUFreq policy notifier is called twice for a policy transition:
1.) During CPUFREQ_ADJUST all CPUFreq notifiers may change the limit if
they see a need for this - may it be thermal considerations or
hardware limitations.
-2.) During CPUFREQ_INCOMPATIBLE only changes may be done in order to avoid
- hardware failure.
-
-3.) And during CPUFREQ_NOTIFY all notifiers are informed of the new policy
+2.) And during CPUFREQ_NOTIFY all notifiers are informed of the new policy
- if two hardware drivers failed to agree on a new policy before this
stage, the incompatible hardware shall be shut down, and the user
informed of this.
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index 47af702bb6a2..bb01dea39fdc 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -83,7 +83,7 @@ static int acpi_processor_ppc_notifier(struct notifier_block *nb,
if (ignore_ppc)
return 0;
- if (event != CPUFREQ_INCOMPATIBLE)
+ if (event != CPUFREQ_ADJUST)
return 0;
mutex_lock(&performance_mutex);
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 76a26609d96b..293f47b814bf 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2206,10 +2206,6 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
CPUFREQ_ADJUST, new_policy);
- /* adjust if necessary - hardware incompatibility*/
- blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
- CPUFREQ_INCOMPATIBLE, new_policy);
-
/*
* verify the cpu speed can be set within this limit, which might be
* different to the first one
diff --git a/drivers/cpufreq/ppc_cbe_cpufreq_pmi.c b/drivers/cpufreq/ppc_cbe_cpufreq_pmi.c
index d29e8da396a0..7969f7690498 100644
--- a/drivers/cpufreq/ppc_cbe_cpufreq_pmi.c
+++ b/drivers/cpufreq/ppc_cbe_cpufreq_pmi.c
@@ -97,8 +97,8 @@ static int pmi_notifier(struct notifier_block *nb,
struct cpufreq_frequency_table *cbe_freqs;
u8 node;
- /* Should this really be called for CPUFREQ_ADJUST, CPUFREQ_INCOMPATIBLE
- * and CPUFREQ_NOTIFY policy events?)
+ /* Should this really be called for CPUFREQ_ADJUST and CPUFREQ_NOTIFY
+ * policy events?)
*/
if (event = CPUFREQ_START)
return 0;
diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c
index 7245611ec963..94813af97f09 100644
--- a/drivers/video/fbdev/pxafb.c
+++ b/drivers/video/fbdev/pxafb.c
@@ -1668,7 +1668,6 @@ pxafb_freq_policy(struct notifier_block *nb, unsigned long val, void *data)
switch (val) {
case CPUFREQ_ADJUST:
- case CPUFREQ_INCOMPATIBLE:
pr_debug("min dma period: %d ps, "
"new clock %d kHz\n", pxafb_display_dma_period(var),
policy->max);
diff --git a/drivers/video/fbdev/sa1100fb.c b/drivers/video/fbdev/sa1100fb.c
index 89dd7e02197f..dcf774c15889 100644
--- a/drivers/video/fbdev/sa1100fb.c
+++ b/drivers/video/fbdev/sa1100fb.c
@@ -1042,7 +1042,6 @@ sa1100fb_freq_policy(struct notifier_block *nb, unsigned long val,
switch (val) {
case CPUFREQ_ADJUST:
- case CPUFREQ_INCOMPATIBLE:
dev_dbg(fbi->dev, "min dma period: %d ps, "
"new clock %d kHz\n", sa1100fb_min_dma_period(fbi),
policy->max);
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index bde1e567b3a9..bedcc90c0757 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -369,11 +369,10 @@ static inline void cpufreq_resume(void) {}
/* Policy Notifiers */
#define CPUFREQ_ADJUST (0)
-#define CPUFREQ_INCOMPATIBLE (1)
-#define CPUFREQ_NOTIFY (2)
-#define CPUFREQ_START (3)
-#define CPUFREQ_CREATE_POLICY (4)
-#define CPUFREQ_REMOVE_POLICY (5)
+#define CPUFREQ_NOTIFY (1)
+#define CPUFREQ_START (2)
+#define CPUFREQ_CREATE_POLICY (3)
+#define CPUFREQ_REMOVE_POLICY (4)
#ifdef CONFIG_CPU_FREQ
int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list);
--
2.4.0
^ permalink raw reply related
* [PATCH v2 09/11] fbdev: Allow compile test of GPIO consumers if !GPIOLIB
From: Geert Uytterhoeven @ 2015-08-02 9:09 UTC (permalink / raw)
To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
Cc: linux-fbdev, Linus Walleij, Alexandre Courbot, linux-gpio,
Geert Uytterhoeven
In-Reply-To: <1438506475-31012-1-git-send-email-geert@linux-m68k.org>
The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is
not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer
functionality only, can still be compiled if GPIOLIB is not enabled.
Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where
appropriate.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
---
v2:
- Add Acked-by.
---
drivers/video/fbdev/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index 2d98de535e0f7374..569803f533d1a600 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -2464,7 +2464,7 @@ config FB_SSD1307
tristate "Solomon SSD1307 framebuffer support"
depends on FB && I2C
depends on OF
- depends on GPIOLIB
+ depends on GPIOLIB || COMPILE_TEST
select FB_SYS_FOPS
select FB_SYS_FILLRECT
select FB_SYS_COPYAREA
--
1.9.1
^ permalink raw reply related
* Re: [PATCH 4/8] xen: Use the correctly the Xen memory terminologies
From: Stefano Stabellini @ 2015-07-31 11:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1438095769-2560-5-git-send-email-julien.grall@citrix.com>
On Tue, 28 Jul 2015, Julien Grall wrote:
> Based on include/xen/mm.h [1], Linux is mistakenly using MFN when GFN
> is meant, I suspect this is because the first support for Xen was for
> PV. This brough some misimplementation of helpers on ARM and make the
> developper confused the expected behavior.
>
> For instance, with pfn_to_mfn, we expect to get an MFN based on the name.
> Although, if we look at the implementation on x86, it's returning a GFN.
>
> For clarity and avoid new confusion, replace any reference of mfn into
> gnf in any helpers used by PV drivers.
>
> Take also the opportunity to simplify simple construction such
> as pfn_to_mfn(page_to_pfn(page)) into page_to_gfn. More complex clean up
> will come in follow-up patches.
>
> I think it may be possible to do further clean up in the x86 code to
> ensure that helpers returning machine address (such as virt_address) is
> not used by no auto-translated guests. I will let x86 xen expert doing
> it.
>
> [1] Xen tree: e758ed14f390342513405dd766e874934573e6cb
>
> Signed-off-by: Julien Grall <julien.grall@citrix.com>
Aside from the many typos
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> arch/arm/include/asm/xen/page.h | 13 +++++++------
> arch/x86/include/asm/xen/page.h | 30 ++++++++++++++++--------------
> arch/x86/xen/enlighten.c | 4 ++--
> arch/x86/xen/mmu.c | 16 ++++++++--------
> arch/x86/xen/p2m.c | 32 ++++++++++++++++----------------
> arch/x86/xen/setup.c | 12 ++++++------
> arch/x86/xen/smp.c | 4 ++--
> arch/x86/xen/suspend.c | 8 ++++----
> drivers/block/xen-blkfront.c | 6 +++---
> drivers/input/misc/xen-kbdfront.c | 4 ++--
> drivers/net/xen-netback/netback.c | 4 ++--
> drivers/net/xen-netfront.c | 8 ++++----
> drivers/scsi/xen-scsifront.c | 8 +++-----
> drivers/tty/hvc/hvc_xen.c | 5 +++--
> drivers/video/fbdev/xen-fbfront.c | 4 ++--
> drivers/xen/balloon.c | 2 +-
> drivers/xen/events/events_base.c | 2 +-
> drivers/xen/events/events_fifo.c | 4 ++--
> drivers/xen/gntalloc.c | 3 ++-
> drivers/xen/manage.c | 2 +-
> drivers/xen/tmem.c | 4 ++--
> drivers/xen/xenbus/xenbus_client.c | 2 +-
> drivers/xen/xenbus/xenbus_dev_backend.c | 2 +-
> drivers/xen/xenbus/xenbus_probe.c | 8 +++-----
> include/xen/page.h | 4 ++--
> 25 files changed, 96 insertions(+), 95 deletions(-)
>
> diff --git a/arch/arm/include/asm/xen/page.h b/arch/arm/include/asm/xen/page.h
> index 493471f..f542f68 100644
> --- a/arch/arm/include/asm/xen/page.h
> +++ b/arch/arm/include/asm/xen/page.h
> @@ -34,14 +34,15 @@ typedef struct xpaddr {
> unsigned long __pfn_to_mfn(unsigned long pfn);
> extern struct rb_root phys_to_mach;
>
> -static inline unsigned long pfn_to_mfn(unsigned long pfn)
> +/* Pseudo-physical <-> Guest conversion */
> +static inline unsigned long pfn_to_gfn(unsigned long pfn)
> {
> return pfn;
> }
>
> -static inline unsigned long mfn_to_pfn(unsigned long mfn)
> +static inline unsigned long gfn_to_pfn(unsigned long gfn)
> {
> - return mfn;
> + return gfn;
> }
>
> /* Pseudo-physical <-> DMA conversion */
> @@ -65,9 +66,9 @@ static inline unsigned long dfn_to_pfn(unsigned long dfn)
>
> #define dfn_to_local_pfn(dfn) dfn_to_pfn(dfn)
>
> -/* VIRT <-> MACHINE conversion */
> -#define virt_to_mfn(v) (pfn_to_mfn(virt_to_pfn(v)))
> -#define mfn_to_virt(m) (__va(mfn_to_pfn(m) << PAGE_SHIFT))
> +/* VIRT <-> GUEST conversion */
> +#define virt_to_gfn(v) (pfn_to_gfn(virt_to_pfn(v)))
> +#define gfn_to_virt(m) (__va(gfn_to_pfn(m) << PAGE_SHIFT))
>
> /* Only used in PV code. However ARM guest is always assimilated as HVM. */
> static inline xmaddr_t arbitrary_virt_to_machine(void *vaddr)
> diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h
> index 046e91a..72d9f15 100644
> --- a/arch/x86/include/asm/xen/page.h
> +++ b/arch/x86/include/asm/xen/page.h
> @@ -99,7 +99,7 @@ static inline unsigned long __pfn_to_mfn(unsigned long pfn)
> return mfn;
> }
>
> -static inline unsigned long pfn_to_mfn(unsigned long pfn)
> +static inline unsigned long pfn_to_gfn(unsigned long pfn)
> {
> unsigned long mfn;
>
> @@ -145,23 +145,23 @@ static inline unsigned long mfn_to_pfn_no_overrides(unsigned long mfn)
> return pfn;
> }
>
> -static inline unsigned long mfn_to_pfn(unsigned long mfn)
> +static inline unsigned long gfn_to_pfn(unsigned long gfn)
> {
> unsigned long pfn;
>
> if (xen_feature(XENFEAT_auto_translated_physmap))
> - return mfn;
> + return gfn;
>
> - pfn = mfn_to_pfn_no_overrides(mfn);
> - if (__pfn_to_mfn(pfn) != mfn)
> + pfn = mfn_to_pfn_no_overrides(gfn);
> + if (__pfn_to_mfn(pfn) != gfn)
> pfn = ~0;
>
> /*
> * pfn is ~0 if there are no entries in the m2p for mfn or the
> * entry doesn't map back to the mfn.
> */
> - if (pfn = ~0 && __pfn_to_mfn(mfn) = IDENTITY_FRAME(mfn))
> - pfn = mfn;
> + if (pfn = ~0 && __pfn_to_mfn(gfn) = IDENTITY_FRAME(gfn))
> + pfn = gfn;
>
> return pfn;
> }
> @@ -169,18 +169,18 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
> static inline xmaddr_t phys_to_machine(xpaddr_t phys)
> {
> unsigned offset = phys.paddr & ~PAGE_MASK;
> - return XMADDR(PFN_PHYS(pfn_to_mfn(PFN_DOWN(phys.paddr))) | offset);
> + return XMADDR(PFN_PHYS(pfn_to_gfn(PFN_DOWN(phys.paddr))) | offset);
> }
>
> static inline xpaddr_t machine_to_phys(xmaddr_t machine)
> {
> unsigned offset = machine.maddr & ~PAGE_MASK;
> - return XPADDR(PFN_PHYS(mfn_to_pfn(PFN_DOWN(machine.maddr))) | offset);
> + return XPADDR(PFN_PHYS(gfn_to_pfn(PFN_DOWN(machine.maddr))) | offset);
> }
>
> /* Pseudo-physical <-> DMA conversion */
> -#define pfn_to_dfn(pfn) pfn_to_mfn(pfn)
> -#define dfn_to_pfn(dfn) mfn_to_pfn(dfn)
> +#define pfn_to_dfn(pfn) pfn_to_gfn(pfn)
> +#define dfn_to_pfn(dfn) gfn_to_pfn(dfn)
>
> /*
> * We detect special mappings in one of two ways:
> @@ -209,7 +209,7 @@ static inline unsigned long dfn_to_local_pfn(unsigned long mfn)
> if (xen_feature(XENFEAT_auto_translated_physmap))
> return mfn;
>
> - pfn = mfn_to_pfn(mfn);
> + pfn = gfn_to_pfn(mfn);
> if (__pfn_to_mfn(pfn) != mfn)
> return -1; /* force !pfn_valid() */
> return pfn;
> @@ -218,8 +218,10 @@ static inline unsigned long dfn_to_local_pfn(unsigned long mfn)
> /* VIRT <-> MACHINE conversion */
> #define virt_to_machine(v) (phys_to_machine(XPADDR(__pa(v))))
> #define virt_to_pfn(v) (PFN_DOWN(__pa(v)))
> -#define virt_to_mfn(v) (pfn_to_mfn(virt_to_pfn(v)))
> -#define mfn_to_virt(m) (__va(mfn_to_pfn(m) << PAGE_SHIFT))
> +
> +/* VIRT <-> GUEST conversion */
> +#define virt_to_gfn(v) (pfn_to_gfn(virt_to_pfn(v)))
> +#define gfn_to_virt(m) (__va(gfn_to_pfn(m) << PAGE_SHIFT))
>
> static inline unsigned long pte_mfn(pte_t pte)
> {
> diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
> index 0b95c9b..a519b1b 100644
> --- a/arch/x86/xen/enlighten.c
> +++ b/arch/x86/xen/enlighten.c
> @@ -573,7 +573,7 @@ static void xen_load_gdt(const struct desc_ptr *dtr)
> BUG_ON(ptep = NULL);
>
> pfn = pte_pfn(*ptep);
> - mfn = pfn_to_mfn(pfn);
> + mfn = pfn_to_gfn(pfn);
> virt = __va(PFN_PHYS(pfn));
>
> frames[f] = mfn;
> @@ -610,7 +610,7 @@ static void __init xen_load_gdt_boot(const struct desc_ptr *dtr)
> unsigned long pfn, mfn;
>
> pfn = virt_to_pfn(va);
> - mfn = pfn_to_mfn(pfn);
> + mfn = pfn_to_gfn(pfn);
>
> pte = pfn_pte(pfn, PAGE_KERNEL_RO);
>
> diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
> index dd151b2..742b8d2 100644
> --- a/arch/x86/xen/mmu.c
> +++ b/arch/x86/xen/mmu.c
> @@ -367,7 +367,7 @@ static pteval_t pte_mfn_to_pfn(pteval_t val)
> {
> if (val & _PAGE_PRESENT) {
> unsigned long mfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT;
> - unsigned long pfn = mfn_to_pfn(mfn);
> + unsigned long pfn = gfn_to_pfn(mfn);
>
> pteval_t flags = val & PTE_FLAGS_MASK;
> if (unlikely(pfn = ~0))
> @@ -730,7 +730,7 @@ static void xen_do_pin(unsigned level, unsigned long pfn)
> struct mmuext_op op;
>
> op.cmd = level;
> - op.arg1.mfn = pfn_to_mfn(pfn);
> + op.arg1.mfn = pfn_to_gfn(pfn);
>
> xen_extend_mmuext_op(&op);
> }
> @@ -1323,7 +1323,7 @@ static void __xen_write_cr3(bool kernel, unsigned long cr3)
> trace_xen_mmu_write_cr3(kernel, cr3);
>
> if (cr3)
> - mfn = pfn_to_mfn(PFN_DOWN(cr3));
> + mfn = pfn_to_gfn(PFN_DOWN(cr3));
> else
> mfn = 0;
>
> @@ -1493,7 +1493,7 @@ static void __init pin_pagetable_pfn(unsigned cmd, unsigned long pfn)
> {
> struct mmuext_op op;
> op.cmd = cmd;
> - op.arg1.mfn = pfn_to_mfn(pfn);
> + op.arg1.mfn = pfn_to_gfn(pfn);
> if (HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF))
> BUG();
> }
> @@ -1539,7 +1539,7 @@ static inline void __pin_pagetable_pfn(unsigned cmd, unsigned long pfn)
> mcs = __xen_mc_entry(sizeof(*op));
> op = mcs.args;
> op->cmd = cmd;
> - op->arg1.mfn = pfn_to_mfn(pfn);
> + op->arg1.mfn = pfn_to_gfn(pfn);
>
> MULTI_mmuext_op(mcs.mc, mcs.args, 1, NULL, DOMID_SELF);
> }
> @@ -1672,7 +1672,7 @@ static unsigned long __init m2p(phys_addr_t maddr)
> phys_addr_t paddr;
>
> maddr &= PTE_PFN_MASK;
> - paddr = mfn_to_pfn(maddr >> PAGE_SHIFT) << PAGE_SHIFT;
> + paddr = gfn_to_pfn(maddr >> PAGE_SHIFT) << PAGE_SHIFT;
>
> return paddr;
> }
> @@ -2178,7 +2178,7 @@ static void xen_zap_pfn_range(unsigned long vaddr, unsigned int order,
> mcs = __xen_mc_entry(0);
>
> if (in_frames)
> - in_frames[i] = virt_to_mfn(vaddr);
> + in_frames[i] = virt_to_gfn(vaddr);
>
> MULTI_update_va_mapping(mcs.mc, vaddr, VOID_PTE, 0);
> __set_phys_to_machine(virt_to_pfn(vaddr), INVALID_P2M_ENTRY);
> @@ -2343,7 +2343,7 @@ void xen_destroy_contiguous_region(phys_addr_t pstart, unsigned int order)
> spin_lock_irqsave(&xen_reservation_lock, flags);
>
> /* 1. Find start MFN of contiguous extent. */
> - in_frame = virt_to_mfn(vstart);
> + in_frame = virt_to_gfn(vstart);
>
> /* 2. Zap current PTEs. */
> xen_zap_pfn_range(vstart, order, NULL, out_frames);
> diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
> index 8b7f18e..9d23992d 100644
> --- a/arch/x86/xen/p2m.c
> +++ b/arch/x86/xen/p2m.c
> @@ -30,14 +30,14 @@
> * However not all entries are filled with MFNs. Specifically for all other
> * leaf entries, or for the top root, or middle one, for which there is a void
> * entry, we assume it is "missing". So (for example)
> - * pfn_to_mfn(0x90909090)=INVALID_P2M_ENTRY.
> + * pfn_to_gfn(0x90909090)=INVALID_P2M_ENTRY.
> * We have a dedicated page p2m_missing with all entries being
> * INVALID_P2M_ENTRY. This page may be referenced multiple times in the p2m
> * list/tree in case there are multiple areas with P2M_PER_PAGE invalid pfns.
> *
> * We also have the possibility of setting 1-1 mappings on certain regions, so
> * that:
> - * pfn_to_mfn(0xc0000)=0xc0000
> + * pfn_to_gfn(0xc0000)=0xc0000
> *
> * The benefit of this is, that we can assume for non-RAM regions (think
> * PCI BARs, or ACPI spaces), we can create mappings easily because we
> @@ -51,10 +51,10 @@
> * identity value instead of dereferencing and returning INVALID_P2M_ENTRY.
> * If the entry points to an allocated page, we just proceed as before and
> * return the PFN. If the PFN has IDENTITY_FRAME_BIT set we unmask that in
> - * appropriate functions (pfn_to_mfn).
> + * appropriate functions (pfn_to_gfn).
> *
> * The reason for having the IDENTITY_FRAME_BIT instead of just returning the
> - * PFN is that we could find ourselves where pfn_to_mfn(pfn)=pfn for a
> + * PFN is that we could find ourselves where pfn_to_gfn(pfn)=pfn for a
> * non-identity pfn. To protect ourselves against we elect to set (and get) the
> * IDENTITY_FRAME_BIT on all identity mapped PFNs.
> */
> @@ -129,7 +129,7 @@ static void p2m_top_mfn_init(unsigned long *top)
> unsigned i;
>
> for (i = 0; i < P2M_TOP_PER_PAGE; i++)
> - top[i] = virt_to_mfn(p2m_mid_missing_mfn);
> + top[i] = virt_to_gfn(p2m_mid_missing_mfn);
> }
>
> static void p2m_top_mfn_p_init(unsigned long **top)
> @@ -145,7 +145,7 @@ static void p2m_mid_mfn_init(unsigned long *mid, unsigned long *leaf)
> unsigned i;
>
> for (i = 0; i < P2M_MID_PER_PAGE; i++)
> - mid[i] = virt_to_mfn(leaf);
> + mid[i] = virt_to_gfn(leaf);
> }
>
> static void p2m_init(unsigned long *p2m)
> @@ -236,7 +236,7 @@ void __ref xen_build_mfn_list_list(void)
> if (ptep = p2m_missing_pte || ptep = p2m_identity_pte) {
> BUG_ON(mididx);
> BUG_ON(mid_mfn_p != p2m_mid_missing_mfn);
> - p2m_top_mfn[topidx] = virt_to_mfn(p2m_mid_missing_mfn);
> + p2m_top_mfn[topidx] = virt_to_gfn(p2m_mid_missing_mfn);
> pfn += (P2M_MID_PER_PAGE - 1) * P2M_PER_PAGE;
> continue;
> }
> @@ -248,7 +248,7 @@ void __ref xen_build_mfn_list_list(void)
> p2m_top_mfn_p[topidx] = mid_mfn_p;
> }
>
> - p2m_top_mfn[topidx] = virt_to_mfn(mid_mfn_p);
> + p2m_top_mfn[topidx] = virt_to_gfn(mid_mfn_p);
> mid_mfn_p[mididx] = mfn;
> }
> }
> @@ -261,7 +261,7 @@ void xen_setup_mfn_list_list(void)
> BUG_ON(HYPERVISOR_shared_info = &xen_dummy_shared_info);
>
> HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list_list > - virt_to_mfn(p2m_top_mfn);
> + virt_to_gfn(p2m_top_mfn);
> HYPERVISOR_shared_info->arch.max_pfn = xen_max_p2m_pfn;
> }
>
> @@ -531,7 +531,7 @@ static bool alloc_p2m(unsigned long pfn)
> top_mfn_p = &p2m_top_mfn[topidx];
> mid_mfn = ACCESS_ONCE(p2m_top_mfn_p[topidx]);
>
> - BUG_ON(virt_to_mfn(mid_mfn) != *top_mfn_p);
> + BUG_ON(virt_to_gfn(mid_mfn) != *top_mfn_p);
>
> if (mid_mfn = p2m_mid_missing_mfn) {
> /* Separately check the mid mfn level */
> @@ -545,12 +545,12 @@ static bool alloc_p2m(unsigned long pfn)
>
> p2m_mid_mfn_init(mid_mfn, p2m_missing);
>
> - missing_mfn = virt_to_mfn(p2m_mid_missing_mfn);
> - mid_mfn_mfn = virt_to_mfn(mid_mfn);
> + missing_mfn = virt_to_gfn(p2m_mid_missing_mfn);
> + mid_mfn_mfn = virt_to_gfn(mid_mfn);
> old_mfn = cmpxchg(top_mfn_p, missing_mfn, mid_mfn_mfn);
> if (old_mfn != missing_mfn) {
> free_p2m_page(mid_mfn);
> - mid_mfn = mfn_to_virt(old_mfn);
> + mid_mfn = gfn_to_virt(old_mfn);
> } else {
> p2m_top_mfn_p[topidx] = mid_mfn;
> }
> @@ -580,7 +580,7 @@ static bool alloc_p2m(unsigned long pfn)
> set_pte(ptep,
> pfn_pte(PFN_DOWN(__pa(p2m)), PAGE_KERNEL));
> if (mid_mfn)
> - mid_mfn[mididx] = virt_to_mfn(p2m);
> + mid_mfn[mididx] = virt_to_gfn(p2m);
> p2m = NULL;
> }
>
> @@ -682,7 +682,7 @@ int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops,
> continue;
>
> if (map_ops[i].flags & GNTMAP_contains_pte) {
> - pte = (pte_t *)(mfn_to_virt(PFN_DOWN(map_ops[i].host_addr)) +
> + pte = (pte_t *)(gfn_to_virt(PFN_DOWN(map_ops[i].host_addr)) +
> (map_ops[i].host_addr & ~PAGE_MASK));
> mfn = pte_mfn(*pte);
> } else {
> @@ -690,7 +690,7 @@ int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops,
> }
> pfn = page_to_pfn(pages[i]);
>
> - WARN(pfn_to_mfn(pfn) != INVALID_P2M_ENTRY, "page must be ballooned");
> + WARN(pfn_to_gfn(pfn) != INVALID_P2M_ENTRY, "page must be ballooned");
>
> if (unlikely(!set_phys_to_machine(pfn, FOREIGN_FRAME(mfn)))) {
> ret = -ENOMEM;
> diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
> index 55f388e..4c2e91d 100644
> --- a/arch/x86/xen/setup.c
> +++ b/arch/x86/xen/setup.c
> @@ -231,10 +231,10 @@ static void __init xen_set_identity_and_release_chunk(unsigned long start_pfn,
> /* Release pages first. */
> end = min(end_pfn, nr_pages);
> for (pfn = start_pfn; pfn < end; pfn++) {
> - unsigned long mfn = pfn_to_mfn(pfn);
> + unsigned long mfn = pfn_to_gfn(pfn);
>
> /* Make sure pfn exists to start with */
> - if (mfn = INVALID_P2M_ENTRY || mfn_to_pfn(mfn) != pfn)
> + if (mfn = INVALID_P2M_ENTRY || gfn_to_pfn(mfn) != pfn)
> continue;
>
> ret = xen_free_mfn(mfn);
> @@ -313,7 +313,7 @@ static void __init xen_do_set_identity_and_remap_chunk(
>
> BUG_ON(xen_feature(XENFEAT_auto_translated_physmap));
>
> - mfn_save = virt_to_mfn(buf);
> + mfn_save = virt_to_gfn(buf);
>
> for (ident_pfn_iter = start_pfn, remap_pfn_iter = remap_pfn;
> ident_pfn_iter < ident_end_pfn;
> @@ -321,7 +321,7 @@ static void __init xen_do_set_identity_and_remap_chunk(
> chunk = (left < REMAP_SIZE) ? left : REMAP_SIZE;
>
> /* Map first pfn to xen_remap_buf */
> - mfn = pfn_to_mfn(ident_pfn_iter);
> + mfn = pfn_to_gfn(ident_pfn_iter);
> set_pte_mfn(buf, mfn, PAGE_KERNEL);
>
> /* Save mapping information in page */
> @@ -329,7 +329,7 @@ static void __init xen_do_set_identity_and_remap_chunk(
> xen_remap_buf.target_pfn = remap_pfn_iter;
> xen_remap_buf.size = chunk;
> for (i = 0; i < chunk; i++)
> - xen_remap_buf.mfns[i] = pfn_to_mfn(ident_pfn_iter + i);
> + xen_remap_buf.mfns[i] = pfn_to_gfn(ident_pfn_iter + i);
>
> /* Put remap buf into list. */
> xen_remap_mfn = mfn;
> @@ -473,7 +473,7 @@ void __init xen_remap_memory(void)
> unsigned long pfn_s = ~0UL;
> unsigned long len = 0;
>
> - mfn_save = virt_to_mfn(buf);
> + mfn_save = virt_to_gfn(buf);
>
> while (xen_remap_mfn != INVALID_P2M_ENTRY) {
> /* Map the remap information */
> diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
> index 8648438..680f281 100644
> --- a/arch/x86/xen/smp.c
> +++ b/arch/x86/xen/smp.c
> @@ -395,7 +395,7 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle)
>
> gdt_mfn = arbitrary_virt_to_mfn(gdt);
> make_lowmem_page_readonly(gdt);
> - make_lowmem_page_readonly(mfn_to_virt(gdt_mfn));
> + make_lowmem_page_readonly(gfn_to_virt(gdt_mfn));
>
> ctxt->gdt_frames[0] = gdt_mfn;
> ctxt->gdt_ents = GDT_ENTRIES;
> @@ -429,7 +429,7 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle)
> }
> #endif
> ctxt->user_regs.esp = idle->thread.sp0 - sizeof(struct pt_regs);
> - ctxt->ctrlreg[3] = xen_pfn_to_cr3(virt_to_mfn(swapper_pg_dir));
> + ctxt->ctrlreg[3] = xen_pfn_to_cr3(virt_to_gfn(swapper_pg_dir));
> if (HYPERVISOR_vcpu_op(VCPUOP_initialise, cpu, ctxt))
> BUG();
>
> diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c
> index 53b4c08..60624e7 100644
> --- a/arch/x86/xen/suspend.c
> +++ b/arch/x86/xen/suspend.c
> @@ -16,9 +16,9 @@ static void xen_pv_pre_suspend(void)
> {
> xen_mm_pin_all();
>
> - xen_start_info->store_mfn = mfn_to_pfn(xen_start_info->store_mfn);
> + xen_start_info->store_mfn = gfn_to_pfn(xen_start_info->store_mfn);
> xen_start_info->console.domU.mfn > - mfn_to_pfn(xen_start_info->console.domU.mfn);
> + gfn_to_pfn(xen_start_info->console.domU.mfn);
>
> BUG_ON(!irqs_disabled());
>
> @@ -51,9 +51,9 @@ static void xen_pv_post_suspend(int suspend_cancelled)
>
> if (suspend_cancelled) {
> xen_start_info->store_mfn > - pfn_to_mfn(xen_start_info->store_mfn);
> + pfn_to_gfn(xen_start_info->store_mfn);
> xen_start_info->console.domU.mfn > - pfn_to_mfn(xen_start_info->console.domU.mfn);
> + pfn_to_gfn(xen_start_info->console.domU.mfn);
> } else {
> #ifdef CONFIG_SMP
> BUG_ON(xen_cpu_initialized_map = NULL);
> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> index 6d89ed3..2e541a4 100644
> --- a/drivers/block/xen-blkfront.c
> +++ b/drivers/block/xen-blkfront.c
> @@ -247,7 +247,7 @@ static struct grant *get_grant(grant_ref_t *gref_head,
> struct blkfront_info *info)
> {
> struct grant *gnt_list_entry;
> - unsigned long buffer_mfn;
> + unsigned long buffer_gfn;
>
> BUG_ON(list_empty(&info->grants));
> gnt_list_entry = list_first_entry(&info->grants, struct grant,
> @@ -266,10 +266,10 @@ static struct grant *get_grant(grant_ref_t *gref_head,
> BUG_ON(!pfn);
> gnt_list_entry->pfn = pfn;
> }
> - buffer_mfn = pfn_to_mfn(gnt_list_entry->pfn);
> + buffer_gfn = pfn_to_gfn(gnt_list_entry->pfn);
> gnttab_grant_foreign_access_ref(gnt_list_entry->gref,
> info->xbdev->otherend_id,
> - buffer_mfn, 0);
> + buffer_gfn, 0);
> return gnt_list_entry;
> }
>
> diff --git a/drivers/input/misc/xen-kbdfront.c b/drivers/input/misc/xen-kbdfront.c
> index 95599e4..23d0549 100644
> --- a/drivers/input/misc/xen-kbdfront.c
> +++ b/drivers/input/misc/xen-kbdfront.c
> @@ -232,7 +232,7 @@ static int xenkbd_connect_backend(struct xenbus_device *dev,
> struct xenbus_transaction xbt;
>
> ret = gnttab_grant_foreign_access(dev->otherend_id,
> - virt_to_mfn(info->page), 0);
> + virt_to_gfn(info->page), 0);
> if (ret < 0)
> return ret;
> info->gref = ret;
> @@ -255,7 +255,7 @@ static int xenkbd_connect_backend(struct xenbus_device *dev,
> goto error_irqh;
> }
> ret = xenbus_printf(xbt, dev->nodename, "page-ref", "%lu",
> - virt_to_mfn(info->page));
> + virt_to_gfn(info->page));
> if (ret)
> goto error_xenbus;
> ret = xenbus_printf(xbt, dev->nodename, "page-gref", "%u", info->gref);
> diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
> index 7d50711..3b7b7c3 100644
> --- a/drivers/net/xen-netback/netback.c
> +++ b/drivers/net/xen-netback/netback.c
> @@ -314,7 +314,7 @@ static void xenvif_gop_frag_copy(struct xenvif_queue *queue, struct sk_buff *skb
> } else {
> copy_gop->source.domid = DOMID_SELF;
> copy_gop->source.u.gmfn > - virt_to_mfn(page_address(page));
> + virt_to_gfn(page_address(page));
> }
> copy_gop->source.offset = offset;
>
> @@ -1284,7 +1284,7 @@ static void xenvif_tx_build_gops(struct xenvif_queue *queue,
> queue->tx_copy_ops[*copy_ops].source.offset = txreq.offset;
>
> queue->tx_copy_ops[*copy_ops].dest.u.gmfn > - virt_to_mfn(skb->data);
> + virt_to_gfn(skb->data);
> queue->tx_copy_ops[*copy_ops].dest.domid = DOMID_SELF;
> queue->tx_copy_ops[*copy_ops].dest.offset > offset_in_page(skb->data);
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index f948c46..5cdab73 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -291,7 +291,7 @@ static void xennet_alloc_rx_buffers(struct netfront_queue *queue)
> struct sk_buff *skb;
> unsigned short id;
> grant_ref_t ref;
> - unsigned long pfn;
> + unsigned long gfn;
> struct xen_netif_rx_request *req;
>
> skb = xennet_alloc_one_rx_buffer(queue);
> @@ -307,12 +307,12 @@ static void xennet_alloc_rx_buffers(struct netfront_queue *queue)
> BUG_ON((signed short)ref < 0);
> queue->grant_rx_ref[id] = ref;
>
> - pfn = page_to_pfn(skb_frag_page(&skb_shinfo(skb)->frags[0]));
> + gfn = page_to_gfn(skb_frag_page(&skb_shinfo(skb)->frags[0]));
>
> req = RING_GET_REQUEST(&queue->rx, req_prod);
> gnttab_grant_foreign_access_ref(ref,
> queue->info->xbdev->otherend_id,
> - pfn_to_mfn(pfn),
> + gfn,
> 0);
>
> req->id = id;
> @@ -431,7 +431,7 @@ static struct xen_netif_tx_request *xennet_make_one_txreq(
> BUG_ON((signed short)ref < 0);
>
> gnttab_grant_foreign_access_ref(ref, queue->info->xbdev->otherend_id,
> - page_to_mfn(page), GNTMAP_readonly);
> + page_to_gfn(page), GNTMAP_readonly);
>
> queue->tx_skbs[id].skb = skb;
> queue->grant_tx_page[id] = page;
> diff --git a/drivers/scsi/xen-scsifront.c b/drivers/scsi/xen-scsifront.c
> index fad22ca..cdf00d1 100644
> --- a/drivers/scsi/xen-scsifront.c
> +++ b/drivers/scsi/xen-scsifront.c
> @@ -377,7 +377,6 @@ static int map_data_for_request(struct vscsifrnt_info *info,
> unsigned int data_len = scsi_bufflen(sc);
> unsigned int data_grants = 0, seg_grants = 0;
> struct scatterlist *sg;
> - unsigned long mfn;
> struct scsiif_request_segment *seg;
>
> ring_req->nr_segments = 0;
> @@ -420,9 +419,8 @@ static int map_data_for_request(struct vscsifrnt_info *info,
> ref = gnttab_claim_grant_reference(&gref_head);
> BUG_ON(ref = -ENOSPC);
>
> - mfn = pfn_to_mfn(page_to_pfn(page));
> gnttab_grant_foreign_access_ref(ref,
> - info->dev->otherend_id, mfn, 1);
> + info->dev->otherend_id, page_to_gfn(page), 1);
> shadow->gref[ref_cnt] = ref;
> ring_req->seg[ref_cnt].gref = ref;
> ring_req->seg[ref_cnt].offset = (uint16_t)off;
> @@ -454,9 +452,9 @@ static int map_data_for_request(struct vscsifrnt_info *info,
> ref = gnttab_claim_grant_reference(&gref_head);
> BUG_ON(ref = -ENOSPC);
>
> - mfn = pfn_to_mfn(page_to_pfn(page));
> gnttab_grant_foreign_access_ref(ref,
> - info->dev->otherend_id, mfn, grant_ro);
> + info->dev->otherend_id, page_to_gfn(page),
> + grant_ro);
>
> shadow->gref[ref_cnt] = ref;
> seg->gref = ref;
> diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
> index a9d837f..efe5124 100644
> --- a/drivers/tty/hvc/hvc_xen.c
> +++ b/drivers/tty/hvc/hvc_xen.c
> @@ -265,7 +265,8 @@ static int xen_pv_console_init(void)
> return 0;
> }
> info->evtchn = xen_start_info->console.domU.evtchn;
> - info->intf = mfn_to_virt(xen_start_info->console.domU.mfn);
> + /* GFN = MFN for PV guest */
> + info->intf = gfn_to_virt(xen_start_info->console.domU.mfn);
> info->vtermno = HVC_COOKIE;
>
> spin_lock(&xencons_lock);
> @@ -390,7 +391,7 @@ static int xencons_connect_backend(struct xenbus_device *dev,
> if (IS_ERR(info->hvc))
> return PTR_ERR(info->hvc);
> if (xen_pv_domain())
> - mfn = virt_to_mfn(info->intf);
> + mfn = virt_to_gfn(info->intf);
> else
> mfn = __pa(info->intf) >> PAGE_SHIFT;
> ret = gnttab_alloc_grant_references(1, &gref_head);
> diff --git a/drivers/video/fbdev/xen-fbfront.c b/drivers/video/fbdev/xen-fbfront.c
> index 09dc447..25e3cce 100644
> --- a/drivers/video/fbdev/xen-fbfront.c
> +++ b/drivers/video/fbdev/xen-fbfront.c
> @@ -539,7 +539,7 @@ static int xenfb_remove(struct xenbus_device *dev)
>
> static unsigned long vmalloc_to_mfn(void *address)
> {
> - return pfn_to_mfn(vmalloc_to_pfn(address));
> + return pfn_to_gfn(vmalloc_to_pfn(address));
> }
>
> static void xenfb_init_shared_page(struct xenfb_info *info,
> @@ -586,7 +586,7 @@ static int xenfb_connect_backend(struct xenbus_device *dev,
> goto unbind_irq;
> }
> ret = xenbus_printf(xbt, dev->nodename, "page-ref", "%lu",
> - virt_to_mfn(info->page));
> + virt_to_gfn(info->page));
> if (ret)
> goto error_xenbus;
> ret = xenbus_printf(xbt, dev->nodename, "event-channel", "%u",
> diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
> index fd93369..9734649 100644
> --- a/drivers/xen/balloon.c
> +++ b/drivers/xen/balloon.c
> @@ -441,7 +441,7 @@ static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp)
> /* Update direct mapping, invalidate P2M, and add to balloon. */
> for (i = 0; i < nr_pages; i++) {
> pfn = frame_list[i];
> - frame_list[i] = pfn_to_mfn(pfn);
> + frame_list[i] = pfn_to_gfn(pfn);
> page = pfn_to_page(pfn);
>
> #ifdef CONFIG_XEN_HAVE_PVMMU
> diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
> index 96093ae..95a4fdb 100644
> --- a/drivers/xen/events/events_base.c
> +++ b/drivers/xen/events/events_base.c
> @@ -1692,7 +1692,7 @@ void __init xen_init_IRQ(void)
> struct physdev_pirq_eoi_gmfn eoi_gmfn;
>
> pirq_eoi_map = (void *)__get_free_page(GFP_KERNEL|__GFP_ZERO);
> - eoi_gmfn.gmfn = virt_to_mfn(pirq_eoi_map);
> + eoi_gmfn.gmfn = virt_to_gfn(pirq_eoi_map);
> rc = HYPERVISOR_physdev_op(PHYSDEVOP_pirq_eoi_gmfn_v2, &eoi_gmfn);
> /* TODO: No PVH support for PIRQ EOI */
> if (rc != 0) {
> diff --git a/drivers/xen/events/events_fifo.c b/drivers/xen/events/events_fifo.c
> index ed673e1..1d4baf5 100644
> --- a/drivers/xen/events/events_fifo.c
> +++ b/drivers/xen/events/events_fifo.c
> @@ -111,7 +111,7 @@ static int init_control_block(int cpu,
> for (i = 0; i < EVTCHN_FIFO_MAX_QUEUES; i++)
> q->head[i] = 0;
>
> - init_control.control_gfn = virt_to_mfn(control_block);
> + init_control.control_gfn = virt_to_gfn(control_block);
> init_control.offset = 0;
> init_control.vcpu = cpu;
>
> @@ -167,7 +167,7 @@ static int evtchn_fifo_setup(struct irq_info *info)
> /* Mask all events in this page before adding it. */
> init_array_page(array_page);
>
> - expand_array.array_gfn = virt_to_mfn(array_page);
> + expand_array.array_gfn = virt_to_gfn(array_page);
>
> ret = HYPERVISOR_event_channel_op(EVTCHNOP_expand_array, &expand_array);
> if (ret < 0)
> diff --git a/drivers/xen/gntalloc.c b/drivers/xen/gntalloc.c
> index e53fe19..13e1458 100644
> --- a/drivers/xen/gntalloc.c
> +++ b/drivers/xen/gntalloc.c
> @@ -142,7 +142,8 @@ static int add_grefs(struct ioctl_gntalloc_alloc_gref *op,
>
> /* Grant foreign access to the page. */
> rc = gnttab_grant_foreign_access(op->domid,
> - pfn_to_mfn(page_to_pfn(gref->page)), readonly);
> + page_to_gfn(gref->page),
> + readonly);
> if (rc < 0)
> goto undo;
> gref_ids[i] = gref->gref_id = rc;
> diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
> index d10effe..e12bd36 100644
> --- a/drivers/xen/manage.c
> +++ b/drivers/xen/manage.c
> @@ -80,7 +80,7 @@ static int xen_suspend(void *data)
> * is resuming in a new domain.
> */
> si->cancelled = HYPERVISOR_suspend(xen_pv_domain()
> - ? virt_to_mfn(xen_start_info)
> + ? virt_to_gfn(xen_start_info)
> : 0);
>
> xen_arch_post_suspend(si->cancelled);
> diff --git a/drivers/xen/tmem.c b/drivers/xen/tmem.c
> index 239738f..28c97ff 100644
> --- a/drivers/xen/tmem.c
> +++ b/drivers/xen/tmem.c
> @@ -131,7 +131,7 @@ static int xen_tmem_new_pool(struct tmem_pool_uuid uuid,
> static int xen_tmem_put_page(u32 pool_id, struct tmem_oid oid,
> u32 index, unsigned long pfn)
> {
> - unsigned long gmfn = xen_pv_domain() ? pfn_to_mfn(pfn) : pfn;
> + unsigned long gmfn = pfn_to_gfn(pfn);
>
> return xen_tmem_op(TMEM_PUT_PAGE, pool_id, oid, index,
> gmfn, 0, 0, 0);
> @@ -140,7 +140,7 @@ static int xen_tmem_put_page(u32 pool_id, struct tmem_oid oid,
> static int xen_tmem_get_page(u32 pool_id, struct tmem_oid oid,
> u32 index, unsigned long pfn)
> {
> - unsigned long gmfn = xen_pv_domain() ? pfn_to_mfn(pfn) : pfn;
> + unsigned long gmfn = pfn_to_gfn(pfn);
>
> return xen_tmem_op(TMEM_GET_PAGE, pool_id, oid, index,
> gmfn, 0, 0, 0);
> diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c
> index 9ad3272..daa267a 100644
> --- a/drivers/xen/xenbus/xenbus_client.c
> +++ b/drivers/xen/xenbus/xenbus_client.c
> @@ -380,7 +380,7 @@ int xenbus_grant_ring(struct xenbus_device *dev, void *vaddr,
>
> for (i = 0; i < nr_pages; i++) {
> err = gnttab_grant_foreign_access(dev->otherend_id,
> - virt_to_mfn(vaddr), 0);
> + virt_to_gfn(vaddr), 0);
> if (err < 0) {
> xenbus_dev_fatal(dev, err,
> "granting access to ring page");
> diff --git a/drivers/xen/xenbus/xenbus_dev_backend.c b/drivers/xen/xenbus/xenbus_dev_backend.c
> index b17707e..ee6d9ef 100644
> --- a/drivers/xen/xenbus/xenbus_dev_backend.c
> +++ b/drivers/xen/xenbus/xenbus_dev_backend.c
> @@ -49,7 +49,7 @@ static long xenbus_alloc(domid_t domid)
> goto out_err;
>
> gnttab_grant_foreign_access_ref(GNTTAB_RESERVED_XENSTORE, domid,
> - virt_to_mfn(xen_store_interface), 0 /* writable */);
> + virt_to_gfn(xen_store_interface), 0 /* writable */);
>
> arg.dom = DOMID_SELF;
> arg.remote_dom = domid;
> diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
> index 4308fb3..31836897 100644
> --- a/drivers/xen/xenbus/xenbus_probe.c
> +++ b/drivers/xen/xenbus/xenbus_probe.c
> @@ -711,9 +711,7 @@ static int __init xenstored_local_init(void)
> if (!page)
> goto out_err;
>
> - xen_store_mfn = xen_start_info->store_mfn > - pfn_to_mfn(virt_to_phys((void *)page) >>
> - PAGE_SHIFT);
> + xen_store_mfn = xen_start_info->store_mfn = virt_to_gfn(page);
>
> /* Next allocate a local port which xenstored can bind to */
> alloc_unbound.dom = DOMID_SELF;
> @@ -787,12 +785,12 @@ static int __init xenbus_init(void)
> err = xenstored_local_init();
> if (err)
> goto out_error;
> - xen_store_interface = mfn_to_virt(xen_store_mfn);
> + xen_store_interface = gfn_to_virt(xen_store_mfn);
> break;
> case XS_PV:
> xen_store_evtchn = xen_start_info->store_evtchn;
> xen_store_mfn = xen_start_info->store_mfn;
> - xen_store_interface = mfn_to_virt(xen_store_mfn);
> + xen_store_interface = gfn_to_virt(xen_store_mfn);
> break;
> case XS_HVM:
> err = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN, &v);
> diff --git a/include/xen/page.h b/include/xen/page.h
> index c5ed20b..e7e1425 100644
> --- a/include/xen/page.h
> +++ b/include/xen/page.h
> @@ -3,9 +3,9 @@
>
> #include <asm/xen/page.h>
>
> -static inline unsigned long page_to_mfn(struct page *page)
> +static inline unsigned long page_to_gfn(struct page *page)
> {
> - return pfn_to_mfn(page_to_pfn(page));
> + return pfn_to_gfn(page_to_pfn(page));
> }
>
> struct xen_memory_region {
> --
> 2.1.4
>
^ permalink raw reply
* Klientskie bazi tel +79133913837 Email: nonen22pp@gmail.com Yznaite podrobnee!!!
From: linux-fbdev @ 2015-07-30 21:34 UTC (permalink / raw)
To: linux-fbdev
Klientskie bazi tel +79133913837 Email: nonen22pp@gmail.com Yznaite podrobnee!!!
^ permalink raw reply
* [PATCH v2] pwm-backlight: Avoid backlight flicker when probed from DT
From: Philipp Zabel @ 2015-07-30 17:22 UTC (permalink / raw)
To: Thierry Reding
Cc: Jingoo Han, Lee Jones, Ajay Kumar, linux-pwm, linux-fbdev,
linux-kernel, kernel, 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>
---
Changes since v1:
- Also check if the regulator is enabled. If the power supply is disabled,
and a phandle points to it, the backlight should stay powered down.
---
drivers/video/backlight/pwm_bl.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index eff379b..31afd6d 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -199,6 +199,8 @@ 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;
+ bool phandle;
int ret;
if (!data) {
@@ -264,12 +266,32 @@ static int pwm_backlight_probe(struct platform_device *pdev)
pb->enable_gpio = gpio_to_desc(data->enable_gpio);
}
+ phandle = of_find_property(pdev->dev.of_node, "phandle", NULL) != NULL;
+
+ 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 (phandle &&
+ 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)) {
ret = PTR_ERR(pb->power_supply);
goto err_alloc;
}
+ if (phandle && !regulator_is_enabled(pb->power_supply))
+ initial_blank = FB_BLANK_POWERDOWN;
+
pb->pwm = devm_pwm_get(&pdev->dev, NULL);
if (IS_ERR(pb->pwm)) {
ret = PTR_ERR(pb->pwm);
@@ -321,6 +343,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);
--
2.1.4
^ permalink raw reply related
* Re: [PATCH 00/27] Export I2C and OF module aliases in missing drivers
From: Javier Martinez Canillas @ 2015-07-30 17:13 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-kernel, alsa-devel, Mark Brown, linux-iio, linux-fbdev,
linux-i2c, linux-leds, Alexandre Belloni, Chanwoo Choi,
Tomi Valkeinen, lm-sensors, Sebastian Reichel, linux-input,
Greg Kroah-Hartman, Jean Delvare, Jonathan Cameron, linux-media,
rtc-linux, linux-pm, Mauro Carvalho Chehab, Guenter Roeck,
Benjamin Herrenschmidt, Wolfram Sang, Takashi Iwai, Liam Girdwood,
Sjoe
In-Reply-To: <20150730163708.GB13165@dtor-ws>
Hello Dmitry,
Thanks a lot for your feedback.
On 07/30/2015 06:37 PM, Dmitry Torokhov wrote:
> On Thu, Jul 30, 2015 at 09:35:17AM -0700, Dmitry Torokhov wrote:
>> Hi Javier,
>>
>> On Thu, Jul 30, 2015 at 06:18:25PM +0200, Javier Martinez Canillas wrote:
>>> Hello,
>>>
>>> Short version:
>>>
>>> This series add the missing MODULE_DEVICE_TABLE() for OF and I2C tables
>>> to export that information so modules have the correct aliases built-in
>>> and autoloading works correctly.
>>>
>>> Longer version:
>>>
>>> Currently it's mandatory for I2C drivers to have an I2C device ID table
>>> regardless if the device was registered using platform data or OF. This
>>> is because the I2C core needs an I2C device ID table for two reasons:
>>>
>>> 1) Match the I2C client with a I2C device ID so a struct i2c_device_id
>>> is passed to the I2C driver probe() function.
>>>
>>> 2) Export the module aliases from the I2C device ID table so userspace
>>> can auto-load the correct module. This is because i2c_device_uevent
>>> always reports a MODALIAS of the form i2c:<client->name>.
>>
>> Why are we not fixing this? We emit specially carved uevent for
>> ACPI-based devices, why not the same for OF? Platform bus does this...
>
> Ah, now I see the 27/27 patch. I think it is exactly what we need. And
Yes, patch 27/27 is needed but the problem is as I explained before that
there are drivers relying on the current behavior. The item c) in the list
of issues that I mentioned. So those drivers need to be fixed before that
patch is merged...
> probably for SPI bus as well.
>
Yes, I didn't mention SPI because the cover letter became too long
already but it does indeed have the same issue and I discussed this
with Mark already some time ago [0].
Once I2C uevent report is fixed, I plan to do the same for SPI.
> Thanks.
>
[0]: https://lkml.org/lkml/2014/9/11/458
Best regards,
--
Javier Martinez Canillas
Open Source Group
Samsung Research America
^ permalink raw reply
* [PATCH v3 18/24] fbdev: switch from ioremap_wt to memremap
From: Dan Williams @ 2015-07-30 16:55 UTC (permalink / raw)
To: tglx, mingo, hpa
Cc: linux-arch, linux-fbdev, toshi.kani, linux-nvdimm, mcgrof,
linux-kernel, Tomi Valkeinen, rmk+kernel,
Jean-Christophe Plagniol-Villard, hch, linux-arm-kernel
In-Reply-To: <20150730165155.33962.64121.stgit@dwillia2-desk3.amr.corp.intel.com>
In preparation for deprecating ioremap_wt() convert its usage in
drivers/video/fbdev to memremap.
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: linux-fbdev@vger.kernel.org
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
drivers/video/fbdev/amifb.c | 5 +++--
drivers/video/fbdev/atafb.c | 5 +++--
drivers/video/fbdev/hpfb.c | 6 +++---
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/video/fbdev/amifb.c b/drivers/video/fbdev/amifb.c
index 1d702e13aaff..0cde451046d0 100644
--- a/drivers/video/fbdev/amifb.c
+++ b/drivers/video/fbdev/amifb.c
@@ -52,6 +52,7 @@
#include <linux/ioport.h>
#include <linux/platform_device.h>
#include <linux/uaccess.h>
+#include <linux/io.h>
#include <asm/irq.h>
#include <asm/amigahw.h>
@@ -3705,8 +3706,8 @@ default_chipset:
* access the videomem with writethrough cache
*/
info->fix.smem_start = (u_long)ZTWO_PADDR(videomemory);
- videomemory = (u_long)ioremap_wt(info->fix.smem_start,
- info->fix.smem_len);
+ videomemory = (u_long)memremap(info->fix.smem_start, info->fix.smem_len,
+ MEMREMAP_WT);
if (!videomemory) {
dev_warn(&pdev->dev,
"Unable to map videomem cached writethrough\n");
diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c
index d6ce613e12ad..5615e8c31ea2 100644
--- a/drivers/video/fbdev/atafb.c
+++ b/drivers/video/fbdev/atafb.c
@@ -55,12 +55,12 @@
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/interrupt.h>
+#include <linux/io.h>
#include <asm/setup.h>
#include <linux/uaccess.h>
#include <asm/pgtable.h>
#include <asm/irq.h>
-#include <asm/io.h>
#include <asm/atarihw.h>
#include <asm/atariints.h>
@@ -3185,7 +3185,8 @@ int __init atafb_init(void)
/* Map the video memory (physical address given) to somewhere
* in the kernel address space.
*/
- external_screen_base = ioremap_wt(external_addr, external_len);
+ external_screen_base = memremap(external_addr, external_len,
+ MEMREMAP_WT);
if (external_vgaiobase)
external_vgaiobase (unsigned long)ioremap(external_vgaiobase, 0x10000);
diff --git a/drivers/video/fbdev/hpfb.c b/drivers/video/fbdev/hpfb.c
index 9476d196f510..d08c320b06fc 100644
--- a/drivers/video/fbdev/hpfb.c
+++ b/drivers/video/fbdev/hpfb.c
@@ -14,8 +14,8 @@
#include <linux/init.h>
#include <linux/fb.h>
#include <linux/dio.h>
+#include <linux/io.h>
-#include <asm/io.h>
#include <asm/uaccess.h>
static struct fb_info fb_info = {
@@ -241,8 +241,8 @@ static int hpfb_init_one(unsigned long phys_base, unsigned long virt_base)
fb_info.fix.line_length = fb_width;
fb_height = (in_8(fb_regs + HPFB_FBHMSB) << 8) | in_8(fb_regs + HPFB_FBHLSB);
fb_info.fix.smem_len = fb_width * fb_height;
- fb_start = (unsigned long)ioremap_wt(fb_info.fix.smem_start,
- fb_info.fix.smem_len);
+ fb_start = (unsigned long) memremap(fb_info.fix.smem_start,
+ fb_info.fix.smem_len, MEMREMAP_WT);
hpfb_defined.xres = (in_8(fb_regs + HPFB_DWMSB) << 8) | in_8(fb_regs + HPFB_DWLSB);
hpfb_defined.yres = (in_8(fb_regs + HPFB_DHMSB) << 8) | in_8(fb_regs + HPFB_DHLSB);
hpfb_defined.xres_virtual = hpfb_defined.xres;
^ permalink raw reply related
* [PATCH v3 00/24] replace ioremap_{cache|wt} with memremap
From: Dan Williams @ 2015-07-30 16:53 UTC (permalink / raw)
To: tglx, mingo, hpa
Cc: linux-fbdev, David Airlie, dri-devel, Lv Zheng, Daniel Vetter,
Benjamin Romer, hch, linux-arch, linux-nvdimm, Joerg Roedel,
Rafael J. Wysocki, Bob Moore, Mike Waychison, Tomi Valkeinen,
rmk+kernel, Ross Zwisler, David Kershner,
Jean-Christophe Plagniol-Villard, mcgrof, Len Brown, Joerg Roedel,
Arnd Bergmann, intel-gfx, Borislav Petkov, Ingo Molnar,
linux-arm-kernel
Changes since v2 [1]:
1/ Move arch_memremap() and arch_memunmap() out of line (Christoph)
2/ Convert region_is_ram() to region_intersects() and define an enum for
its 3 return values. (Luis)
3/ Fix gma500 and i915 to explicitly use cached mappings and clean up
the __iomem usage. (Daniel)
4/ Kill unused ioremap aliases (ioremap_cached() and
ioremap_fullcache()) (Christoph)
5/ Clarify some change logs and documentation (Luis, Christoph, and
Ross)
6/ Add a unified CONFIG_MMU=n implementation with __weak symbols. (Luis)
---
While developing the pmem driver we noticed that the __iomem annotation
on the return value from ioremap_cache() was being mishandled by several
callers. We also observed that all of the call sites expected to be
able to treat the return value from ioremap_cache() as normal
(non-__iomem) pointer to memory.
This patchset takes the opportunity to clean up the above confusion as
well as a few issues with the ioremap_{cache|wt} interface, including:
1/ Eliminating the possibility of function prototypes differing between
architectures by defining a central memremap() prototype that takes
flags to determine the mapping type.
2/ Returning NULL rather than falling back silently to a different
mapping-type. This allows drivers to be stricter about the
mapping-type fallbacks that are permissible.
[1]: http://marc.info/?l=linux-arch&m\x143779222217405&w=2
---
Dan Williams (24):
mm: enhance region_is_ram() to region_intersects()
arch, drivers: don't include <asm/io.h> directly, use <linux/io.h> instead
cleanup IORESOURCE_CACHEABLE vs ioremap()
intel_iommu: fix leaked ioremap mapping
arch: introduce memremap()
arm: switch from ioremap_cache to memremap
x86: switch from ioremap_cache to memremap
gma500: switch from acpi_os_ioremap to memremap
i915: switch from acpi_os_ioremap to memremap
acpi: switch from ioremap_cache to memremap
toshiba laptop: replace ioremap_cache with ioremap
memconsole: fix __iomem mishandling, switch to memremap
visorbus: switch from ioremap_cache to memremap
intel-iommu: switch from ioremap_cache to memremap
libnvdimm, pmem: push call to ioremap_cache out of line
pxa2xx-flash: switch from ioremap_cache to memremap
sfi: switch from ioremap_cache to memremap
fbdev: switch from ioremap_wt to memremap
pmem: switch from ioremap_wt to memremap
arch: kill ioremap_cached()
arch: kill ioremap_fullcache()
arch: remove ioremap_cache, replace with arch_memremap
arch: remove ioremap_wt, optionally replace with arch_memremap
pmem: convert to generic memremap
Documentation/x86/pat.txt | 6 +
arch/arc/include/asm/io.h | 1
arch/arm/Kconfig | 1
arch/arm/include/asm/io.h | 7 --
arch/arm/include/asm/xen/page.h | 4 -
arch/arm/mach-clps711x/board-cdb89712.c | 2
arch/arm/mach-shmobile/pm-rcar.c | 2
arch/arm/mm/ioremap.c | 18 +++-
arch/arm/mm/mmu.c | 2
arch/arm/mm/nommu.c | 11 ++
arch/arm64/Kconfig | 1
arch/arm64/include/asm/acpi.h | 11 --
arch/arm64/include/asm/dmi.h | 8 +-
arch/arm64/include/asm/io.h | 2
arch/arm64/kernel/efi.c | 9 +-
arch/arm64/kernel/smp_spin_table.c | 19 ++--
arch/arm64/mm/ioremap.c | 20 ++--
arch/avr32/include/asm/io.h | 1
arch/frv/include/asm/io.h | 12 ---
arch/ia64/Kconfig | 1
arch/ia64/include/asm/io.h | 5 -
arch/ia64/kernel/cyclone.c | 2
arch/ia64/mm/ioremap.c | 16 +++
arch/m32r/include/asm/io.h | 1
arch/m68k/Kconfig | 1
arch/m68k/include/asm/io_mm.h | 12 ---
arch/m68k/include/asm/io_no.h | 11 --
arch/m68k/include/asm/raw_io.h | 1
arch/m68k/mm/kmap.c | 17 +++-
arch/m68k/mm/sun3kmap.c | 6 +
arch/metag/include/asm/io.h | 6 -
arch/microblaze/include/asm/io.h | 2
arch/mn10300/include/asm/io.h | 1
arch/nios2/include/asm/io.h | 1
arch/powerpc/kernel/pci_of_scan.c | 2
arch/s390/include/asm/io.h | 1
arch/sh/Kconfig | 1
arch/sh/include/asm/io.h | 6 -
arch/sh/mm/ioremap.c | 15 +++
arch/sparc/include/asm/io_32.h | 1
arch/sparc/include/asm/io_64.h | 1
arch/sparc/kernel/pci.c | 3 -
arch/tile/include/asm/io.h | 2
arch/unicore32/include/asm/io.h | 4 -
arch/unicore32/mm/ioremap.c | 8 --
arch/x86/Kconfig | 1
arch/x86/include/asm/efi.h | 3 -
arch/x86/include/asm/io.h | 11 --
arch/x86/kernel/crash_dump_64.c | 6 +
arch/x86/kernel/kdebugfs.c | 8 +-
arch/x86/kernel/ksysfs.c | 28 +++---
arch/x86/mm/ioremap.c | 59 +++++++------
arch/xtensa/include/asm/io.h | 11 --
drivers/acpi/apei/einj.c | 9 +-
drivers/acpi/apei/erst.c | 6 +
drivers/acpi/nvs.c | 6 +
drivers/acpi/osl.c | 70 ++++-----------
drivers/char/toshiba.c | 2
drivers/firmware/google/memconsole.c | 7 +-
drivers/gpu/drm/gma500/opregion.c | 8 +-
drivers/gpu/drm/gma500/psb_drv.h | 2
drivers/gpu/drm/gma500/psb_lid.c | 8 +-
drivers/gpu/drm/i915/i915_debugfs.c | 2
drivers/gpu/drm/i915/i915_drv.h | 12 +--
drivers/gpu/drm/i915/intel_bios.c | 7 +-
drivers/gpu/drm/i915/intel_opregion.c | 87 +++++++++----------
drivers/gpu/drm/i915/intel_panel.c | 2
drivers/iommu/intel-iommu.c | 10 +-
drivers/iommu/intel_irq_remapping.c | 4 +
drivers/isdn/icn/icn.h | 2
drivers/mtd/devices/slram.c | 2
drivers/mtd/maps/pxa2xx-flash.c | 4 -
drivers/mtd/nand/diskonchip.c | 2
drivers/mtd/onenand/generic.c | 2
drivers/nvdimm/Kconfig | 2
drivers/pci/probe.c | 3 -
drivers/pnp/manager.c | 2
drivers/scsi/aic94xx/aic94xx_init.c | 7 --
drivers/scsi/arcmsr/arcmsr_hba.c | 5 -
drivers/scsi/mvsas/mv_init.c | 15 +--
drivers/scsi/sun3x_esp.c | 2
drivers/sfi/sfi_core.c | 4 -
drivers/staging/comedi/drivers/ii_pci20kc.c | 1
drivers/staging/unisys/visorbus/visorchannel.c | 16 ++-
drivers/staging/unisys/visorbus/visorchipset.c | 17 ++--
drivers/tty/serial/8250/8250_core.c | 2
drivers/video/fbdev/Kconfig | 2
drivers/video/fbdev/amifb.c | 5 +
drivers/video/fbdev/atafb.c | 5 +
drivers/video/fbdev/hpfb.c | 6 +
drivers/video/fbdev/ocfb.c | 1
drivers/video/fbdev/s1d13xxxfb.c | 3 -
drivers/video/fbdev/stifb.c | 1
include/acpi/acpi_io.h | 6 -
include/asm-generic/io.h | 8 --
include/asm-generic/iomap.h | 4 -
include/linux/io-mapping.h | 2
include/linux/io.h | 11 ++
include/linux/mm.h | 9 ++
include/linux/mtd/map.h | 2
include/linux/pmem.h | 26 +++---
include/video/vga.h | 2
kernel/Makefile | 2
kernel/memremap.c | 110 ++++++++++++++++++++++++
kernel/resource.c | 61 ++++++++-----
lib/Kconfig | 5 +
lib/devres.c | 13 +--
lib/pci_iomap.c | 7 --
tools/testing/nvdimm/Kbuild | 4 -
tools/testing/nvdimm/test/iomap.c | 34 +++++--
110 files changed, 553 insertions(+), 497 deletions(-)
create mode 100644 kernel/memremap.c
^ permalink raw reply
* Re: [PATCH] backlight: pm8941-wled: Add default-brightness property
From: Bjorn Andersson @ 2015-07-30 16:44 UTC (permalink / raw)
To: Rob Herring
Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Jingoo Han,
Lee Jones, Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
Rob Clark, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org,
linux-arm-msm
In-Reply-To: <CAL_JsqJYxDROqbv-wh37=MjwbsEtrYKFTvC1NfneonLH2_gL2A@mail.gmail.com>
On Thu 30 Jul 08:26 PDT 2015, Rob Herring wrote:
> On Wed, Jul 29, 2015 at 6:51 PM, Bjorn Andersson
> <bjorn.andersson@sonymobile.com> wrote:
> > On Fri 24 Jul 08:29 PDT 2015, Rob Herring wrote:
[..]
> > As we're trying to specify a default brightness within the range [0,
> > max_brightness) the latter doesn't make much sense.
> >
> > Therefor my suggestion is that we make the "default-brightness" the
> > common property and we define it as a percentage of [0,max_brightness).
>
> Okay.
>
> I wonder if we should have units such as
> "default-brightness-percentage" or "default-brightness-%" so it is
> clear. Otherwise, we might have some people doing a range of [0,max].
> The former is a bit long and the latter is a bit unusual.
>
I discussed this further with my colleague and gave it some though over
the night;
If the boot loader sets the brightness, it would need to convert this to
a percentage just to have the kernel convert it back - with a expected
lack of precision (especially w/ non-linear brightness ranges or odd
step-sizes).
In the case where it's manually tweaked by the developer he/she would
most likely modify the brightness through sysfs until a reasonable value
is found; and we have that extra step again of converting this to a
percentage.
Therefor I think it's better to just specify this in "units of
brightness" - which would be a unit-less property.
Regards,
Bjorn
^ permalink raw reply
* Re: [PATCH 00/27] Export I2C and OF module aliases in missing drivers
From: Dmitry Torokhov @ 2015-07-30 16:37 UTC (permalink / raw)
To: Javier Martinez Canillas
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, Mark Brown,
linux-iio-u79uwXL29TY76Z2rM5mHXA,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux-leds-u79uwXL29TY76Z2rM5mHXA, Alexandre Belloni,
Chanwoo Choi, Tomi Valkeinen, lm-sensors-GZX6beZjE8VD60Wz+7aTrA,
Sebastian Reichel, linux-input-u79uwXL29TY76Z2rM5mHXA,
Greg Kroah-Hartman, Jean Delvare, Jonathan Cameron,
linux-media-u79uwXL29TY76Z2rM5mHXA,
rtc-linux-/JYPxA39Uh5TLH3MbocFFw, linux-pm-u79uwXL29TY76Z2rM5mHXA,
Mauro Carvalho Chehab, Guenter Roeck, Benjamin Herrenschmidt,
Wolfram Sang, Takashi Iwai, Liam Girdwood, Sjoe
In-Reply-To: <20150730163517.GA13165@dtor-ws>
On Thu, Jul 30, 2015 at 09:35:17AM -0700, Dmitry Torokhov wrote:
> Hi Javier,
>
> On Thu, Jul 30, 2015 at 06:18:25PM +0200, Javier Martinez Canillas wrote:
> > Hello,
> >
> > Short version:
> >
> > This series add the missing MODULE_DEVICE_TABLE() for OF and I2C tables
> > to export that information so modules have the correct aliases built-in
> > and autoloading works correctly.
> >
> > Longer version:
> >
> > Currently it's mandatory for I2C drivers to have an I2C device ID table
> > regardless if the device was registered using platform data or OF. This
> > is because the I2C core needs an I2C device ID table for two reasons:
> >
> > 1) Match the I2C client with a I2C device ID so a struct i2c_device_id
> > is passed to the I2C driver probe() function.
> >
> > 2) Export the module aliases from the I2C device ID table so userspace
> > can auto-load the correct module. This is because i2c_device_uevent
> > always reports a MODALIAS of the form i2c:<client->name>.
>
> Why are we not fixing this? We emit specially carved uevent for
> ACPI-based devices, why not the same for OF? Platform bus does this...
Ah, now I see the 27/27 patch. I think it is exactly what we need. And
probably for SPI bus as well.
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH 00/27] Export I2C and OF module aliases in missing drivers
From: Dmitry Torokhov @ 2015-07-30 16:35 UTC (permalink / raw)
To: Javier Martinez Canillas
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, Mark Brown,
linux-iio-u79uwXL29TY76Z2rM5mHXA,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux-leds-u79uwXL29TY76Z2rM5mHXA, Alexandre Belloni,
Chanwoo Choi, Tomi Valkeinen, lm-sensors-GZX6beZjE8VD60Wz+7aTrA,
Sebastian Reichel, linux-input-u79uwXL29TY76Z2rM5mHXA,
Greg Kroah-Hartman, Jean Delvare, Jonathan Cameron,
linux-media-u79uwXL29TY76Z2rM5mHXA,
rtc-linux-/JYPxA39Uh5TLH3MbocFFw, linux-pm-u79uwXL29TY76Z2rM5mHXA,
Mauro Carvalho Chehab, Guenter Roeck, Benjamin Herrenschmidt,
Wolfram Sang, Takashi Iwai, Liam Girdwood, Sjoe
In-Reply-To: <1438273132-20926-1-git-send-email-javier-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
Hi Javier,
On Thu, Jul 30, 2015 at 06:18:25PM +0200, Javier Martinez Canillas wrote:
> Hello,
>
> Short version:
>
> This series add the missing MODULE_DEVICE_TABLE() for OF and I2C tables
> to export that information so modules have the correct aliases built-in
> and autoloading works correctly.
>
> Longer version:
>
> Currently it's mandatory for I2C drivers to have an I2C device ID table
> regardless if the device was registered using platform data or OF. This
> is because the I2C core needs an I2C device ID table for two reasons:
>
> 1) Match the I2C client with a I2C device ID so a struct i2c_device_id
> is passed to the I2C driver probe() function.
>
> 2) Export the module aliases from the I2C device ID table so userspace
> can auto-load the correct module. This is because i2c_device_uevent
> always reports a MODALIAS of the form i2c:<client->name>.
Why are we not fixing this? We emit specially carved uevent for
ACPI-based devices, why not the same for OF? Platform bus does this...
Thanks.
--
Dmitry
^ permalink raw reply
* [PATCH 27/27] i2c: (RFC, don't apply) report OF style modalias when probing using DT
From: Javier Martinez Canillas @ 2015-07-30 16:18 UTC (permalink / raw)
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: Javier Martinez Canillas, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
Mark Brown, linux-iio-u79uwXL29TY76Z2rM5mHXA,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux-leds-u79uwXL29TY76Z2rM5mHXA, Sebastian Reichel,
Chanwoo Choi, Tomi Valkeinen, lm-sensors-GZX6beZjE8VD60Wz+7aTrA,
Alexandre Belloni, linux-input-u79uwXL29TY76Z2rM5mHXA,
Greg Kroah-Hartman, Jean Delvare, Jonathan Cameron,
linux-media-u79uwXL29TY76Z2rM5mHXA,
rtc-linux-/JYPxA39Uh5TLH3MbocFFw, linux-pm-u79uwXL29TY76Z2rM5mHXA,
Mauro Carvalho Chehab, Guenter Roeck, Benjamin Herrenschmidt,
Wolfram Sang, Takashi Iwai, Liam Girdwood <lgird>
In-Reply-To: <1438273132-20926-1-git-send-email-javier-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
An I2C driver that supports both OF and legacy platforms, will have
both a OF and I2C ID table. This means that when built as a module,
the aliases will be filled from both tables but currently always an
alias of the form i2c:<deviceId> is reported, e.g:
$ cat /sys/class/i2c-adapter/i2c-8/8-004b/modalias
i2c:maxtouch
So if a device is probed by matching its compatible string, udev can
get a MODALIAS uevent env var that doesn't match with one of the valid
aliases so the module won't be auto-loaded.
This patch changes the I2C core to report a OF related MODALIAS uevent
(of:N*T*C) env var instead so the module can be auto-loaded and also
report the correct alias using sysfs:
$ cat /sys/class/i2c-adapter/i2c-8/8-004b/modalias
of:NtrackpadT<NULL>Catmel,maxtouch
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
drivers/i2c/i2c-core.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 92dddfeb3f39..c0668c2ed9da 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -489,6 +489,10 @@ static int i2c_device_uevent(struct device *dev, struct kobj_uevent_env *env)
struct i2c_client *client = to_i2c_client(dev);
int rc;
+ rc = of_device_uevent_modalias(dev, env);
+ if (rc != -ENODEV)
+ return rc;
+
rc = acpi_device_uevent_modalias(dev, env);
if (rc != -ENODEV)
return rc;
@@ -726,6 +730,10 @@ show_modalias(struct device *dev, struct device_attribute *attr, char *buf)
struct i2c_client *client = to_i2c_client(dev);
int len;
+ len = of_device_get_modalias(dev, buf, PAGE_SIZE - 1);
+ if (len != -ENODEV)
+ return len;
+
len = acpi_device_modalias(dev, buf, PAGE_SIZE -1);
if (len != -ENODEV)
return len;
--
2.4.3
^ permalink raw reply related
* [PATCH 10/27] backlight: tosa: Export I2C module alias information
From: Javier Martinez Canillas @ 2015-07-30 16:18 UTC (permalink / raw)
To: linux-kernel; +Cc: Javier Martinez Canillas, linux-fbdev, Tomi Valkeinen
In-Reply-To: <1438273132-20926-1-git-send-email-javier@osg.samsung.com>
The I2C core always reports the MODALIAS uevent as "i2c:<client name"
regardless if the driver was matched using the I2C id_table or the
of_match_table. So the driver needs to export the I2C table and this
be built into the module or udev won't have the necessary information
to auto load the correct module when the device is added.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
drivers/video/backlight/tosa_bl.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/video/backlight/tosa_bl.c b/drivers/video/backlight/tosa_bl.c
index 3ad676558c80..83742d806391 100644
--- a/drivers/video/backlight/tosa_bl.c
+++ b/drivers/video/backlight/tosa_bl.c
@@ -158,6 +158,7 @@ static const struct i2c_device_id tosa_bl_id[] = {
{ "tosa-bl", 0 },
{ },
};
+MODULE_DEVICE_TABLE(i2c, tosa_bl_id);
static struct i2c_driver tosa_bl_driver = {
.driver = {
--
2.4.3
^ permalink raw reply related
* [PATCH 00/27] Export I2C and OF module aliases in missing drivers
From: Javier Martinez Canillas @ 2015-07-30 16:18 UTC (permalink / raw)
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: Javier Martinez Canillas, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
Mark Brown, linux-iio-u79uwXL29TY76Z2rM5mHXA,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux-leds-u79uwXL29TY76Z2rM5mHXA, Alexandre Belloni,
Chanwoo Choi, Tomi Valkeinen, lm-sensors-GZX6beZjE8VD60Wz+7aTrA,
Sebastian Reichel, linux-input-u79uwXL29TY76Z2rM5mHXA,
Greg Kroah-Hartman, Jean Delvare, Jonathan Cameron,
linux-media-u79uwXL29TY76Z2rM5mHXA,
rtc-linux-/JYPxA39Uh5TLH3MbocFFw, linux-pm-u79uwXL29TY76Z2rM5mHXA,
Mauro Carvalho Chehab, Guenter Roeck, Benjamin Herrenschmidt,
Wolfram Sang, Takashi Iwai, Liam Girdwood <lgirdw>
Hello,
Short version:
This series add the missing MODULE_DEVICE_TABLE() for OF and I2C tables
to export that information so modules have the correct aliases built-in
and autoloading works correctly.
Longer version:
Currently it's mandatory for I2C drivers to have an I2C device ID table
regardless if the device was registered using platform data or OF. This
is because the I2C core needs an I2C device ID table for two reasons:
1) Match the I2C client with a I2C device ID so a struct i2c_device_id
is passed to the I2C driver probe() function.
2) Export the module aliases from the I2C device ID table so userspace
can auto-load the correct module. This is because i2c_device_uevent
always reports a MODALIAS of the form i2c:<client->name>.
Lee Jones posted a patch series [0] to solve 1) by allowing the I2C
drivers to have a probe() function that does not get a i2c_device_id.
The problem is that his series didn't take into account 2) so if that
was merged and the I2C ID table is removed from all the drivers that
don't needed it, module auto-loading will break for those.
But even now there are many I2C drivers were module auto-loading is
not working because of the fact that the I2C core always reports the
MODALIAS as i2c:<client->name> and many developers didn't expect this.
I've identified I2C drivers with 3 types of different issues:
a) Those that have an i2c_table but are not exported. The match works
and the correct i2c_device_id is passed on probe but since the ID
table is not exported, module auto-load won't work.
b) Those that have a of_table but are not exported. This is currently
not an issue since even when the of_table is used to match the dev
with the driver, an OF modalias is not reported by the I2C core.
But if the I2C core is changed to report the MODALIAS of the form
of:N*T*C as it's made by other subsystems, then module auto-load
will break for these drivers.
c) Those that don't have a of_table but should since are OF drivers
with DT bindings doc for them. Since the I2C core does not report
a OF modalias and since i2c_device_match() fallbacks to match the
device part of the compatible string with the I2C device ID table,
many OF drivers don't have an of_table to match. After all having
a I2C device ID table is mandatory so it works without a of_table.
So, in order to not make mandatory to have a I2C device ID table, at
least a) and b) needs to be addressed, this series does that.
c) should be fixed too since it seems wrong that a driver with a DT
binding document, does not have a OF table and export it to modules.
Also stripping the vendor part from the compatible string to match
with the I2C devices ID table and reporting only the device name to
user-space doesn't seem to be correct. I've identified at least two
drivers that have the same name on their I2C device ID table so the
manufacturer prefix is important. But I've not tried to fix c) yet
since that is not so easy to automate due drivers not having all the
information (i.e: the device name can match a documented compatible
string device part but without the vendor prefix is hard to tell).
I split the changes so the patches in this series are independent and
can be picked individually by subsystem maintainers. Patch #27 changes
the logic of i2c_device_uevent() to report an OF modalias if the device
was registered using OF. But this patch is included in the series only
as an RFC for illustration purposes since changing that without fixing
c) will break module auto-loading for the drivers of devices registered
with OF but that don't have a of_match_table.
Although arguably, those drivers were relying on the assumption that a
MODALIAS=i2c:<foo> would always be reported even for the OF case which
is not the true on other subsystems.
[0]: https://lkml.org/lkml/2014/8/28/283
Best regards,
Javier
Javier Martinez Canillas (27):
mfd: stw481x: Export I2C module alias information
spi: xcomm: Export I2C module alias information
iio: Export I2C module alias information in missing drivers
[media] Export I2C module alias information in missing drivers
macintosh: therm_windtunnel: Export I2C module alias information
misc: eeprom: Export I2C module alias information in missing drivers
Input: Export I2C module alias information in missing drivers
power: Export I2C module alias information in missing drivers
i2c: core: Export I2C module alias information in dummy driver
backlight: tosa: Export I2C module alias information
[media] staging: media: lirc: Export I2C module alias information
usb: phy: isp1301: Export I2C module alias information
ALSA: ppc: keywest: Export I2C module alias information
hwmon: (nct7904) Export I2C module alias information
regulator: fan53555: Export I2C module alias information
mfd: Export OF module alias information in missing drivers
iio: Export OF module alias information in missing drivers
hwmon: (g762) Export OF module alias information
extcon: Export OF module alias information in missing drivers
ASoC: Export OF module alias information in missing codec drivers
rtc: Export OF module alias information in missing drivers
macintosh: therm_windtunnel: Export OF module alias information
leds: Export OF module alias information in missing drivers
[media] smiapp: Export OF module alias information
Input: touchscreen - Export OF module alias information
regulator: isl9305: Export OF module alias information
i2c: (RFC, don't apply) report OF style modalias when probing using DT
drivers/extcon/extcon-rt8973a.c | 1 +
drivers/extcon/extcon-sm5502.c | 1 +
drivers/hwmon/g762.c | 1 +
drivers/hwmon/nct7904.c | 1 +
drivers/i2c/i2c-core.c | 9 +++++++++
drivers/iio/accel/mma8452.c | 1 +
drivers/iio/accel/stk8312.c | 1 +
drivers/iio/accel/stk8ba50.c | 1 +
drivers/iio/light/cm32181.c | 1 +
drivers/iio/light/cm3232.c | 1 +
drivers/iio/light/cm36651.c | 1 +
drivers/iio/light/gp2ap020a00f.c | 1 +
drivers/iio/light/stk3310.c | 1 +
drivers/input/misc/gp2ap002a00f.c | 1 +
drivers/input/touchscreen/egalax_ts.c | 1 +
drivers/input/touchscreen/goodix.c | 1 +
drivers/input/touchscreen/mms114.c | 1 +
drivers/leds/leds-pca963x.c | 1 +
drivers/leds/leds-tca6507.c | 1 +
drivers/macintosh/therm_windtunnel.c | 2 ++
drivers/media/i2c/ir-kbd-i2c.c | 1 +
drivers/media/i2c/s5k6a3.c | 1 +
drivers/media/i2c/smiapp/smiapp-core.c | 1 +
drivers/mfd/rt5033.c | 1 +
drivers/mfd/stw481x.c | 1 +
drivers/mfd/tps65217.c | 1 +
drivers/mfd/tps65218.c | 1 +
drivers/misc/eeprom/eeprom.c | 1 +
drivers/misc/eeprom/max6875.c | 1 +
drivers/power/bq24190_charger.c | 1 +
drivers/power/rt5033_battery.c | 2 +-
drivers/regulator/fan53555.c | 1 +
drivers/regulator/isl9305.c | 1 +
drivers/rtc/rtc-ab-b5ze-s3.c | 1 +
drivers/rtc/rtc-isl12022.c | 1 +
drivers/rtc/rtc-isl12057.c | 1 +
drivers/spi/spi-xcomm.c | 1 +
drivers/staging/media/lirc/lirc_zilog.c | 1 +
drivers/usb/phy/phy-isp1301.c | 1 +
drivers/video/backlight/tosa_bl.c | 1 +
sound/ppc/keywest.c | 1 +
sound/soc/codecs/da9055.c | 1 +
sound/soc/codecs/wm8510.c | 1 +
sound/soc/codecs/wm8523.c | 1 +
sound/soc/codecs/wm8580.c | 1 +
45 files changed, 54 insertions(+), 1 deletion(-)
--
2.4.3
^ permalink raw reply
* Re: [PATCH] backlight: pm8941-wled: Add default-brightness property
From: Rob Herring @ 2015-07-30 15:26 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Jingoo Han,
Lee Jones, Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
Rob Clark, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org,
linux-arm-msm
In-Reply-To: <20150729235139.GC6519@usrtlx11787.corpusers.net>
On Wed, Jul 29, 2015 at 6:51 PM, Bjorn Andersson
<bjorn.andersson@sonymobile.com> wrote:
> On Fri 24 Jul 08:29 PDT 2015, Rob Herring wrote:
>
>> On Thu, Jul 23, 2015 at 2:52 PM, Bjorn Andersson
>> <bjorn.andersson@sonymobile.com> wrote:
>> > Add the possibility of specifying the default brightness in DT.
>> >
>> > Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
>> > ---
>> >
>> > This depends on the patch moving pm8941-wled to backlight [1]. The dt property
>> > is used by several other backlight drivers, so I considered this to be a
>> > "common" property and it's hence not prefixed with "qcom,".
>>
>> Well, we have "default-brightness" and "default-brightness-level" used
>> by 1 driver each. But default-brightness-level is much more commonly
>> used (in dts files) since it is in the pwm backlight binding, so we
>> should go with it. I'd like to see this moved to a common backlight
>> doc.
>>
>
> As I looked at these, the default-brightness used in tps65217 is a value
> between 0 and 100, so that can be interpreted as a percentage.
>
> The pwm binding however uses a separate array of "brightness-levels" and
> then default-brightness-level is supposed to be an index into that
> array.
Uggg. I missed that minor detail...
> As we're trying to specify a default brightness within the range [0,
> max_brightness) the latter doesn't make much sense.
>
> Therefor my suggestion is that we make the "default-brightness" the
> common property and we define it as a percentage of [0,max_brightness).
Okay.
I wonder if we should have units such as
"default-brightness-percentage" or "default-brightness-%" so it is
clear. Otherwise, we might have some people doing a range of [0,max].
The former is a bit long and the latter is a bit unusual.
>> Really, I think all the backlight documentation should be merged with
>> LEDs docs. Things like "default-on" are common. But I won't ask to do
>> that here.
>
> I think the backlight framework should be merged with the LED framework.
> There's several hw blocks that are split between the two, with an mfd
> tying them together...
Fully agree. BTW, doing that doesn't have to be in sync between the
bindings and drivers. Of course, if we've designed the bindings with
sub devices to fit the MFD structure, then that is another problem.
Rob
^ permalink raw reply
* Re: [PATCH] backlight: pm8941-wled: Add default-brightness property
From: Bjorn Andersson @ 2015-07-29 23:51 UTC (permalink / raw)
To: Rob Herring
Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Jingoo Han,
Lee Jones, Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
Rob Clark, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org,
linux-arm-msm
In-Reply-To: <CAL_JsqKxdF5sj=edURFLDCk1OyCJR-w6+STL4r3zM6+be3tjhg@mail.gmail.com>
On Fri 24 Jul 08:29 PDT 2015, Rob Herring wrote:
> On Thu, Jul 23, 2015 at 2:52 PM, Bjorn Andersson
> <bjorn.andersson@sonymobile.com> wrote:
> > Add the possibility of specifying the default brightness in DT.
> >
> > Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
> > ---
> >
> > This depends on the patch moving pm8941-wled to backlight [1]. The dt property
> > is used by several other backlight drivers, so I considered this to be a
> > "common" property and it's hence not prefixed with "qcom,".
>
> Well, we have "default-brightness" and "default-brightness-level" used
> by 1 driver each. But default-brightness-level is much more commonly
> used (in dts files) since it is in the pwm backlight binding, so we
> should go with it. I'd like to see this moved to a common backlight
> doc.
>
As I looked at these, the default-brightness used in tps65217 is a value
between 0 and 100, so that can be interpreted as a percentage.
The pwm binding however uses a separate array of "brightness-levels" and
then default-brightness-level is supposed to be an index into that
array.
As we're trying to specify a default brightness within the range [0,
max_brightness) the latter doesn't make much sense.
Therefor my suggestion is that we make the "default-brightness" the
common property and we define it as a percentage of [0,max_brightness).
> Really, I think all the backlight documentation should be merged with
> LEDs docs. Things like "default-on" are common. But I won't ask to do
> that here.
I think the backlight framework should be merged with the LED framework.
There's several hw blocks that are split between the two, with an mfd
tying them together...
Regards,
Bjorn
^ permalink raw reply
* Re: [PATCH] backlight: pm8941-wled: Add default-brightness property
From: Bjorn Andersson @ 2015-07-29 22:37 UTC (permalink / raw)
To: Rob Clark
Cc: Rob Herring, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell,
Jingoo Han, Lee Jones, Jean-Christophe Plagniol-Villard,
Tomi Valkeinen, devicetree@vger.kernel.org,
Linux Kernel Mailing List, Linux Fbdev development list,
linux-arm-msm
In-Reply-To: <CAF6AEGs+knSa9TvZ8fR5-_zqC4TaHuBN8+GU5_6j33Pnr16Faw@mail.gmail.com>
On Fri 24 Jul 10:41 PDT 2015, Rob Clark wrote:
> On Fri, Jul 24, 2015 at 11:39 AM, Rob Herring <robherring2@gmail.com> wrote:
> > On Fri, Jul 24, 2015 at 8:10 AM, Rob Clark <robdclark@gmail.com> wrote:
> >> On Thu, Jul 23, 2015 at 3:52 PM, Bjorn Andersson
> >> <bjorn.andersson@sonymobile.com> wrote:
> >>> Add the possibility of specifying the default brightness in DT.
> >>>
> >>> Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
> >>> ---
> >>>
> >>> This depends on the patch moving pm8941-wled to backlight [1]. The dt property
> >>> is used by several other backlight drivers, so I considered this to be a
> >>> "common" property and it's hence not prefixed with "qcom,".
> >>>
> >>> [1] https://lkml.org/lkml/2015/7/21/906
> >>>
> >>> Documentation/devicetree/bindings/video/backlight/pm8941-wled.txt | 1 +
> >>> drivers/video/backlight/pm8941-wled.c | 4 ++++
> >>> 2 files changed, 5 insertions(+)
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/video/backlight/pm8941-wled.txt b/Documentation/devicetree/bindings/video/backlight/pm8941-wled.txt
> >>> index 424f8444a6cd..37503f8c3620 100644
> >>> --- a/Documentation/devicetree/bindings/video/backlight/pm8941-wled.txt
> >>> +++ b/Documentation/devicetree/bindings/video/backlight/pm8941-wled.txt
> >>> @@ -5,6 +5,7 @@ Required properties:
> >>> - reg: slave address
> >>>
> >>> Optional properties:
> >>> +- default-brightness: value from: 0-4095
> >>> - label: The name of the backlight device
> >>> - qcom,cs-out: bool; enable current sink output
> >>> - qcom,cabc: bool; enable content adaptive backlight control
> >>> diff --git a/drivers/video/backlight/pm8941-wled.c b/drivers/video/backlight/pm8941-wled.c
> >>> index c704c3236034..b875e58df0fc 100644
> >>> --- a/drivers/video/backlight/pm8941-wled.c
> >>> +++ b/drivers/video/backlight/pm8941-wled.c
> >>> @@ -373,6 +373,7 @@ static int pm8941_wled_probe(struct platform_device *pdev)
> >>> struct backlight_device *bl;
> >>> struct pm8941_wled *wled;
> >>> struct regmap *regmap;
> >>> + u32 val = 0;
> >>> int rc;
> >>
> >> as discussed on IRC, it would be better if the default read back the
> >> current settings (so-as to inherit bootloader splash smoothly..
> >> drm/msm supports a memory-region phandle, for example, so it can take
> >> over the bootloader splash-screen as stolen-mem)
> >>
> >> and it would I think be useful to have a comment in the bindings file
> >> explaining that you *should* use the default-brightness property to
> >> set a sane default if bootloader isn't putting up a splash, and you
> >> should *not* use the property if it is..
> >
> > +1
> >
> > What if you have neither? Set to max brightness? 75%?
>
> I did chat w/ Bjorn a bit about that on irc.. his concern was some
> arbitrary percentage (like 50%) might be more or less bright depending
> on the device (although that implies to me that maybe we should have
> min and max bindings as well, rather than just assuming hw limits?
> idk)
>
But this issue could easily be solved by having the boot loader pass an
appropriate value to the kernel through the dt property, overriding any
default from the implementation.
Or in the case when the boot does not touch the backlight the dt writer
still have the possibility of picking a better value.
> my preference is the default is somehow at least not 0%.. possibly
> motivated by the expectation that when people see a dark screen at
> boot they assume the display driver is broken :-P
>
Right
> > This could also be used for the bootloader to communicate to the
> > kernel what the current level is if it is not readable. I've seen one
> > backlight recently which you change the level by doing some number of
> > pulses on a gpio and a long pulse to turn off. So there is no way to
> > know current level without turning off the backlight (unless you
> > hardcode the bootloader's level in the kernel like the vendor did).
> >
Right and even in the case of this driver I feel it's just adding
accidental complexity.
50% would solve Rob's problem and we're through the dt property
providing the necessary means of changing this, either to match boot
loader set levels or developers preferences.
I'll rephrase the binding document and update the driver.
Regards,
Bjorn
^ permalink raw reply
* Re: [PATCH 1/2] ARM: integrator: move framebuffers to driver
From: Russell King - ARM Linux @ 2015-07-29 19:38 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1438172831-11450-1-git-send-email-linus.walleij@linaro.org>
On Wed, Jul 29, 2015 at 02:27:11PM +0200, Linus Walleij wrote:
> Commit 11c32d7b6274cb0f554943d65bd4a126c4a86dcd
> "video: move Versatile CLCD helpers" already moved the
> CLCD mode setting helpers for Versatile and Integrator/CP
> to drivers/video/fbdev. Let's do the same for the IM-PD1
> add-on board, copy the missing displays into the database
> and simplify the code.
And thereby break the support. The IM-PD1 CLCD can only access the memory
on the IM-PD1. That's why the CLCD driver itself doesn't just allocate
the frame buffer using dma_alloc_writecombine(). Where the memory comes
from is platform specific. In this case...
> -static int impd1fb_clcd_setup(struct clcd_fb *fb)
> -{
> - unsigned long framebase = fb->dev->res.start + 0x01000000;
> - unsigned long framesize = SZ_1M;
It's a chunk of SRAM offset by the specified value and of the specified
size above.
--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply
* Re: [PATCH 4/8] xen: Use the correctly the Xen memory terminologies
From: Boris Ostrovsky @ 2015-07-29 14:51 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <55B8E1C7.6070608@citrix.com>
On 07/29/2015 10:23 AM, Julien Grall wrote:
> On 29/07/15 15:14, Boris Ostrovsky wrote:
>>> static inline unsigned long pfn_to_gfn(unsigned long pfn)
>>> {
>>> if (xen_feature(XENFEAT_autotranslated_physmap))
>>> return pfn;
>>> else
>>> return pfn_to_mfn(pfn);
>>> }
>>
>> But you'd still say 'op.arg1.mfn = pfn_to_gfn(pfn);' in xen_do_pin()
>> i.e. assign GFN to MFN, right? That's what I was referring to.
> Well no. I would use op.arg1.mfn = pfn_to_mfn(pfn) given that the code,
> if I'm right, is only executed for PV.
>
> mfn = pfn_to_gfn(...) was valid too because on PV is always an MFN. The
> suggestion of pfn_to_mfn was just for more readability,
Right, and my comments were also not about correctness.
>
>> (In general, I am not sure a guest should ever use 'mfn' as it is purely
>> a hypervisor construct. Including p2m, which I think should really be
>> p2g as this is what we use to figure out what to stick into page tables)
> I think avoid to use mfn in the hypervisor interface is out-of-scope for
> this series. If we ever want to modify the Xen API in Linux, we should
> do in sync with Xen to avoid inconsistency on naming.
>
> Anyway, the oddity of mfn = pfn_to_gfn(...) is mostly contained in the
> x86 specific code. I don't mind to either add pfn_to_mfn and use it or
> add a comment /* PV-specific so mfn = gfn */ for every use of mfn > pfn_to_gfn(...).
I think the former is better (even thought it adds a test)
-boris
^ permalink raw reply
* Re: [PATCH 4/8] xen: Use the correctly the Xen memory terminologies
From: Julien Grall @ 2015-07-29 14:23 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <55B8DFD7.6070107@oracle.com>
On 29/07/15 15:14, Boris Ostrovsky wrote:
>> static inline unsigned long pfn_to_gfn(unsigned long pfn)
>> {
>> if (xen_feature(XENFEAT_autotranslated_physmap))
>> return pfn;
>> else
>> return pfn_to_mfn(pfn);
>> }
>
>
> But you'd still say 'op.arg1.mfn = pfn_to_gfn(pfn);' in xen_do_pin()
> i.e. assign GFN to MFN, right? That's what I was referring to.
Well no. I would use op.arg1.mfn = pfn_to_mfn(pfn) given that the code,
if I'm right, is only executed for PV.
mfn = pfn_to_gfn(...) was valid too because on PV is always an MFN. The
suggestion of pfn_to_mfn was just for more readability,
> (In general, I am not sure a guest should ever use 'mfn' as it is purely
> a hypervisor construct. Including p2m, which I think should really be
> p2g as this is what we use to figure out what to stick into page tables)
I think avoid to use mfn in the hypervisor interface is out-of-scope for
this series. If we ever want to modify the Xen API in Linux, we should
do in sync with Xen to avoid inconsistency on naming.
Anyway, the oddity of mfn = pfn_to_gfn(...) is mostly contained in the
x86 specific code. I don't mind to either add pfn_to_mfn and use it or
add a comment /* PV-specific so mfn = gfn */ for every use of mfn pfn_to_gfn(...).
Regards,
--
Julien Grall
^ permalink raw reply
* Re: [PATCH 4/8] xen: Use the correctly the Xen memory terminologies
From: Boris Ostrovsky @ 2015-07-29 14:14 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <55B8B846.2060103@citrix.com>
On 07/29/2015 07:25 AM, Julien Grall wrote:
> Hi Boris,
>
> On 28/07/15 20:12, Boris Ostrovsky wrote:
>> On 07/28/2015 11:02 AM, Julien Grall wrote:
>>> Based on include/xen/mm.h [1], Linux is mistakenly using MFN when GFN
>>> is meant, I suspect this is because the first support for Xen was for
>>> PV. This brough some misimplementation of helpers on ARM and make the
>>> developper confused the expected behavior.
>>>
>>> For instance, with pfn_to_mfn, we expect to get an MFN based on the name.
>>> Although, if we look at the implementation on x86, it's returning a GFN.
>>>
>>> For clarity and avoid new confusion, replace any reference of mfn into
>>> gnf in any helpers used by PV drivers.
>>
>>
>>
>>
>>> @@ -730,7 +730,7 @@ static void xen_do_pin(unsigned level, unsigned
>>> long pfn)
>>> struct mmuext_op op;
>>>
>>> op.cmd = level;
>>> - op.arg1.mfn = pfn_to_mfn(pfn);
>>> + op.arg1.mfn = pfn_to_gfn(pfn);
>>
>>
>> This looks slightly odd. It is correct but given that purpose of this
>> series is to make things more clear perhaps we can add another union
>> member (gfn) to mmuext_op.arg1?
>>
>> (Of course, the hypervisor will continue referring to mfn which could
>> still be confusing)
>
> This operation is only used for PV guests, right?
>
> IHMO re-introducing pfn_to_mfn for PV-guests only (i.e with a BUG_ON to
> ensure no usage for auto-translated guest) would be the best solution.
> It would avoid to have different name than the hypersivor one in the
> hypercall interface. It will also make clear that virt_to_machine & co
> is only PV specific.
>
> I though doing this but I preferred to defer it to x86 expert as my
> knowledge for x86 Xen is very limited. I don't know where it's more
> suitable to use MFN or GFN. I guess this file (mmu.c) is mostly PV specific?
>
> Would something like below fine for you?
>
> static inline unsigned long pfn_to_mfn(unsigned long pfn)
> {
> unsigned long mfn;
>
> BUG_ON(xen_feature(XENFEAT_auto_translated_physmap));
>
> mfn = __pfn_to_mfn(pfn);
> if (mfn != INVALID_P2M_ENTRY)
> mfn &= ~(FOREIGN_FRAME_BIT | IDENTITY_FRAME_BIT);
>
> return mfn;
> }
>
> static inline unsigned long pfn_to_gfn(unsigned long pfn)
> {
> if (xen_feature(XENFEAT_autotranslated_physmap))
> return pfn;
> else
> return pfn_to_mfn(pfn);
> }
But you'd still say 'op.arg1.mfn = pfn_to_gfn(pfn);' in xen_do_pin()
i.e. assign GFN to MFN, right? That's what I was referring to.
(In general, I am not sure a guest should ever use 'mfn' as it is purely
a hypervisor construct. Including p2m, which I think should really be
p2g as this is what we use to figure out what to stick into page tables)
-boris
>
> Similar splitting would be done for gfn_to_pfn and mfn_to_pfn.
>
> Regards,
>
^ permalink raw reply
* [PATCH 1/2] ARM: integrator: move framebuffers to driver
From: Linus Walleij @ 2015-07-29 12:27 UTC (permalink / raw)
To: linux-arm-kernel
Commit 11c32d7b6274cb0f554943d65bd4a126c4a86dcd
"video: move Versatile CLCD helpers" already moved the
CLCD mode setting helpers for Versatile and Integrator/CP
to drivers/video/fbdev. Let's do the same for the IM-PD1
add-on board, copy the missing displays into the database
and simplify the code.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
FBDEV maintainers: requesting your ACK so I can take this into
the ARM SoC tree.
---
arch/arm/mach-integrator/impd1.c | 181 +++---------------------------
drivers/video/fbdev/amba-clcd-versatile.c | 80 +++++++++++++
2 files changed, 94 insertions(+), 167 deletions(-)
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c
index 38b0da300dd5..f164643b7c59 100644
--- a/arch/arm/mach-integrator/impd1.c
+++ b/arch/arm/mach-integrator/impd1.c
@@ -20,6 +20,7 @@
#include <linux/mm.h>
#include <linux/amba/bus.h>
#include <linux/amba/clcd.h>
+#include <linux/platform_data/video-clcd-versatile.h>
#include <linux/amba/mmci.h>
#include <linux/amba/pl061.h>
#include <linux/io.h>
@@ -64,131 +65,6 @@ static struct mmci_platform_data mmc_data = {
/*
* CLCD support
*/
-#define PANEL PROSPECTOR
-
-#define LTM10C209 1
-#define PROSPECTOR 2
-#define SVGA 3
-#define VGA 4
-
-#if PANEL = VGA
-#define PANELTYPE vga
-static struct clcd_panel vga = {
- .mode = {
- .name = "VGA",
- .refresh = 60,
- .xres = 640,
- .yres = 480,
- .pixclock = 39721,
- .left_margin = 40,
- .right_margin = 24,
- .upper_margin = 32,
- .lower_margin = 11,
- .hsync_len = 96,
- .vsync_len = 2,
- .sync = 0,
- .vmode = FB_VMODE_NONINTERLACED,
- },
- .width = -1,
- .height = -1,
- .tim2 = TIM2_BCD | TIM2_IPC,
- .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
- .caps = CLCD_CAP_5551,
- .connector = IMPD1_CTRL_DISP_VGA,
- .bpp = 16,
- .grayscale = 0,
-};
-
-#elif PANEL = SVGA
-#define PANELTYPE svga
-static struct clcd_panel svga = {
- .mode = {
- .name = "SVGA",
- .refresh = 0,
- .xres = 800,
- .yres = 600,
- .pixclock = 27778,
- .left_margin = 20,
- .right_margin = 20,
- .upper_margin = 5,
- .lower_margin = 5,
- .hsync_len = 164,
- .vsync_len = 62,
- .sync = 0,
- .vmode = FB_VMODE_NONINTERLACED,
- },
- .width = -1,
- .height = -1,
- .tim2 = TIM2_BCD,
- .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
- .connector = IMPD1_CTRL_DISP_VGA,
- .caps = CLCD_CAP_5551,
- .bpp = 16,
- .grayscale = 0,
-};
-
-#elif PANEL = PROSPECTOR
-#define PANELTYPE prospector
-static struct clcd_panel prospector = {
- .mode = {
- .name = "PROSPECTOR",
- .refresh = 0,
- .xres = 640,
- .yres = 480,
- .pixclock = 40000,
- .left_margin = 33,
- .right_margin = 64,
- .upper_margin = 36,
- .lower_margin = 7,
- .hsync_len = 64,
- .vsync_len = 25,
- .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
- .vmode = FB_VMODE_NONINTERLACED,
- },
- .width = -1,
- .height = -1,
- .tim2 = TIM2_BCD,
- .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
- .caps = CLCD_CAP_5551,
- .fixedtimings = 1,
- .connector = IMPD1_CTRL_DISP_LCD,
- .bpp = 16,
- .grayscale = 0,
-};
-
-#elif PANEL = LTM10C209
-#define PANELTYPE ltm10c209
-/*
- * Untested.
- */
-static struct clcd_panel ltm10c209 = {
- .mode = {
- .name = "LTM10C209",
- .refresh = 0,
- .xres = 640,
- .yres = 480,
- .pixclock = 40000,
- .left_margin = 20,
- .right_margin = 20,
- .upper_margin = 19,
- .lower_margin = 19,
- .hsync_len = 20,
- .vsync_len = 10,
- .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
- .vmode = FB_VMODE_NONINTERLACED,
- },
- .width = -1,
- .height = -1,
- .tim2 = TIM2_BCD,
- .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
- .caps = CLCD_CAP_5551,
- .fixedtimings = 1,
- .connector = IMPD1_CTRL_DISP_LCD,
- .bpp = 16,
- .grayscale = 0,
-};
-#endif
-
/*
* Disable all display connectors on the interface module.
*/
@@ -206,51 +82,22 @@ static void impd1fb_clcd_enable(struct clcd_fb *fb)
fb->panel->connector | IMPD1_CTRL_DISP_ENABLE);
}
-static int impd1fb_clcd_setup(struct clcd_fb *fb)
-{
- unsigned long framebase = fb->dev->res.start + 0x01000000;
- unsigned long framesize = SZ_1M;
- int ret = 0;
+#define PANEL "PROSPECTOR"
- fb->panel = &PANELTYPE;
-
- if (!request_mem_region(framebase, framesize, "clcd framebuffer")) {
- printk(KERN_ERR "IM-PD1: unable to reserve framebuffer\n");
- return -EBUSY;
- }
-
- fb->fb.screen_base = ioremap(framebase, framesize);
- if (!fb->fb.screen_base) {
- printk(KERN_ERR "IM-PD1: unable to map framebuffer\n");
- ret = -ENOMEM;
- goto free_buffer;
- }
-
- fb->fb.fix.smem_start = framebase;
- fb->fb.fix.smem_len = framesize;
-
- return 0;
-
- free_buffer:
- release_mem_region(framebase, framesize);
- return ret;
-}
-
-static int impd1fb_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma)
+static int impd1fb_clcd_setup(struct clcd_fb *fb)
{
- unsigned long start, size;
+ fb->panel = versatile_clcd_get_panel(PANEL);
- start = vma->vm_pgoff + (fb->fb.fix.smem_start >> PAGE_SHIFT);
- size = vma->vm_end - vma->vm_start;
+ if (!fb->panel)
+ return -EINVAL;
- return remap_pfn_range(vma, vma->vm_start, start, size,
- vma->vm_page_prot);
-}
+ if (!strcmp(PANEL, "VGA") || !strcmp(PANEL, "SVGA") ||
+ !strcmp(PANEL, "XVGA"))
+ fb->panel->connector = IMPD1_CTRL_DISP_VGA;
+ else
+ fb->panel->connector = IMPD1_CTRL_DISP_LCD;
-static void impd1fb_clcd_remove(struct clcd_fb *fb)
-{
- iounmap(fb->fb.screen_base);
- release_mem_region(fb->fb.fix.smem_start, fb->fb.fix.smem_len);
+ return versatile_clcd_setup_dma(fb, SZ_1M);
}
static struct clcd_board impd1_clcd_data = {
@@ -261,8 +108,8 @@ static struct clcd_board impd1_clcd_data = {
.disable = impd1fb_clcd_disable,
.enable = impd1fb_clcd_enable,
.setup = impd1fb_clcd_setup,
- .mmap = impd1fb_clcd_mmap,
- .remove = impd1fb_clcd_remove,
+ .mmap = versatile_clcd_mmap_dma,
+ .remove = versatile_clcd_remove_dma,
};
struct impd1_device {
diff --git a/drivers/video/fbdev/amba-clcd-versatile.c b/drivers/video/fbdev/amba-clcd-versatile.c
index 7a8afcd4573e..293499981031 100644
--- a/drivers/video/fbdev/amba-clcd-versatile.c
+++ b/drivers/video/fbdev/amba-clcd-versatile.c
@@ -28,6 +28,31 @@ static struct clcd_panel vga = {
.bpp = 16,
};
+static struct clcd_panel svga = {
+ .mode = {
+ .name = "SVGA",
+ .refresh = 0,
+ .xres = 800,
+ .yres = 600,
+ .pixclock = 27778,
+ .left_margin = 20,
+ .right_margin = 20,
+ .upper_margin = 5,
+ .lower_margin = 5,
+ .hsync_len = 164,
+ .vsync_len = 62,
+ .sync = 0,
+ .vmode = FB_VMODE_NONINTERLACED,
+ },
+ .width = -1,
+ .height = -1,
+ .tim2 = TIM2_BCD,
+ .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
+ .caps = CLCD_CAP_5551,
+ .bpp = 16,
+ .grayscale = 0,
+};
+
static struct clcd_panel xvga = {
.mode = {
.name = "XVGA",
@@ -126,12 +151,67 @@ static struct clcd_panel epson_l2f50113t00 = {
.bpp = 16,
};
+static struct clcd_panel prospector = {
+ .mode = {
+ .name = "PROSPECTOR",
+ .refresh = 0,
+ .xres = 640,
+ .yres = 480,
+ .pixclock = 40000,
+ .left_margin = 33,
+ .right_margin = 64,
+ .upper_margin = 36,
+ .lower_margin = 7,
+ .hsync_len = 64,
+ .vsync_len = 25,
+ .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED,
+ },
+ .width = -1,
+ .height = -1,
+ .tim2 = TIM2_BCD,
+ .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
+ .caps = CLCD_CAP_5551,
+ .fixedtimings = 1,
+ .bpp = 16,
+ .grayscale = 0,
+};
+
+static struct clcd_panel ltm10c209 = {
+ .mode = {
+ .name = "LTM10C209",
+ .refresh = 0,
+ .xres = 640,
+ .yres = 480,
+ .pixclock = 40000,
+ .left_margin = 20,
+ .right_margin = 20,
+ .upper_margin = 19,
+ .lower_margin = 19,
+ .hsync_len = 20,
+ .vsync_len = 10,
+ .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED,
+ },
+ .width = -1,
+ .height = -1,
+ .tim2 = TIM2_BCD,
+ .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
+ .caps = CLCD_CAP_5551,
+ .fixedtimings = 1,
+ .bpp = 16,
+ .grayscale = 0,
+};
+
static struct clcd_panel *panels[] = {
&vga,
+ &svga,
&xvga,
&sanyo_tm38qv67a02a,
&sanyo_2_5_in,
&epson_l2f50113t00,
+ &prospector,
+ <m10c209,
};
struct clcd_panel *versatile_clcd_get_panel(const char *name)
--
2.4.3
^ 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