Re: [PATCH] gpio: Add device driver for GRGPIO cores

2013-02-04 Thread Andreas Larsson
the probe function. Of course general Open Firmware support could be added to gpio-generic, but in addition my probe needs to set up very hardware specific things for gpio_to_irq. Thank you for the feedback! Cheers, Andreas Larsson -- To unsubscribe from this list: send the line "unsubsc

Re: [PATCH] gpio: Add device driver for GRGPIO cores

2013-02-04 Thread Andreas Larsson
my competence so OK. Maybe Rob or Grant can say something. Might be a good idea. However, by just using bgpio_init in a separate driver (like most other users of bgpio_init), that would not be required or used by me anyhow. I'll look into using bgpio_init from my driver. Cheer

[PATCH 0/2] gpio: Fix gpio-generic bug and add driver for GRGPIO cores

2013-02-05 Thread Andreas Larsson
The second patch is v2 of the earlier single GRGPIO patch Andreas Larsson (2): gpio: gpio-generic: Fix bug in big endian bit conversion gpio: Add device driver for GRGPIO cores drivers/gpio/Kconfig|8 ++ drivers/gpio/Makefile |1 + drivers/gpio/gpio-generic.c |5

[PATCH 1/2] gpio: gpio-generic: Fix bug in big endian bit conversion

2013-02-05 Thread Andreas Larsson
The swap to convert LE to BE in bgpio_pin2mask_be should be on byte level, not on bit level. Signed-off-by: Andreas Larsson --- drivers/gpio/gpio-generic.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio/gpio-generic.c

[PATCH 2/2] gpio: Add device driver for GRGPIO cores

2013-02-05 Thread Andreas Larsson
This driver supports GRGPIO gpio cores available in the GRLIB VHDL IP core library. Signed-off-by: Andreas Larsson --- v2 of the eariler single GRGPIO patch drivers/gpio/Kconfig |8 ++ drivers/gpio/Makefile |1 + drivers/gpio/gpio-grgpio.c | 244

Re: [PATCH RESEND] spi: spi-fsl-spi: Make spi-fsl-spi usable in cpu mode outside of FSL SOC environments and add a grlib variant normally running on sparc

2013-02-06 Thread Andreas Larsson
On 2013-02-05 18:56, Grant Likely wrote: On Wed, 30 Jan 2013 13:15:24 +0100, Andreas Larsson wrote: This patch relies upon parts of the "of, of_gpio, of_spi: Fix and improve of_parse_phandle_with_args, of_gpio_named_count and of_spi_register_master" patchset - https://lkml.org/lkml/

[PATCH v2 0/7] spi: spi-fsl-spi: Make spi-fsl-spi usable in cpu mode outside of FSL SOC environments and add a grlib variant normally running on sparc

2013-02-07 Thread Andreas Larsson
d of using a new type field, but that would require to add a flag for this core in include/linux/fsl_devices.h which does not feel right given that this core is not part of an FSL device. Signed-off-by: Andreas Larsson Andreas Larsson (7): spi: spi-fsl-spi: Make driver usable in CPU mode out

[PATCH v2 6/7] spi: spi-fsl-spi: Add support for Aeroflex Gaisler GRLIB cores normally running on SPARC

2013-02-07 Thread Andreas Larsson
function differences exists but are not relevant to the driver. Signed-off-by: Andreas Larsson --- Documentation/devicetree/bindings/spi/fsl-spi.txt |2 +- .../devicetree/bindings/vendor-prefixes.txt|1 + drivers/spi/Kconfig|4 +- drivers/spi

[PATCH v2 1/7] spi: spi-fsl-spi: Make driver usable in CPU mode outside of an FSL_SOC environment

2013-02-07 Thread Andreas Larsson
devicetree probing a "clock-frequency" property is used for clock frequency instead of calls to FSL_SOC-specific functions. Signed-off-by: Andreas Larsson --- This introduces a lot of line changes, but to illustrate that large parts of is just moving between files you can run the

[PATCH v2 3/7] spi: spi-fsl-spi: Move setting non-zero tx and rx shifts to a function accessed by a function pointer

2013-02-07 Thread Andreas Larsson
Signed-off-by: Andreas Larsson --- drivers/spi/spi-fsl-lib.h |5 drivers/spi/spi-fsl-spi.c | 51 +++- 2 files changed, 36 insertions(+), 20 deletions(-) diff --git a/drivers/spi/spi-fsl-lib.h b/drivers/spi/spi-fsl-lib.h index d785595..eae54b6

[PATCH v2 7/7] spi: spi-fsl-spi: Add support for gpio chipselects for GRLIB type cores

2013-02-07 Thread Andreas Larsson
This relies upon of_spi_register_master to find out which gpios to use. Signed-off-by: Andreas Larsson --- drivers/spi/spi-fsl-lib.h |1 + drivers/spi/spi-fsl-spi.c | 53 +++- 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/drivers

[PATCH v2 5/7] spi: spi-fsl-spi: Add support for setting a maximum number of bits per word

2013-02-07 Thread Andreas Larsson
Signed-off-by: Andreas Larsson --- drivers/spi/spi-fsl-lib.h |1 + drivers/spi/spi-fsl-spi.c |8 +++- 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/drivers/spi/spi-fsl-lib.h b/drivers/spi/spi-fsl-lib.h index 5a9c36c..d5c788b 100644 --- a/drivers/spi/spi-fsl-lib.h

[PATCH v2 2/7] spi: spi-fsl-spi: Make sure in spi_fsl_setup that chipselect becomes inactive

2013-02-07 Thread Andreas Larsson
This is needed for a device in SPI_CS_HIGH mode that otherwise could start out active for the first transaction. Signed-off-by: Andreas Larsson --- drivers/spi/spi-fsl-spi.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi

[PATCH v2 4/7 RESEND] spi: spi-fsl-spi: Introduce a type for the driver

2013-02-07 Thread Andreas Larsson
For being able to distinguishing between the regular type of cores and others with different entries in of_fsl_spi_match. Signed-off-by: Andreas Larsson --- [Resent, as the mail for patch 4 seems to have been lost somehow] drivers/spi/spi-fsl-lib.h |2 ++ drivers/spi/spi-fsl-spi.c | 39

[PATCH v2 4/7] spi: spi-fsl-spi: Introduce a type for the driver

2013-02-07 Thread Andreas Larsson
For being able to distinguishing between the regular type of cores and others with different entries in of_fsl_spi_match. Signed-off-by: Andreas Larsson --- drivers/spi/spi-fsl-lib.h |2 ++ drivers/spi/spi-fsl-spi.c | 39 --- 2 files changed, 34

Re: [PATCH v2 7/7] spi: spi-fsl-spi: Add support for gpio chipselects for GRLIB type cores

2013-02-07 Thread Andreas Larsson
On 2013-02-07 17:08, Anton Vorontsov wrote: On Thu, Feb 07, 2013 at 02:12:11PM +0100, Andreas Larsson wrote: struct fsl_spi_reg *reg_base; - int retval; + int retval, desel; We don't usually place variable declarations on the same line, unless the variables are cl

Re: [PATCH] of: Create function for counting number of phandles in a property

2013-02-11 Thread Andreas Larsson
urn of_count_phandle_with_args(np, propname, "#gpio-cells"); +} Should this be static inline int? I think it would be good to also document that it also returns -ENOENT when the propname property is missing, which might be an important case to distinguish from the -EINVAL case. Che

[PATCH v3] gpio: Add device driver for GRGPIO cores and support custom accessors with gpio-generic

2013-02-11 Thread Andreas Larsson
: Andreas Larsson --- .../devicetree/bindings/gpio/gpio-grgpio.txt | 29 +++ drivers/gpio/Kconfig |8 + drivers/gpio/Makefile |1 + drivers/gpio/gpio-generic.c| 26 ++- drivers/gpio/gpio-grgpio.c

Re: [PATCH] of: Create function for counting number of phandles in a property

2013-02-12 Thread Andreas Larsson
f_gpio_named_count returns an error code. Cheers, Andreas Larsson -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH v2 5/6] of_spi: Add fetching of of_gpio flags to of_spi_register_master

2013-02-12 Thread Andreas Larsson
On 2013-02-11 01:22, Grant Likely wrote: On Tue, 29 Jan 2013 15:53:42 +0100, Andreas Larsson wrote: When using a gpio chip select with a OF_GPIO_ACTIVE_LOW flag, this needs to be known to the controller driver. Signed-off-by: Andreas Larsson Out of curiosity, what do you need the flags for

Re: [PATCH v2 6/6] of_spi: Initialize cs_gpios and cs_gpio with -EEXIST

2013-02-12 Thread Andreas Larsson
On 2013-02-11 01:23, Grant Likely wrote: On Tue, 29 Jan 2013 15:53:43 +0100, Andreas Larsson wrote: Holes in the cs-gpios DT phandle list is supposed to mark that native chipselects is to be used. The value returned from of_get_named_gpio_flags in this case is -EEXIST. By initializing cs_gpios

[PATCH v2 6/6] of_spi: Initialize cs_gpios and cs_gpio with -EEXIST

2013-01-29 Thread Andreas Larsson
native chipselect is to be used. Signed-off-by: Andreas Larsson --- drivers/spi/spi.c |4 ++-- include/linux/spi/spi.h |7 +-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 6f1b717..7494bad 100644 --- a/drivers/spi/spi.c

[PATCH v2 4/6] of_spi: Document cs_gpios and cs_gpio in kernel-doc

2013-01-29 Thread Andreas Larsson
This adds missing kernel-doc entries for cs_gpios in struct spi_master and cs_gpio in struct spi_device. Signed-off-by: Andreas Larsson --- include/linux/spi/spi.h |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index

[PATCH v2 2/6] of: Return -ENXIO from of_parse_phandle_with_args for too large index and return errors from of_gpio_named_count

2013-01-29 Thread Andreas Larsson
amed_count fails. Adjust various drivers cope with error return from of_gpio_named_count, including via of_gpio_count. Signed-off-by: Andreas Larsson --- Changes since v1: - Handle error return values from calls to of_gpio_count drivers/gpio/gpiolib-of.c |8 +--- drivers/

[PATCH v2 5/6] of_spi: Add fetching of of_gpio flags to of_spi_register_master

2013-01-29 Thread Andreas Larsson
When using a gpio chip select with a OF_GPIO_ACTIVE_LOW flag, this needs to be known to the controller driver. Signed-off-by: Andreas Larsson --- Documentation/devicetree/bindings/spi/spi-bus.txt |3 +- drivers/spi/spi.c | 24 ++-- include

[PATCH v2 3/6] of_spi: Initialize cs_gpios properly

2013-01-29 Thread Andreas Larsson
Using memset does not set an array of integers properly Signed-off-by: Andreas Larsson --- drivers/spi/spi.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 9c2acf1..a4baa0a 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi

[PATCH v2 0/6] of, of_gpio, of_spi: Bugfix and improve of_parse_phandle_with_args, of_gpio_named_count and of_spi_register_master

2013-01-29 Thread Andreas Larsson
, arm and ppc (all changed source files, when appropriate for platform) Changes since v1: - PATCH 2/6: Handle error return values from calls to of_gpio_count Andreas Larsson (6): of: Return -EEXIST from of_parse_phandle_with_args for holes in phandle list of: Return -ENXIO from

[PATCH v2 1/6] of: Return -EEXIST from of_parse_phandle_with_args for holes in phandle list

2013-01-29 Thread Andreas Larsson
returns -ENOENT. Also change the of selftest to expect -EEXIST in this case. Signed-off-by: Andreas Larsson --- I have only compile tested the selftest, not having appropriate hardware around for running it. drivers/of/base.c |4 ++-- drivers/of/selftest.c |2 +- 2 files changed, 3

Re: [PATCH] spi: spi-fsl-spi: Make spi-fsl-spi usable in cpu mode outside of FSL SOC environments and add a grlib variant normally running on sparc

2013-01-30 Thread Andreas Larsson
On 2012-12-28 17:16, Andreas Larsson wrote: This makes the cpu mode of the driver available outside of an FSL SOC and even powerpc environment. This is accomplished by putting things regarding fsl specific code and to cpm specific code within ifdefs. Furthermore, this adds support for the

Re: [PATCH] spi: spi-fsl-spi: Make spi-fsl-spi usable in cpu mode outside of FSL SOC environments and add a grlib variant normally running on sparc

2013-01-30 Thread Andreas Larsson
On 2013-01-30 11:36, Mark Brown wrote: On Wed, Jan 30, 2013 at 11:04:33AM +0100, Andreas Larsson wrote: On 2012-12-28 17:16, Andreas Larsson wrote: This makes the cpu mode of the driver available outside of an FSL SOC and even powerpc environment. This is accomplished by putting things

[PATCH RESEND] spi: spi-fsl-spi: Make spi-fsl-spi usable in cpu mode outside of FSL SOC environments and add a grlib variant normally running on sparc

2013-01-30 Thread Andreas Larsson
igned-off-by: Andreas Larsson --- [Resend to include more recipients] This patch relies upon parts of the "of, of_gpio, of_spi: Fix and improve of_parse_phandle_with_args, of_gpio_named_count and of_spi_register_master" patchset - https://lkml.org/lkml/2012/12/27/54 (v2 at https://lkml.

[PATCH] gpio: Add device driver for GRGPIO cores

2013-01-30 Thread Andreas Larsson
This driver supports GRGPIO gpio cores available in the GRLIB VHDL IP core library. Signed-off-by: Andreas Larsson --- drivers/gpio/Kconfig |7 + drivers/gpio/Makefile |1 + drivers/gpio/gpio-grgpio.c | 313 3 files changed, 321

Re: [PATCH 1/2] gpio: gpio-generic: Fix bug in big endian bit conversion

2013-02-26 Thread Andreas Larsson
On 2013-02-26 08:52, Grant Likely wrote: On Sat, 09 Feb 2013 14:58:55 +, Grant Likely wrote: On Tue, 5 Feb 2013 11:33:02 +0100, Andreas Larsson wrote: The swap to convert LE to BE in bgpio_pin2mask_be should be on byte level, not on bit level. Signed-off-by: Andreas Larsson

Re: [PATCH 1/2] gpio: gpio-generic: Fix bug in big endian bit conversion

2013-02-26 Thread Andreas Larsson
On 2013-02-26 11:46, Andreas Larsson wrote: On 2013-02-26 08:52, Grant Likely wrote: On Sat, 09 Feb 2013 14:58:55 +, Grant Likely wrote: We /could/ have a ioread32be/write32be mode in the driver, but I don't think that is the right approach. It means we need yet another set of acce

[PATCH v5 0/3] gpio: Add device driver for GRGPIO cores and support custom accessors with gpio-generic

2013-03-15 Thread Andreas Larsson
Signed-off-by: Andreas Larsson Andreas Larsson (3): gpio: gpio-generic: Add 16 and 32 bit big endian byte order support gpio: grgpio: Add device driver for GRGPIO cores gpio: grgpio: Add irq support .../devicetree/bindings/gpio/gpio-grgpio.txt | 29 ++ drivers/gpio/Kconfig

[PATCH v5 2/3] gpio: grgpio: Add device driver for GRGPIO cores

2013-03-15 Thread Andreas Larsson
This driver supports GRGPIO gpio cores available in the GRLIB VHDL IP core library from Aeroflex Gaisler. Signed-off-by: Andreas Larsson --- .../devicetree/bindings/gpio/gpio-grgpio.txt | 24 +++ drivers/gpio/Kconfig |9 ++ drivers/gpio/Makefile

[PATCH v5 3/3] gpio: grgpio: Add irq support

2013-03-15 Thread Andreas Larsson
The drivers sets up an irq domain and hands out unique virqs to irq capable gpio lines regardless of which underlying irqs maps to which gpio line. Signed-off-by: Andreas Larsson --- .../devicetree/bindings/gpio/gpio-grgpio.txt |5 + drivers/gpio/gpio-grgpio.c

[PATCH v5 1/3] gpio: gpio-generic: Add 16 and 32 bit big endian byte order support

2013-03-15 Thread Andreas Larsson
There is no general support for 64-bit big endian accesses, so that is left unsupported. Signed-off-by: Andreas Larsson --- drivers/gpio/gpio-generic.c | 56 --- include/linux/basic_mmio_gpio.h |1 + 2 files changed, 48 insertions(+), 9 deletions

[PATCH 1/2] i2c: i2c-ocores: Add irq support for sparc

2012-10-23 Thread Andreas Larsson
There are no platform resources of type IORESOURCE_IRQ on sparc, so the irq number is acquired in a different manner for sparc. The general case uses platform_get_irq, that internally still uses platform_get_resource. Signed-off-by: Andreas Larsson --- drivers/i2c/busses/i2c-ocores.c | 13

[PATCH 0/2] i2c: i2c-ocores: Add support for sparc, custom set and get functions, and the GRLIB port of the controller

2012-10-23 Thread Andreas Larsson
deal with the fact that the PRELOW and PREHIGH registers have been merged into one register. Signed-off-by: Andreas Larsson Andreas Larsson (2): i2c: i2c-ocores: Add irq support for sparc i2c: i2c-ocores: Add support for the GRLIB port of the controller and custom getreg and setreg

[PATCH 2/2] i2c: i2c-ocores: Add support for the GRLIB port of the controller and custom getreg and setreg functions

2012-10-23 Thread Andreas Larsson
custom getreg and setreg functions. Signed-off-by: Andreas Larsson --- drivers/i2c/busses/i2c-ocores.c | 57 +- 1 files changed, 55 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c index 1eb8a65

Re: [PATCH 2/2] i2c: i2c-ocores: Add support for the GRLIB port of the controller and custom getreg and setreg functions

2012-10-24 Thread Andreas Larsson
On 10/23/2012 10:24 PM, Peter Korsgaard wrote: "Andreas" == Andreas Larsson writes: [...] Andreas> +/* Read and write functions for the GRLIB port of the controller. Registers are Andreas> + * 32-bit big endian and the PRELOW and PREHIGH registers are merged in

Re: [PATCH 1/2] i2c: i2c-ocores: Add irq support for sparc

2012-10-24 Thread Andreas Larsson
On 10/23/2012 10:13 PM, Peter Korsgaard wrote: "Andreas" == Andreas Larsson writes: Andreas> There are no platform resources of type IORESOURCE_IRQ on Andreas> sparc, so the irq number is acquired in a different manner for Andreas> sparc. The general case uses pla

[PATCH] of/address: sparc: Declare of_address_to_resource() as an extern function for sparc again

2012-11-02 Thread Andreas Larsson
A similar solution is already in place for irq_of_parse_and_map() in include/linux/of_irq.h. Signed-off-by: Andreas Larsson --- include/linux/of_address.h | 22 +++--- 1 files changed, 15 insertions(+), 7 deletions(-) diff --git a/include/linux/of_address.h b/include/linux/of_addre

Re: [PATCH] of/address: sparc: Declare of_address_to_resource() as an extern function for sparc again

2012-11-05 Thread Andreas Larsson
On 2012-11-02 18:53, Sam Ravnborg wrote: Hi Andreas. On Fri, Nov 02, 2012 at 12:03:56PM +0100, Andreas Larsson wrote: This bug-fix makes sure that of_address_to_resource is defined extern for sparc so that the sparc-specific implementation of of_address_to_resource() is once again used when

[PATCH v2] of/address: sparc: Declare of_address_to_resource() as an extern function for sparc again

2012-11-05 Thread Andreas Larsson
ned-off-by: Andreas Larsson --- arch/sparc/include/asm/prom.h |5 + include/linux/of_address.h|2 ++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/arch/sparc/include/asm/prom.h b/arch/sparc/include/asm/prom.h index c287651..f930031 100644 --- a/arch/sparc/include/

[PATCH v3] sparc: Add sparc support for platform_get_irq()

2012-10-30 Thread Andreas Larsson
on sparc instead of having to have a special case for sparc. Signed-off-by: Andreas Larsson --- drivers/base/platform.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/base/platform.c b/drivers/base/platform.c index ddeca14..9c2f828 100644 --- a/drivers/base

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-26 Thread Andreas Larsson
On 2013-08-26 12:56, Lars Poeschel wrote: Hi Andreas! On Thursday 22 August 2013 at 15:16:18, Andreas Larsson wrote: On 2013-08-21 15:38, Lars Poeschel wrote: +static void of_gpio_scan_irq_lines(const struct device_node *const node, +struct device_node *const gcn

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-26 Thread Andreas Larsson
On 2013-08-26 16:04, Lars Poeschel wrote: On Monday 26 August 2013 at 13:29:07, Andreas Larsson wrote: On 2013-08-26 12:56, Lars Poeschel wrote: This call to of_irq_find_parent breaks gpiolib-of for SPARC due to the fact that the function is undefined when !defined(CONFIG_OF_IRQ) &&

[PATCH] of: Define of_irq_find_parent dummy for !defined(CONFIG_OF_IRQ)

2013-08-27 Thread Andreas Larsson
This changes the dummy version of of_irq_find_parent to be defined when !defined(CONFIG_OF_IRQ) instead of when !defined(CONFIG_OF). Without this of_irq_find_parent is undefined on SPARC that defines CONFIG_OF but not CONFIG_OF_IRQ. Signed-off-by: Andreas Larsson --- include/linux/of_irq.h

Re: [PATCH] of: Define of_irq_find_parent dummy for !defined(CONFIG_OF_IRQ)

2013-08-27 Thread Andreas Larsson
On 2013-08-27 15:12, Rob Herring wrote: On Tue, Aug 27, 2013 at 2:57 AM, Andreas Larsson wrote: This changes the dummy version of of_irq_find_parent to be defined when !defined(CONFIG_OF_IRQ) instead of when !defined(CONFIG_OF). Without this of_irq_find_parent is undefined on SPARC that

Re: [PATCH] usb: gadget: Add UDC driver for Aeroflex Gaisler GRUSBDC

2013-08-28 Thread Andreas Larsson
On 2013-08-12 16:05, Andreas Larsson wrote: This adds an UDC driver for GRUSBDC USB Device Controller cores available in the GRLIB VHDL IP core library. The driver only supports DMA mode. Any comments? It would be great to get feedback soon in case some things need to be changed for this

Re: [PATCH] usb: gadget: Add UDC driver for Aeroflex Gaisler GRUSBDC

2013-10-02 Thread Andreas Larsson
On 2013-10-01 16:19, Felipe Balbi wrote: Hi, On Tue, Oct 01, 2013 at 10:34:47AM +0200, Andreas Larsson wrote: +/* #define VERBOSE_DEBUG */ we don't want this, we want verbose debug to be selectable on Kconfig, which already is ;-) I was only aware of CONFIG_USB_GADGET_DEBUG leadi

Re: [PATCH] usb: gadget: Add UDC driver for Aeroflex Gaisler GRUSBDC

2013-09-08 Thread Andreas Larsson
On 2013-08-28 11:02, Andreas Larsson wrote: On 2013-08-12 16:05, Andreas Larsson wrote: This adds an UDC driver for GRUSBDC USB Device Controller cores available in the GRLIB VHDL IP core library. The driver only supports DMA mode. Any comments? It would be great to get feedback soon in case

Re: [PATCH] usb: gadget: Add UDC driver for Aeroflex Gaisler GRUSBDC

2013-10-01 Thread Andreas Larsson
Hi! Thank you for the feedback! Sorry for the delayed response back. Responses inline. On 2013-09-18 19:15, Felipe Balbi wrote: Hi, On Mon, Aug 12, 2013 at 04:05:10PM +0200, Andreas Larsson wrote: diff --git a/drivers/usb/gadget/gr_udc.c b/drivers/usb/gadget/gr_udc.c new file mode 100644

[PATCH v2 1/2] i2c: i2c-ocores: Add irq support for sparc

2012-11-12 Thread Andreas Larsson
Add sparc support by using platform_get_irq instead of platform_get_resource. There are no platform resources of type IORESOURCE_IRQ for sparc, but platform_get_irq works for sparc. In the non-sparc case platform_get_irq internally uses platform_get_resource. Signed-off-by: Andreas Larsson Acked

[PATCH v2 0/2] i2c: i2c-ocores: Add support for sparc, custom set and get functions, and the GRLIB port of the controller

2012-11-12 Thread Andreas Larsson
register access and to deal with the fact that the PRELOW and PREHIGH registers have been merged into one register. Signed-off-by: Andreas Larsson Changes since v1: - platform_get_irq now works for sparc, so that is used for all platforms - Acks by Peter Korsgaard Andreas Larsson (2): i2c: i2c

[PATCH v2 2/2] i2c: i2c-ocores: Add support for the GRLIB port of the controller and custom getreg and setreg functions

2012-11-12 Thread Andreas Larsson
custom getreg and setreg functions. Signed-off-by: Andreas Larsson Acked-by: Peter Korsgaard --- Changes since v1: - Acked by Peter Korsgaard drivers/i2c/busses/i2c-ocores.c | 57 +- 1 files changed, 55 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH v3 1/2] i2c: i2c-ocores: Add irq support for sparc

2012-11-13 Thread Andreas Larsson
Add sparc support by using platform_get_irq instead of platform_get_resource. There are no platform resources of type IORESOURCE_IRQ for sparc, but platform_get_irq works for sparc. In the non-sparc case platform_get_irq internally uses platform_get_resource. Signed-off-by: Andreas Larsson Acked

[PATCH v3 2/2] i2c: i2c-ocores: Add support for the GRLIB port of the controller and custom getreg and setreg functions

2012-11-13 Thread Andreas Larsson
custom getreg and setreg functions. Signed-off-by: Andreas Larsson Acked-by: Peter Korsgaard --- Changes since v2: - Trigger usage of the the grlib specific functions on compatible property instead of name drivers/i2c/busses/i2c-ocores.c | 55 +- 1

[PATCH v3 0/2] i2c: i2c-ocores: Add support for sparc, custom set and get functions, and the GRLIB port of the controller

2012-11-13 Thread Andreas Larsson
register access and to deal with the fact that the PRELOW and PREHIGH registers have been merged into one register. Signed-off-by: Andreas Larsson Changes since v2: - Return error from platform_get_irq on error - Trigger usage of the grlib specific functions on compatible property instead of name

Re: [PATCH v3 2/2] i2c: i2c-ocores: Add support for the GRLIB port of the controller and custom getreg and setreg functions

2012-11-15 Thread Andreas Larsson
On 2012-11-13 23:45, Peter Korsgaard wrote: "Andreas" == Andreas Larsson writes: Hi, Andreas> The registers in the GRLIB port of the controller are 32-bit Andreas> and in big endian byte order. The PRELOW and PREHIGH registers Andreas> are merged into one regis

[PATCH v4 2/2] i2c: i2c-ocores: Add support for the GRLIB port of the controller and custom getreg and setreg functions

2012-11-15 Thread Andreas Larsson
custom getreg and setreg functions. A type is added as the data of the of match table entries. A new entry with a different compatible string is added to the table. The type of that entry triggers usage of the grlib functions. Signed-off-by: Andreas Larsson --- Changes since v3: - Use a separate

[PATCH v4 0/2] i2c: i2c-ocores: Add support for sparc, custom set and get functions, and the GRLIB port of the controller

2012-11-15 Thread Andreas Larsson
register access and to deal with the fact that the PRELOW and PREHIGH registers have been merged into one register. Signed-off-by: Andreas Larsson Changes since v3: - Use a separate entry in the of match table for the grlib variant and trigger grlib function usage on type put in the data field of

[PATCH v4 1/2] i2c: i2c-ocores: Add irq support for sparc

2012-11-15 Thread Andreas Larsson
Add sparc support by using platform_get_irq instead of platform_get_resource. There are no platform resources of type IORESOURCE_IRQ for sparc, but platform_get_irq works for sparc. In the non-sparc case platform_get_irq internally uses platform_get_resource. Signed-off-by: Andreas Larsson Acked

[PATCH v5 0/2] i2c: i2c-ocores: Add support for sparc, custom set and get functions, and the GRLIB port of the controller

2012-11-15 Thread Andreas Larsson
register access and to deal with the fact that the PRELOW and PREHIGH registers have been merged into one register. Signed-off-by: Andreas Larsson Changes since v4: - Replace the ocores_get_type function with inline code in the probe function - Replace the oc_(get|set)reg functions with oc_(get|set)reg_

[PATCH v5 2/2] i2c: i2c-ocores: Add support for the GRLIB port of the controller and use function pointers for getreg and setreg functions

2012-11-15 Thread Andreas Larsson
-off-by: Andreas Larsson --- Changes since v4: - Replace the ocores_get_type function with inline code in the probe function - Replace the oc_(get|set)reg functions with oc_(get|set)reg_(8|16|32) functions and always use the function pointers to call them. .../devicetree/bindings/i2c/i2c

[PATCH v5 1/2] i2c: i2c-ocores: Add irq support for sparc

2012-11-15 Thread Andreas Larsson
Add sparc support by using platform_get_irq instead of platform_get_resource. There are no platform resources of type IORESOURCE_IRQ for sparc, but platform_get_irq works for sparc. In the non-sparc case platform_get_irq internally uses platform_get_resource. Signed-off-by: Andreas Larsson Acked

[PATCH v3] of/address: sparc: Declare of_address_to_resource() as an extern function for sparc again

2012-11-06 Thread Andreas Larsson
suggested by: Sam Ravnborg Signed-off-by: Andreas Larsson Acked-by: Rob Herring --- arch/sparc/include/asm/prom.h |5 + include/linux/of_address.h|2 ++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/arch/sparc/include/asm/prom.h b/arch/sparc/include/asm/pr

[PATCH 0/6] of, of_gpio, of_spi: Fix and improve of_parse_phandle_with_args, of_gpio_named_count and of_spi_register_master

2012-12-27 Thread Andreas Larsson
fetching of gpio flags and initializes gpio values to be consistent with return values from of_parse_phandle_with_args. Tested on sparc. Build tested on x86, arm and ppc. Andreas Larsson (6): of: Return -EEXIST from of_parse_phandle_with_args for holes in phandle list of: Return -ENXIO

[PATCH 3/6] of_spi: Initialize cs_gpios properly

2012-12-27 Thread Andreas Larsson
Using memset does not set an array of integers properly Signed-off-by: Andreas Larsson --- drivers/spi/spi.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 9c2acf1..a4baa0a 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi

[PATCH 5/6] of_spi: Add fetching of of_gpio flags to of_spi_register_master

2012-12-27 Thread Andreas Larsson
When using a gpio chip select with a OF_GPIO_ACTIVE_LOW flag, this needs to be known to the controller driver. Signed-off-by: Andreas Larsson --- Documentation/devicetree/bindings/spi/spi-bus.txt |3 +- drivers/spi/spi.c | 24 ++-- include

[PATCH 4/6] of_spi: Document cs_gpios and cs_gpio in kernel-doc

2012-12-27 Thread Andreas Larsson
This adds missing kernel-doc entries for cs_gpios in struct spi_master and cs_gpio in struct spi_device. Signed-off-by: Andreas Larsson --- include/linux/spi/spi.h |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index

[PATCH 6/6] of_spi: Initialize cs_gpios and cs_gpio with -EEXIST

2012-12-27 Thread Andreas Larsson
native chipselect is to be used. Signed-off-by: Andreas Larsson --- drivers/spi/spi.c |4 ++-- include/linux/spi/spi.h |7 +-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 6f1b717..7494bad 100644 --- a/drivers/spi/spi.c

[PATCH 1/6] of: Return -EEXIST from of_parse_phandle_with_args for holes in phandle list

2012-12-27 Thread Andreas Larsson
returns -ENOENT. Also change the of selftest to expect -EEXIST in this case. Signed-off-by: Andreas Larsson --- I have not run-tested the selftest, not having appropriate hardware around for that. drivers/of/base.c |4 ++-- drivers/of/selftest.c |2 +- 2 files changed, 3 insertions

[PATCH 2/6] of: Return -ENXIO from of_parse_phandle_with_args for too large index and return errors from of_gpio_named_count

2012-12-27 Thread Andreas Larsson
amed_count fails. Adjust drivers/hwmon/gpio-fan.c to cope with error return. Signed-off-by: Andreas Larsson --- Uses -ENXIO modelled after uses such as in platform_get_irq, but maybe some other errno than ENXIO is more appropriate for this case. drivers/gpio/gpiolib-of.c |8 +--- dri

Re: [PATCH 2/6] of: Return -ENXIO from of_parse_phandle_with_args for too large index and return errors from of_gpio_named_count

2012-12-28 Thread Andreas Larsson
On 2012-12-27 13:10, Andreas Larsson wrote: This lets of_gpio_named_count return an errno on errors by being able to distinguish between reaching the end of the phandle list and getting some other error from of_parse_phandle_with_args. Return error from of_spi_register_master when there is an

[PATCH] spi: spi-fsl-spi: Make spi-fsl-spi usable in cpu mode outside of FSL SOC environments and add a grlib variant normally running on sparc

2012-12-28 Thread Andreas Larsson
igned-off-by: Andreas Larsson --- This patch relies upon parts of the "of, of_gpio, of_spi: Fix and improve of_parse_phandle_with_args, of_gpio_named_count and of_spi_register_master" patchset - https://lkml.org/lkml/2012/12/27/54. The grlib type has been tested under sparc, but the fs

[PATCH v6 1/2] i2c: i2c-ocores: Add irq support for sparc

2012-11-15 Thread Andreas Larsson
Add sparc support by using platform_get_irq instead of platform_get_resource. There are no platform resources of type IORESOURCE_IRQ for sparc, but platform_get_irq works for sparc. In the non-sparc case platform_get_irq internally uses platform_get_resource. Signed-off-by: Andreas Larsson Acked

[PATCH v6 2/2] i2c: i2c-ocores: Add support for the GRLIB port of the controller and use function pointers for getreg and setreg functions

2012-11-15 Thread Andreas Larsson
added to the table. The type of that entry triggers usage of the custom grlib functions by setting the setreg and getreg function pointers. Signed-off-by: Andreas Larsson --- Changes since v5: - Function pointers for different widths are set together - oc_setreg and oc_getreg are kept as wrappers

[PATCH v6 0/2] i2c: i2c-ocores: Add support for sparc, custom set and get functions, and the GRLIB port of the controller

2012-11-15 Thread Andreas Larsson
register access and to deal with the fact that the PRELOW and PREHIGH registers have been merged into one register. Signed-off-by: Andreas Larsson Changes since v5: - Function pointers for different widths are set together - oc_setreg and oc_getreg are kept as wrappers Andreas Larsson (2): i2c: i2c

[PATCH v6 1/2] gpio: grgpio: Add device driver for GRGPIO cores

2013-04-17 Thread Andreas Larsson
This driver supports GRGPIO gpio cores available in the GRLIB VHDL IP core library from Aeroflex Gaisler. Signed-off-by: Andreas Larsson --- Changes since v5: - register accesses via base + constant - no base irq number from device tree - no empty irq-handler .../devicetree/bindings/gpio/gpio

[PATCH v6 0/2] gpio: Add device driver for GRGPIO cores

2013-04-17 Thread Andreas Larsson
ock in irq-handler - add warning printout in irq-handler if no gpio line matches irq Andreas Larsson (2): gpio: grgpio: Add device driver for GRGPIO cores gpio: grgpio: Add irq support .../devicetree/bindings/gpio/gpio-grgpio.txt | 26 + drivers/gpio/Kconfig

[PATCH v6 2/2] gpio: grgpio: Add irq support

2013-04-17 Thread Andreas Larsson
The drivers sets up an irq domain and hands out unique irqs to irq capable gpio lines regardless of how underlying irq maps to gpio lines. Any gpio line can map to any one or none of the irqs of the core, independently of each other. Signed-off-by: Andreas Larsson --- Changes since v5

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-22 Thread Andreas Larsson
would be good if of_gpiochip_reserve_irq_lines is just an empty dummy or something like that when !defined(CONFIG_OF_IRQ). Cheers, Andreas Larsson -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More

Re: [PATCH v3] gpio: Add device driver for GRGPIO cores and support custom accessors with gpio-generic

2013-03-04 Thread Andreas Larsson
On 2013-03-01 01:24, Linus Walleij wrote: On Tue, Feb 12, 2013 at 8:24 AM, Andreas Larsson wrote: This driver supports GRGPIO gpio cores available in the GRLIB VHDL IP core library from Aeroflex Gaisler. This also adds support to gpio-generic for using custom accessor functions. The grgpio

Re: [PATCH] drivers: net: can: grcan: use devm_ioremap_resource()

2013-05-14 Thread Andreas Larsson
_ioremap_resource(&ofdev->dev, res); + if (IS_ERR(base)) { + err = PTR_ERR(base); goto exit_error; } Acked-by: Andreas Larsson -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to maj

Re: [PATCH v3] gpio: Add device driver for GRGPIO cores and support custom accessors with gpio-generic

2013-03-08 Thread Andreas Larsson
On Thu, 2013-03-07 at 04:44 +0100, Linus Walleij wrote: > On Mon, Mar 4, 2013 at 10:46 AM, Andreas Larsson wrote: > > [Me] > >>> +struct grgpio_priv { > >>> + struct bgpio_chip bgc; > >>> + struct grgpio_regs __iomem *regs; > >&g

Re: [PATCH v3 4/5] of: Create function for counting number of phandles in a property

2013-02-13 Thread Andreas Larsson
Likely Cc: Linus Walleij Cc: Rob Herring Cc: Andreas Larsson Tested-by: Andreas Larsson Cheers, Andreas Larsson -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.

Re: [PATCH v3 5/5] gpio: Make of_count_named_gpios() use new of_count_phandle_with_args()

2013-02-13 Thread Andreas Larsson
x27;int' so that it can return an error code. All the users of that function are fixed up to correctly handle a negative return value. v2: Split GPIO portion into a separate patch Signed-off-by: Grant Likely Cc: Linus Walleij Cc: Rob Herring Cc: Andreas Larsson For gpiolib-of.c, of_gpi

[PATCH] spi: Initialize cs_gpio and cs_gpios with -ENOENT

2013-02-13 Thread Andreas Larsson
GPIO line should not be used for the given spi_device. This sets the default value of cs_gpio in struct spi_device and entries of cs_gpios in struct spi_master to -ENOENT. Thus, -ENOENT is the only value used to indicate that no GPIO line should be used. Signed-off-by: Andreas Larsson --- To be appl

[PATCH] of: spi: Return error from of_spi_register_master on bad "cs-gpios" property

2013-02-13 Thread Andreas Larsson
used it is important that failure to read a broken "cs-gpios" property does not silently fail leading to the spi controller to use an unintended chipselect. Signed-off-by: Andreas Larsson --- Can only be applied to devicetree/next as it builds upon the "of: Add helper for count

Re: [PATCH v3] gpio: Add device driver for GRGPIO cores and support custom accessors with gpio-generic

2013-02-13 Thread Andreas Larsson
On 2013-02-13 08:05, Anton Vorontsov wrote: On Tue, Feb 12, 2013 at 08:24:33AM +0100, Andreas Larsson wrote: + res = platform_get_resource(ofdev, IORESOURCE_MEM, 0); + regs = devm_request_and_ioremap(&ofdev->dev, res); Just wonder, is it safe to pass null

[PATCH] gpio: Add device driver for GRGPIO cores and support custom accessors with gpio-generic

2013-02-13 Thread Andreas Larsson
Vorontsov Signed-off-by: Andreas Larsson --- Changes since v3: - Add Reveiwed-by - Fix pointed out style issues - Use np->full_name directly instead of kstrdup'ing it as it is a const char* - Call gpiochip_remove in grgpio_remove .../devicetree/bindings/gpio/gpio-grgpio.txt

[PATCH v4 RESEND] gpio: Add device driver for GRGPIO cores and support custom accessors with gpio-generic

2013-02-14 Thread Andreas Larsson
Vorontsov Signed-off-by: Andreas Larsson --- [Resent as I forgot to mark it as v4] Changes since v3: - Add Reveiwed-by - Fix pointed out style issues - Use np->full_name directly instead of kstrdup'ing it as it is a const char* - Call gpiochip_remove in grgpio_remove .../devicetree/

[PATCH v3 4/7] spi: spi-fsl-spi: Introduce a type for the driver

2013-02-15 Thread Andreas Larsson
For being able to distinguishing between the regular type of cores and others with different entries in of_fsl_spi_match. Acked-by: Anton Vorontsov Signed-off-by: Andreas Larsson --- drivers/spi/spi-fsl-lib.h |2 ++ drivers/spi/spi-fsl-spi.c | 39

[PATCH v3 6/7] spi: spi-fsl-spi: Add support for Aeroflex Gaisler GRLIB cores normally running on SPARC

2013-02-15 Thread Andreas Larsson
function differences exists but are not relevant to the driver. Acked-by: Anton Vorontsov Signed-off-by: Andreas Larsson --- Documentation/devicetree/bindings/spi/fsl-spi.txt |2 +- .../devicetree/bindings/vendor-prefixes.txt|1 + drivers/spi/Kconfig

[PATCH v3 2/7] spi: spi-fsl-spi: Make sure in spi_fsl_setup that chipselect becomes inactive

2013-02-15 Thread Andreas Larsson
This is needed for a device in SPI_CS_HIGH mode that otherwise could start out active for the first transaction. Acked-by: Anton Vorontsov Signed-off-by: Andreas Larsson --- drivers/spi/spi-fsl-spi.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/spi/spi

[PATCH v3 0/7] spi: spi-fsl-spi: Make spi-fsl-spi usable in cpu mode outside of FSL SOC environments and add a grlib variant normally running on sparc

2013-02-15 Thread Andreas Larsson
ag for this core in include/linux/fsl_devices.h which does not feel right given that this core is not part of an FSL device. Signed-off-by: Andreas Larsson Andreas Larsson (7): spi: spi-fsl-spi: Make driver usable in CPU mode outside of an FSL_SOC environment spi: spi-fsl-spi: Make sure in spi_

[PATCH v3 7/7] spi: spi-fsl-spi: Add support for gpio chipselects for GRLIB type cores

2013-02-15 Thread Andreas Larsson
This relies upon of_spi_register_master to find out which gpios to use. Acked-by: Anton Vorontsov Signed-off-by: Andreas Larsson --- drivers/spi/spi-fsl-lib.h |1 + drivers/spi/spi-fsl-spi.c | 50 2 files changed, 46 insertions(+), 5 deletions

  1   2   >