[PATCH] regmap: Allow regmap_bulk_write() to work for "no-bus" regmaps

2013-12-16 Thread Stephen Boyd
regmap_bulk_write() should decay to performing individual writes
if we're using a "no-bus" regmap. Unfortunately, it returns an
error because there is no map->bus pointer. Fix it.

Signed-off-by: Stephen Boyd 
---

On 12/16, Mark Brown wrote:
> On Fri, Dec 13, 2013 at 01:37:07PM -0800, Stephen Boyd wrote:
> 
> > I came up with this (possibly ugly) patch. It works for my
> > specific case but I'm not sure if unpacking the val bits into an
> > unsigned int and passing that to _regmap_write() is sane. What do
> > you think?
> 
> It's not lovely but it's about as good as it gets.  I'd probaly just
> drop the raw single write case so it's simpler - just either raw write
> the lot or write a register at a time with unpacking (and so refactor
> the the loop that does the in place formatting into the raw case only
> and not bother for the single write).

Ok how about this?

 drivers/base/regmap/regmap.c | 43 ++-
 1 file changed, 18 insertions(+), 25 deletions(-)

diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 1ccd61b..12b80f6 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -1514,21 +1514,30 @@ int regmap_bulk_write(struct regmap *map, unsigned int 
reg, const void *val,
 {
int ret = 0, i;
size_t val_bytes = map->format.val_bytes;
-   void *wval;
 
-   if (!map->bus)
-   return -EINVAL;
-   if (!map->format.parse_inplace)
+   if (map->bus && !map->format.parse_inplace)
return -EINVAL;
if (reg % map->reg_stride)
return -EINVAL;
 
map->lock(map->lock_arg);
+   /*
+* Some devices don't support bulk write, for
+* them we have a series of single write operations.
+*/
+   if (!map->bus || map->use_single_rw) {
+   for (i = 0; i < val_count; i++) {
+   unsigned int ival;
 
-   /* No formatting is require if val_byte is 1 */
-   if (val_bytes == 1) {
-   wval = (void *)val;
+   ival = *(unsigned int *)(val + (i * val_bytes));
+   ret = _regmap_write(map, reg + (i * map->reg_stride),
+   ival);
+   if (ret != 0)
+   goto out;
+   }
} else {
+   void *wval;
+
wval = kmemdup(val, val_count * val_bytes, GFP_KERNEL);
if (!wval) {
ret = -ENOMEM;
@@ -1537,27 +1546,11 @@ int regmap_bulk_write(struct regmap *map, unsigned int 
reg, const void *val,
}
for (i = 0; i < val_count * val_bytes; i += val_bytes)
map->format.parse_inplace(wval + i);
-   }
-   /*
-* Some devices does not support bulk write, for
-* them we have a series of single write operations.
-*/
-   if (map->use_single_rw) {
-   for (i = 0; i < val_count; i++) {
-   ret = _regmap_raw_write(map,
-   reg + (i * map->reg_stride),
-   val + (i * val_bytes),
-   val_bytes);
-   if (ret != 0)
-   return ret;
-   }
-   } else {
+
ret = _regmap_raw_write(map, reg, wval, val_bytes * val_count);
-   }
 
-   if (val_bytes != 1)
kfree(wval);
-
+   }
 out:
map->unlock(map->lock_arg);
return ret;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 6/7] Input: pmic8xxx-keypad - Migrate to devm_* APIs

2013-12-16 Thread spamassassin system account
On 12/16, Dmitry Torokhov wrote:
> On Tue, Dec 10, 2013 at 03:43:15PM -0800, Stephen Boyd wrote:
> > -
> > -static int pmic8xxx_kp_remove(struct platform_device *pdev)
> > -{
> > -   struct pmic8xxx_kp *kp = platform_get_drvdata(pdev);
> > -
> > -   device_init_wakeup(&pdev->dev, 0);
> 
> Why are we removing restoring wakeup capable state?
> 

It's the only thing blocking removal of the remove callback and
as the driver is being unbound it didn't seem like we cared about
the state of the wakeup of the device. I greped the kernel tree
and I couldn't see a consistent pattern where driver probe was
setting the flag and driver remove was clearing it. Do we need to
keep it?

> > -   free_irq(kp->key_stuck_irq, kp);
> > -   free_irq(kp->key_sense_irq, kp);
> > -   input_unregister_device(kp->input);
> > -   kfree(kp);
> > -
> > -   return 0;
> >  }
> >  
> >  #ifdef CONFIG_PM_SLEEP

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 6/7] Input: pmic8xxx-keypad - Migrate to devm_* APIs

2013-12-16 Thread Dmitry Torokhov
On Tue, Dec 10, 2013 at 03:43:15PM -0800, Stephen Boyd wrote:
> Simplify the error paths and reduce the lines of code in this
> driver by using the devm_* APIs.
> 
> Signed-off-by: Stephen Boyd 
> ---
>  drivers/input/keyboard/pmic8xxx-keypad.c | 62 
> +---
>  1 file changed, 17 insertions(+), 45 deletions(-)
> 
> diff --git a/drivers/input/keyboard/pmic8xxx-keypad.c 
> b/drivers/input/keyboard/pmic8xxx-keypad.c
> index 2c9f19a..4e6bfbf 100644
> --- a/drivers/input/keyboard/pmic8xxx-keypad.c
> +++ b/drivers/input/keyboard/pmic8xxx-keypad.c
> @@ -586,7 +586,7 @@ static int pmic8xxx_kp_probe(struct platform_device *pdev)
>   return -EINVAL;
>   }
>  
> - kp = kzalloc(sizeof(*kp), GFP_KERNEL);
> + kp = devm_kzalloc(&pdev->dev, sizeof(*kp), GFP_KERNEL);
>   if (!kp)
>   return -ENOMEM;
>  
> @@ -595,32 +595,27 @@ static int pmic8xxx_kp_probe(struct platform_device 
> *pdev)
>   kp->pdata   = pdata;
>   kp->dev = &pdev->dev;
>  
> - kp->input = input_allocate_device();
> + kp->input = devm_input_allocate_device(&pdev->dev);
>   if (!kp->input) {
>   dev_err(&pdev->dev, "unable to allocate input device\n");
> - rc = -ENOMEM;
> - goto err_alloc_device;
> + return -ENOMEM;
>   }
>  
>   kp->key_sense_irq = platform_get_irq(pdev, 0);
>   if (kp->key_sense_irq < 0) {
>   dev_err(&pdev->dev, "unable to get keypad sense irq\n");
> - rc = -ENXIO;
> - goto err_get_irq;
> + return kp->key_sense_irq;
>   }
>  
>   kp->key_stuck_irq = platform_get_irq(pdev, 1);
>   if (kp->key_stuck_irq < 0) {
>   dev_err(&pdev->dev, "unable to get keypad stuck irq\n");
> - rc = -ENXIO;
> - goto err_get_irq;
> + return kp->key_stuck_irq;
>   }
>  
>   kp->input->name = pdata->input_name ? : "PMIC8XXX keypad";
>   kp->input->phys = pdata->input_phys_device ? : "pmic8xxx_keypad/input0";
>  
> - kp->input->dev.parent   = &pdev->dev;
> -
>   kp->input->id.bustype   = BUS_I2C;
>   kp->input->id.version   = 0x0001;
>   kp->input->id.product   = 0x0001;
> @@ -634,7 +629,7 @@ static int pmic8xxx_kp_probe(struct platform_device *pdev)
>   kp->keycodes, kp->input);
>   if (rc) {
>   dev_err(&pdev->dev, "failed to build keymap\n");
> - goto err_get_irq;
> + return rc;
>   }
>  
>   if (pdata->rep)
> @@ -650,7 +645,7 @@ static int pmic8xxx_kp_probe(struct platform_device *pdev)
>   rc = pmic8xxx_kpd_init(kp);
>   if (rc < 0) {
>   dev_err(&pdev->dev, "unable to initialize keypad controller\n");
> - goto err_get_irq;
> + return rc;
>   }
>  
>   rc = pmic8xxx_kp_config_gpio(pdata->cols_gpio_start,
> @@ -667,24 +662,26 @@ static int pmic8xxx_kp_probe(struct platform_device 
> *pdev)
>   goto err_gpio_config;
>   }
>  
> - rc = request_any_context_irq(kp->key_sense_irq, pmic8xxx_kp_irq,
> -  IRQF_TRIGGER_RISING, "pmic-keypad", kp);
> + rc = devm_request_any_context_irq(&pdev->dev, kp->key_sense_irq,
> + pmic8xxx_kp_irq, IRQF_TRIGGER_RISING, "pmic-keypad",
> + kp);
>   if (rc < 0) {
>   dev_err(&pdev->dev, "failed to request keypad sense irq\n");
> - goto err_get_irq;
> + return rc;
>   }
>  
> - rc = request_any_context_irq(kp->key_stuck_irq, pmic8xxx_kp_stuck_irq,
> -  IRQF_TRIGGER_RISING, "pmic-keypad-stuck", kp);
> + rc = devm_request_any_context_irq(&pdev->dev, kp->key_stuck_irq,
> + pmic8xxx_kp_stuck_irq, IRQF_TRIGGER_RISING,
> + "pmic-keypad-stuck", kp);
>   if (rc < 0) {
>   dev_err(&pdev->dev, "failed to request keypad stuck irq\n");
> - goto err_req_stuck_irq;
> + return rc;
>   }
>  
>   rc = pmic8xxx_kp_read_u8(kp, &ctrl_val, KEYP_CTRL);
>   if (rc < 0) {
>   dev_err(&pdev->dev, "failed to read KEYP_CTRL register\n");
> - goto err_pmic_reg_read;
> + return rc;
>   }
>  
>   kp->ctrl_reg = ctrl_val;
> @@ -692,36 +689,12 @@ static int pmic8xxx_kp_probe(struct platform_device 
> *pdev)
>   rc = input_register_device(kp->input);
>   if (rc < 0) {
>   dev_err(&pdev->dev, "unable to register keypad input device\n");
> - goto err_pmic_reg_read;
> + return rc;
>   }
>  
>   device_init_wakeup(&pdev->dev, pdata->wakeup);
>  
>   return 0;
> -
> -err_pmic_reg_read:
> - free_irq(kp->key_stuck_irq, kp);
> -err_req_stuck_irq:
> - free_irq(kp->key_sense_irq, kp);
> -err_gpio_config:
> -err_get_irq:
> - input_free_device(kp->input);
> -err_alloc_device:
> - kfre

Re: [PATCH 3/8] regmap: Add support for using regmap over ssbi

2013-12-16 Thread Mark Brown
On Fri, Dec 13, 2013 at 01:37:07PM -0800, Stephen Boyd wrote:

> I came up with this (possibly ugly) patch. It works for my
> specific case but I'm not sure if unpacking the val bits into an
> unsigned int and passing that to _regmap_write() is sane. What do
> you think?

It's not lovely but it's about as good as it gets.  I'd probaly just
drop the raw single write case so it's simpler - just either raw write
the lot or write a register at a time with unpacking (and so refactor
the the loop that does the in place formatting into the raw case only
and not bother for the single write).


signature.asc
Description: Digital signature


Re: [PATCH] regmap: Allow regmap_bulk_read() to work for "no-bus" regmaps

2013-12-16 Thread Mark Brown
On Fri, Dec 13, 2013 at 09:14:07AM -0800, Stephen Boyd wrote:

> regmap_bulk_read() should decay to performing individual reads if
> we're using a "no-bus" regmap. Unfortunately, it returns an
> error because there is no map->bus pointer. Fix it.

Applied, thanks.

> > Yes, I'd expect the operation to work.  Your changes below are mostly
> > fine (we should add an additional check for values that aren't integer
> > numbers of bytes, I can add that) - can you send as a signed off patch
> > please and I'll apply?

> Here you go. Do you have any suggestions on how to make regmap_bulk_write()
> work?

Off the top of my head I'd expect it to just fall back onto
regmap_write() if it can't do raw I/O.  Or perhaps just change that loop
to do regmap_write() all the time since it's hardly the fast path.


signature.asc
Description: Digital signature


Re: [RFC 3/3] RFC: mach-msm: add DT for ifc6410 (apq8064)

2013-12-16 Thread Olof Johansson
On Mon, Dec 16, 2013 at 12:10 PM, Rob Clark  wrote:
> On Mon, Dec 16, 2013 at 3:03 PM, Olof Johansson  wrote:
>> On Mon, Dec 16, 2013 at 9:00 AM, Rob Clark  wrote:
>>
>>> +
>>> +/ {
>>> +   model = "Qualcomm APQ8064/IFC6410";
>>> +   compatible = "qcom,apq8064-ifc6410", "qcom,apq8064";
>>> +   interrupt-parent = <&intc>;
>>
>> [...]
>>
>>> diff --git a/arch/arm/mach-msm/board-dt.c b/arch/arm/mach-msm/board-dt.c
>>> index 1f11d93..00796d1 100644
>>> --- a/arch/arm/mach-msm/board-dt.c
>>> +++ b/arch/arm/mach-msm/board-dt.c
>>> @@ -23,6 +23,7 @@ static const char * const msm_dt_match[] __initconst = {
>>> "qcom,msm8660-fluid",
>>> "qcom,msm8660-surf",
>>> "qcom,msm8960-cdp",
>>> +   "qcom,apq8064-ifc6410",
>>
>>
>> We shouldn't enumerate boards here, it should probably list the
>> second-level compatible instead. I.e. "qcom,apq8064" in this case.
>
> oh, yeah, that does sound more sensible..
>
> I guess I could split .dts up too, to separate parts that would apply
> to all apq8064..  although not sure if that is overkill to do before
> we have >1 apq8064 device supported..

Yeah. I've got a dragonboard here that's sitting idle due to lack of
meaningful dts/driver support. Sounds like things are coming together
to a point where I can start putting it to use.

Having the onchip IP blocks in a shared DTSI (but marked as disabled
in some cases) is usually how we do it.


-Olof
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC 3/3] RFC: mach-msm: add DT for ifc6410 (apq8064)

2013-12-16 Thread Rob Clark
On Mon, Dec 16, 2013 at 3:03 PM, Olof Johansson  wrote:
> On Mon, Dec 16, 2013 at 9:00 AM, Rob Clark  wrote:
>
>> +
>> +/ {
>> +   model = "Qualcomm APQ8064/IFC6410";
>> +   compatible = "qcom,apq8064-ifc6410", "qcom,apq8064";
>> +   interrupt-parent = <&intc>;
>
> [...]
>
>> diff --git a/arch/arm/mach-msm/board-dt.c b/arch/arm/mach-msm/board-dt.c
>> index 1f11d93..00796d1 100644
>> --- a/arch/arm/mach-msm/board-dt.c
>> +++ b/arch/arm/mach-msm/board-dt.c
>> @@ -23,6 +23,7 @@ static const char * const msm_dt_match[] __initconst = {
>> "qcom,msm8660-fluid",
>> "qcom,msm8660-surf",
>> "qcom,msm8960-cdp",
>> +   "qcom,apq8064-ifc6410",
>
>
> We shouldn't enumerate boards here, it should probably list the
> second-level compatible instead. I.e. "qcom,apq8064" in this case.

oh, yeah, that does sound more sensible..

I guess I could split .dts up too, to separate parts that would apply
to all apq8064..  although not sure if that is overkill to do before
we have >1 apq8064 device supported..

BR,
-R

>
> -Olof
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC 3/3] RFC: mach-msm: add DT for ifc6410 (apq8064)

2013-12-16 Thread Olof Johansson
On Mon, Dec 16, 2013 at 9:00 AM, Rob Clark  wrote:

> +
> +/ {
> +   model = "Qualcomm APQ8064/IFC6410";
> +   compatible = "qcom,apq8064-ifc6410", "qcom,apq8064";
> +   interrupt-parent = <&intc>;

[...]

> diff --git a/arch/arm/mach-msm/board-dt.c b/arch/arm/mach-msm/board-dt.c
> index 1f11d93..00796d1 100644
> --- a/arch/arm/mach-msm/board-dt.c
> +++ b/arch/arm/mach-msm/board-dt.c
> @@ -23,6 +23,7 @@ static const char * const msm_dt_match[] __initconst = {
> "qcom,msm8660-fluid",
> "qcom,msm8660-surf",
> "qcom,msm8960-cdp",
> +   "qcom,apq8064-ifc6410",


We shouldn't enumerate boards here, it should probably list the
second-level compatible instead. I.e. "qcom,apq8064" in this case.


-Olof
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/7] Input: pmic8xxx-pwrkey - Pass input device directly to interrupt

2013-12-16 Thread Stephen Boyd
On 12/15, Dmitry Torokhov wrote:
> Hi Stephen,
> 
> On Tue, Dec 10, 2013 at 03:43:10PM -0800, Stephen Boyd wrote:
> > Instead of passing the pointer to the container structure just
> > pass the input device here. This saves a dereference in the fast
> > path.
> > 
> > Signed-off-by: Stephen Boyd 
> > ---
> >  drivers/input/misc/pmic8xxx-pwrkey.c | 22 --
> >  1 file changed, 8 insertions(+), 14 deletions(-)
> > 
> > diff --git a/drivers/input/misc/pmic8xxx-pwrkey.c 
> > b/drivers/input/misc/pmic8xxx-pwrkey.c
> > index ce3c426..233b216 100644
> > --- a/drivers/input/misc/pmic8xxx-pwrkey.c
> > +++ b/drivers/input/misc/pmic8xxx-pwrkey.c
> > @@ -32,26 +32,21 @@
> >   * @key_press_irq: key press irq number
> >   */
> >  struct pmic8xxx_pwrkey {
> > -   struct input_dev *pwr;
> 
> This causes compile errors as you need pwrkey->pwr in remove() to
> unregister input device. I'll fix it up.
> 

Ah sorry. I forgot to send the patch before this that converts it
to devm.

> > err = devm_request_irq(&pdev->dev, key_press_irq, pwrkey_press_irq,
> > -   IRQF_TRIGGER_RISING, "pmic8xxx_pwrkey_press", pwrkey);
> > +   IRQF_TRIGGER_RISING, "pmic8xxx_pwrkey_press", pwr);

As you can see here because this driver isn't currently using
devm_request_irq().

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC 3/3] RFC: mach-msm: add DT for ifc6410 (apq8064)

2013-12-16 Thread Stephen Boyd
On 12/16, Rob Clark wrote:
> +
> + msmgpio: gpio@80 {
> + compatible = "qcom,msm-gpio";
> + gpio-controller;
> + #gpio-cells = <2>;
> + ngpio = <150>;
> + interrupts = <0 32 0x4>;

This should be 16.

> + interrupt-controller;
> + #interrupt-cells = <2>;
> + reg = <0x0080 0x4000>;
> + };
> +

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] mach-msm: enable sparsemem for 8960

2013-12-16 Thread Rob Clark
hmm, ok, if I understand properly the root issue is the memory atags
passed to the kernel from the bootloader..

Putting 'mem=2G@0x8000' in the cmdline also does the trick without
requiring sparsemem

BR,
-R


On Mon, Dec 16, 2013 at 12:00 PM, Rob Clark  wrote:
> fixes:
>
> [ cut here ]
> WARNING: CPU: 0 PID: 0 at /home/robclark/src/linux/lib/list_debug.c:29 
> __list_add+0x6c/0xc0()
> list_add corruption. next->prev should be prev (c09eb13c), but was c09eb138. 
> (next=c1077814).
> Modules linked in:
> CPU: 0 PID: 0 Comm: swapper Not tainted 3.13.0-rc2-00172-g0a3e79c-dirty #214
> [] (unwind_backtrace+0x0/0x138) from [] 
> (show_stack+0x10/0x14)
> [] (show_stack+0x10/0x14) from [] (dump_stack+0x6c/0xac)
> [] (dump_stack+0x6c/0xac) from [] 
> (warn_slowpath_common+0x68/0x8c)
> [] (warn_slowpath_common+0x68/0x8c) from [] 
> (warn_slowpath_fmt+0x30/0x40)
> [] (warn_slowpath_fmt+0x30/0x40) from [] 
> (__list_add+0x6c/0xc0)
> [] (__list_add+0x6c/0xc0) from [] 
> (__free_pages_ok.part.47+0x144/0x2bc)
> [] (__free_pages_ok.part.47+0x144/0x2bc) from [] 
> (free_all_bootmem+0x114/0x2a4)
> [] (free_all_bootmem+0x114/0x2a4) from [] 
> (mem_init+0xe4/0x404)
> [] (mem_init+0xe4/0x404) from [] 
> (start_kernel+0x16c/0x358)
> [] (start_kernel+0x16c/0x358) from [<80208074>] (0x80208074)
> ---[ end trace 3406ff24bd97382e ]---
> [ cut here ]
>
> Signed-off-by: Rob Clark 
>
> Conflicts:
> arch/arm/mach-msm/Kconfig
> ---
>  arch/arm/mach-msm/Kconfig   |  3 +++
>  arch/arm/mach-msm/include/mach/memory.h | 22 ++
>  2 files changed, 25 insertions(+)
>  create mode 100644 arch/arm/mach-msm/include/mach/memory.h
>
> diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig
> index 702553b..24c76a0 100644
> --- a/arch/arm/mach-msm/Kconfig
> +++ b/arch/arm/mach-msm/Kconfig
> @@ -54,6 +54,9 @@ config ARCH_MSM8X60
>  config ARCH_MSM8960
> bool "MSM8960"
> select ARCH_MSM_DT
> +   select ARCH_HAS_HOLES_MEMORYMODEL
> +   select ARCH_SPARSEMEM_ENABLE
> +   select NEED_MACH_MEMORY_H
> select ARM_GIC
> select CPU_V7
> select HAVE_SMP
> diff --git a/arch/arm/mach-msm/include/mach/memory.h 
> b/arch/arm/mach-msm/include/mach/memory.h
> new file mode 100644
> index 000..15aa2cd
> --- /dev/null
> +++ b/arch/arm/mach-msm/include/mach/memory.h
> @@ -0,0 +1,22 @@
> +/* arch/arm/mach-msm/include/mach/memory.h
> + *
> + * Copyright (C) 2007 Google, Inc.
> + * Copyright (c) 2009-2012, Code Aurora Forum. All rights reserved.
> + *
> + * This software is licensed under the terms of the GNU General Public
> + * License version 2, as published by the Free Software Foundation, and
> + * may be copied, distributed, and modified under those terms.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + */
> +#ifndef __ASM_ARCH_MEMORY_H
> +#define __ASM_ARCH_MEMORY_H
> +
> +#define MAX_PHYSMEM_BITS 32
> +#define SECTION_SIZE_BITS 28
> +
> +#endif
> --
> 1.8.4.2
>
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] mach-msm: add aqp8064 debug uart

2013-12-16 Thread Rob Clark
On Mon, Dec 16, 2013 at 12:26 PM, Christopher Covington
 wrote:
> Hi Rob,
>
> Small typo in the subject of this patch (s/aqp/apq/).

oh, whoops.. looks like I wasn't minding my p's and q's

(but at a small enough font size, it is pretty hard to tell the difference :-P)

BR,
-R

>
> Regards,
> Christopher
>
> --
> Employee of Qualcomm Innovation Center, Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
> hosted by the Linux Foundation.
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] mach-msm: add aqp8064 debug uart

2013-12-16 Thread Christopher Covington
Hi Rob,

Small typo in the subject of this patch (s/aqp/apq/).

Regards,
Christopher

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by the Linux Foundation.
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/3] Basic support for inforce IFC6410 board

2013-12-16 Thread Rob Clark
Couple little patches, plus work-in-progress DT file for the IFC6410.
With this, plus the msm clk support[1], I have serial console working
on top of 3.13-rc4.  The debug UART patch is not strictly required,
but it is a lot easier to debug when you can see what is going on in
early boot before the serial driver is up.


[1] http://www.spinics.net/lists/devicetree/msg08409.html

Rob Clark (3):
  mach-msm: add aqp8064 debug uart
  mach-msm: enable sparsemem for 8960
  RFC: mach-msm: add DT for ifc6410 (apq8064)

 arch/arm/Kconfig.debug |   9 ++
 arch/arm/boot/dts/qcom-apq8064-ifc6410.dts | 131 +
 arch/arm/include/debug/msm.S   |   5 ++
 arch/arm/mach-msm/Kconfig  |   3 +
 arch/arm/mach-msm/board-dt.c   |   1 +
 arch/arm/mach-msm/include/mach/memory.h|  22 +
 6 files changed, 171 insertions(+)
 create mode 100644 arch/arm/boot/dts/qcom-apq8064-ifc6410.dts
 create mode 100644 arch/arm/mach-msm/include/mach/memory.h

-- 
1.8.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] mach-msm: enable sparsemem for 8960

2013-12-16 Thread Rob Clark
fixes:

[ cut here ]
WARNING: CPU: 0 PID: 0 at /home/robclark/src/linux/lib/list_debug.c:29 
__list_add+0x6c/0xc0()
list_add corruption. next->prev should be prev (c09eb13c), but was c09eb138. 
(next=c1077814).
Modules linked in:
CPU: 0 PID: 0 Comm: swapper Not tainted 3.13.0-rc2-00172-g0a3e79c-dirty #214
[] (unwind_backtrace+0x0/0x138) from [] 
(show_stack+0x10/0x14)
[] (show_stack+0x10/0x14) from [] (dump_stack+0x6c/0xac)
[] (dump_stack+0x6c/0xac) from [] 
(warn_slowpath_common+0x68/0x8c)
[] (warn_slowpath_common+0x68/0x8c) from [] 
(warn_slowpath_fmt+0x30/0x40)
[] (warn_slowpath_fmt+0x30/0x40) from [] 
(__list_add+0x6c/0xc0)
[] (__list_add+0x6c/0xc0) from [] 
(__free_pages_ok.part.47+0x144/0x2bc)
[] (__free_pages_ok.part.47+0x144/0x2bc) from [] 
(free_all_bootmem+0x114/0x2a4)
[] (free_all_bootmem+0x114/0x2a4) from [] 
(mem_init+0xe4/0x404)
[] (mem_init+0xe4/0x404) from [] (start_kernel+0x16c/0x358)
[] (start_kernel+0x16c/0x358) from [<80208074>] (0x80208074)
---[ end trace 3406ff24bd97382e ]---
[ cut here ]

Signed-off-by: Rob Clark 

Conflicts:
arch/arm/mach-msm/Kconfig
---
 arch/arm/mach-msm/Kconfig   |  3 +++
 arch/arm/mach-msm/include/mach/memory.h | 22 ++
 2 files changed, 25 insertions(+)
 create mode 100644 arch/arm/mach-msm/include/mach/memory.h

diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig
index 702553b..24c76a0 100644
--- a/arch/arm/mach-msm/Kconfig
+++ b/arch/arm/mach-msm/Kconfig
@@ -54,6 +54,9 @@ config ARCH_MSM8X60
 config ARCH_MSM8960
bool "MSM8960"
select ARCH_MSM_DT
+   select ARCH_HAS_HOLES_MEMORYMODEL
+   select ARCH_SPARSEMEM_ENABLE
+   select NEED_MACH_MEMORY_H
select ARM_GIC
select CPU_V7
select HAVE_SMP
diff --git a/arch/arm/mach-msm/include/mach/memory.h 
b/arch/arm/mach-msm/include/mach/memory.h
new file mode 100644
index 000..15aa2cd
--- /dev/null
+++ b/arch/arm/mach-msm/include/mach/memory.h
@@ -0,0 +1,22 @@
+/* arch/arm/mach-msm/include/mach/memory.h
+ *
+ * Copyright (C) 2007 Google, Inc.
+ * Copyright (c) 2009-2012, Code Aurora Forum. All rights reserved.
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
+
+#define MAX_PHYSMEM_BITS 32
+#define SECTION_SIZE_BITS 28
+
+#endif
-- 
1.8.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC 3/3] RFC: mach-msm: add DT for ifc6410 (apq8064)

2013-12-16 Thread Rob Clark
This depends on gcc and mmcc clk stuff, which isn't merged yet.  And
the display/gpu parts need regulators which are missing.  So this
patch is only RFC at this point.

---
 arch/arm/boot/dts/qcom-apq8064-ifc6410.dts | 131 +
 arch/arm/mach-msm/board-dt.c   |   1 +
 2 files changed, 132 insertions(+)
 create mode 100644 arch/arm/boot/dts/qcom-apq8064-ifc6410.dts

diff --git a/arch/arm/boot/dts/qcom-apq8064-ifc6410.dts 
b/arch/arm/boot/dts/qcom-apq8064-ifc6410.dts
new file mode 100644
index 000..84c9b29
--- /dev/null
+++ b/arch/arm/boot/dts/qcom-apq8064-ifc6410.dts
@@ -0,0 +1,131 @@
+/dts-v1/;
+
+/include/ "skeleton.dtsi"
+
+#include 
+#include 
+
+/ {
+   model = "Qualcomm APQ8064/IFC6410";
+   compatible = "qcom,apq8064-ifc6410", "qcom,apq8064";
+   interrupt-parent = <&intc>;
+
+   intc: interrupt-controller@200 {
+   compatible = "qcom,msm-qgic2";
+   interrupt-controller;
+   #interrupt-cells = <3>;
+   reg = < 0x0200 0x1000 >,
+ < 0x02002000 0x1000 >;
+   };
+
+   timer@200a000 {
+   compatible = "qcom,kpss-timer", "qcom,msm-timer";
+   interrupts = <1 1 0x301>,
+<1 2 0x301>,
+<1 3 0x301>;
+   reg = <0x0200a000 0x100>;
+   clock-frequency = <2700>,
+ <32768>;
+   cpu-offset = <0x8>;
+   };
+
+   msmgpio: gpio@80 {
+   compatible = "qcom,msm-gpio";
+   gpio-controller;
+   #gpio-cells = <2>;
+   ngpio = <150>;
+   interrupts = <0 32 0x4>;
+   interrupt-controller;
+   #interrupt-cells = <2>;
+   reg = <0x0080 0x4000>;
+   };
+
+   serial@1664 {
+   compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
+   reg = <0x1664 0x1000>,
+ <0x1660 0x1000>;
+   interrupts = <0 154 0x0>;
+   clocks = <&gcc GSBI5_UART_CLK>, <&gcc GSBI5_H_CLK>;
+   clock-names = "core", "iface";
+   };
+
+   qcom,ssbi@50 {
+   compatible = "qcom,ssbi";
+   reg = <0x0050 0x1000>;
+   qcom,controller-type = "pmic-arbiter";
+   };
+
+   gcc: clock-controller@90 {
+   compatible = "qcom,gcc-8960", "qcom,gcc";
+   reg = <0x0090 0x4000>;
+   #clock-cells = <1>;
+   #reset-cells = <1>;
+   };
+
+   mmcc: clock-controller@400 {
+   compatible = "qcom,mmcc-8960", "qcom,mmcc";
+   reg = <0x0400 0x1000>;
+   #clock-cells = <1>;
+   #reset-cells = <1>;
+   };
+
+   gpu: qcom,kgsl-3d0@430 {
+   compatible = "qcom,kgsl-3d0";
+   reg = <0x0430 0x2>;
+   qcom,chipid = <0x03020100>;
+
+   qcom,gpu-pwrlevels {
+   compatible = "qcom,gpu-pwrlevels";
+
+   qcom,gpu-pwrlevel@0 {
+   qcom,gpu-freq = <45000>;
+   };
+
+   qcom,gpu-pwrlevel@1 {
+   qcom,gpu-freq = <2700>;
+   };
+   };
+   };
+
+   hdmi: qcom,hdmi-tx@4a0 {
+   compatible = "qcom,hdmi-tx";
+   reg-names = "core_physical";
+   reg = <0x04a0 0x1000>;
+   clock-names =
+   "core_clk",
+   "master_iface_clk",
+   "slave_iface_clk";
+   clocks =
+   <&mmcc HDMI_APP_CLK>,
+   <&mmcc HDMI_M_AHB_CLK>,
+   <&mmcc HDMI_S_AHB_CLK>;
+   qcom,hdmi-phy = "8960";
+   qcom,hdmi-tx-ddc-clk = <&msmgpio 70 0>;
+   qcom,hdmi-tx-ddc-data = <&msmgpio 71 0>;
+   qcom,hdmi-tx-hpd = <&msmgpio 72 0>;
+   };
+
+   mdp: qcom,mdp@510 {
+   compatible = "qcom,mdp";
+   reg = <0x0510 0xf>;
+   interrupts = <0 107 0>;
+   hdmi = <&hdmi>;
+   gpu = <&gpu>;
+   clock-names =
+   "core_clk",
+   "iface_clk",
+   "lut_clk",
+   "src_clk",
+   "hdmi_clk",
+   "mdp_clk";
+   clocks =
+   <&mmcc MDP_SRC>,
+   <&mmcc MDP_AHB_CLK>,
+   <&mmcc MDP_LUT_CLK>,
+   <&mmcc TV_SRC>,
+   <&mmcc HDMI_TV_CLK>,
+   <&mmcc MDP_TV_CLK>;
+// need footswitch!
+// vdd-supply = <&gdsc_mdss>;
+   };
+};
diff --git a/arch/arm/mach-msm/board-dt.c b/arch/arm/mach-msm/board-dt.c
index 1f11d93..00796d1 100644
---

[PATCH 1/3] mach-msm: add aqp8064 debug uart

2013-12-16 Thread Rob Clark
Signed-off-by: Rob Clark 
---
 arch/arm/Kconfig.debug   | 9 +
 arch/arm/include/debug/msm.S | 5 +
 2 files changed, 14 insertions(+)

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 5765abf..de9207d 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -357,6 +357,15 @@ choice
  Say Y here if you want the debug print routines to direct
  their output to the serial port on MSM 8960 devices.
 
+   config DEBUG_APQ8064_UART
+   bool "Kernel low-level debugging messages via APQ 8064 UART"
+   depends on ARCH_MSM8960
+   select MSM_HAS_DEBUG_UART_HS
+   select DEBUG_MSM_UART
+   help
+ Say Y here if you want the debug print routines to direct
+ their output to the serial port on APQ 8064 devices.
+
config DEBUG_MSM8974_UART
bool "Kernel low-level debugging messages via MSM 8974 UART"
depends on ARCH_MSM8974
diff --git a/arch/arm/include/debug/msm.S b/arch/arm/include/debug/msm.S
index 9d653d4..08dc880 100644
--- a/arch/arm/include/debug/msm.S
+++ b/arch/arm/include/debug/msm.S
@@ -46,6 +46,11 @@
 #define MSM_DEBUG_UART_PHYS0x1644
 #endif
 
+#ifdef CONFIG_DEBUG_APQ8064_UART
+#define MSM_DEBUG_UART_BASE 0xFA74
+#define MSM_DEBUG_UART_PHYS 0x1664
+#endif
+
 #ifdef CONFIG_DEBUG_MSM8974_UART
 #define MSM_DEBUG_UART_BASE0xFA71E000
 #define MSM_DEBUG_UART_PHYS0xF991E000
-- 
1.8.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/4] pinctrl-msm: Remove separate allocation of bitmaps

2013-12-16 Thread Linus Walleij
On Sun, Dec 15, 2013 at 8:01 AM, Bjorn Andersson
 wrote:

> Make the bitmaps part of the msm_pinctrl allocation instead of
> separately allocating them.
>
> Signed-off-by: Bjorn Andersson 

Patch applied.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/4] pinctrl-msm: Rename compatible to be more specific

2013-12-16 Thread Linus Walleij
On Sun, Dec 15, 2013 at 8:01 AM, Bjorn Andersson
 wrote:

> Use the more specific form 8974 for the compatible to reduce the
> risk of future mishaps.
>
> Signed-off-by: Bjorn Andersson 

Patch applied.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/4] pinctrl-msm: Tidy up error handling

2013-12-16 Thread Linus Walleij
On Sun, Dec 15, 2013 at 8:01 AM, Bjorn Andersson
 wrote:

> Signed-off-by: Bjorn Andersson 

Patch applied.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/4] pinctrl-msm: Fix spelling misstakes and missing consts

2013-12-16 Thread Linus Walleij
On Sun, Dec 15, 2013 at 8:01 AM, Bjorn Andersson
 wrote:

> Signed-off-by: Bjorn Andersson 

Patch applied.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] pinctrl-msm: Update Kconfig for PINCTRL_MSM8X74

2013-12-16 Thread Linus Walleij
On Sun, Dec 15, 2013 at 7:44 AM, Bjorn Andersson
 wrote:

> Add GPIOLIB and OF as dependencies for PINCTRL_MSM8X74, to fix
> build errors from i386-randconfig.
> Also add help text and make the entries tristate, while touching
> these entries.
>
> Cc: Stephen Boyd 
> Signed-off-by: Bjorn Andersson 

This didn't apply correctly as I had already made a fix to depend
on OF and OF_IRQ but I rebased this on top of that and applied,
check it in my tree or linux-next.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html