[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 andr...@gaisler.com --- 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

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

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

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
-by: Andreas Larsson andr...@gaisler.com --- 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

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

2012-11-06 Thread Andreas Larsson
by: Sam Ravnborg s...@ravnborg.org Signed-off-by: Andreas Larsson andr...@gaisler.com Acked-by: Rob Herring rob.herr...@calxeda.com --- 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

[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 andr...@gaisler.com --- drivers/i2c/busses/i2c

[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
and to deal with the fact that the PRELOW and PREHIGH registers have been merged into one register. Signed-off-by: Andreas Larsson andr...@gaisler.com 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

[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 andr...@gaisler.com --- 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

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 andr...@gaisler.com 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 into one

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 andr...@gaisler.com 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

[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 andr

[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 andr...@gaisler.com Changes since v1: - platform_get_irq now works for sparc, so that is used for all platforms - Acks by Peter Korsgaard jac...@sunsite.dk

[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 andr...@gaisler.com Acked-by: Peter Korsgaard jac...@sunsite.dk --- Changes since v1: - Acked by Peter Korsgaard jac...@sunsite.dk drivers/i2c/busses/i2c-ocores.c | 57 +- 1 files changed, 55

[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 andr

[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 andr...@gaisler.com Acked-by: Peter Korsgaard jac...@sunsite.dk --- Changes since v2: - Trigger usage of the the grlib specific functions on compatible property instead of name drivers/i2c/busses/i2c-ocores.c | 55

[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 andr...@gaisler.com Changes since v2: - Return error from platform_get_irq on error - Trigger usage of the grlib specific functions on compatible property

[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 andr...@gaisler.com --- Changes since v5: - register accesses via base + constant - no base irq number from device tree - no empty irq-handler .../devicetree

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

2013-04-17 Thread Andreas Larsson
- 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 |9

[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 andr...@gaisler.com --- Changes

[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 andr...@gaisler.com 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

[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 andr...@gaisler.com --- .../devicetree/bindings/gpio/gpio-grgpio.txt | 24 +++ drivers/gpio/Kconfig |9 ++ drivers

[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 andr...@gaisler.com --- .../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 andr...@gaisler.com --- drivers/gpio/gpio-generic.c | 56 --- include/linux/basic_mmio_gpio.h |1 + 2 files changed, 48 insertions

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 andr...@gaisler.com wrote: [Me] +struct grgpio_priv { + struct bgpio_chip bgc; + struct grgpio_regs __iomem *regs; + + u32 imask; /* irq mask shadow register

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 andr...@gaisler.com 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

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 closely

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

2013-02-11 Thread Andreas Larsson
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. Cheers, Andreas Larsson -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord

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

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

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

2013-02-12 Thread Andreas Larsson
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 andr...@gaisler.com 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 andr...@gaisler.com Out

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 andr...@gaisler.com 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

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

2013-02-13 Thread Andreas Larsson
Likely grant.lik...@secretlab.ca Cc: Linus Walleij linus.wall...@linaro.org Cc: Rob Herring rob.herr...@calxeda.com Cc: Andreas Larsson andr...@gaisler.com Tested-by: Andreas Larsson andr...@gaisler.com Cheers, Andreas Larsson -- To unsubscribe from this list: send the line unsubscribe linux

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

2013-02-13 Thread Andreas Larsson
: Andreas Larsson andr...@gaisler.com For gpiolib-of.c, of_gpio.h and spi.c: Tested-by: Andreas Larsson andr...@gaisler.com 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

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

2013-02-13 Thread Andreas Larsson
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 andr...@gaisler.com

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

2013-02-13 Thread Andreas Larsson
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 andr...@gaisler.com --- Can only be applied to devicetree/next as it builds upon the of: Add helper for counting phandle refernces patch

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 res

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

2013-02-04 Thread Andreas Larsson
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 unsubscribe linux-kernel in the body of a message

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

2013-02-04 Thread Andreas Larsson
. 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. Cheers, Andreas Larsson

[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 andr...@gaisler.com --- drivers/gpio/gpio-generic.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio

[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 andr...@gaisler.com --- 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 andr...@gaisler.com 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

[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
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 andr...@gaisler.com Andreas Larsson (7): spi: spi-fsl-spi: Make driver usable in CPU mode

[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
and function differences exists but are not relevant to the driver. Signed-off-by: Andreas Larsson andr...@gaisler.com --- Documentation/devicetree/bindings/spi/fsl-spi.txt |2 +- .../devicetree/bindings/vendor-prefixes.txt|1 + drivers/spi/Kconfig

[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
. For devicetree probing a clock-frequency property is used for clock frequency instead of calls to FSL_SOC-specific functions. Signed-off-by: Andreas Larsson andr...@gaisler.com --- This introduces a lot of line changes, but to illustrate that large parts of is just moving between files you can run

[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 andr...@gaisler.com --- 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

[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 andr...@gaisler.com --- drivers/spi/spi-fsl-lib.h |1 + drivers/spi/spi-fsl-spi.c | 53 +++- 2 files changed, 48 insertions(+), 6 deletions

[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 andr...@gaisler.com --- 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

[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 andr...@gaisler.com --- drivers/spi/spi-fsl-spi.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/spi/spi-fsl-spi.c

[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 andr...@gaisler.com --- [Resent, as the mail for patch 4 seems to have been lost somehow] drivers/spi/spi-fsl-lib.h |2 ++ drivers/spi/spi

[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 andr...@gaisler.com --- drivers/spi/spi-fsl-lib.h |2 ++ drivers/spi/spi-fsl-spi.c | 39 --- 2 files

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

2013-01-29 Thread Andreas Larsson
that a native chipselect is to be used. Signed-off-by: Andreas Larsson andr...@gaisler.com --- 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

[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 andr...@gaisler.com --- include/linux/spi/spi.h |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/linux/spi/spi.h b/include

[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
fails. Adjust various drivers cope with error return from of_gpio_named_count, including via of_gpio_count. Signed-off-by: Andreas Larsson andr...@gaisler.com --- Changes since v1: - Handle error return values from calls to of_gpio_count drivers/gpio/gpiolib-of.c |8

[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 andr...@gaisler.com --- Documentation/devicetree/bindings/spi/spi-bus.txt |3 +- drivers/spi/spi.c | 24

[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 andr...@gaisler.com --- 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

[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 andr...@gaisler.com --- 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

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

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
-off-by: Andreas Larsson andr...@gaisler.com --- [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

[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 andr...@gaisler.com --- drivers/gpio/Kconfig |7 + drivers/gpio/Makefile |1 + drivers/gpio/gpio-grgpio.c | 313 3

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 grant.lik...@secretlab.ca wrote: On Tue, 5 Feb 2013 11:33:02 +0100, Andreas Larsson andr...@gaisler.com wrote: The swap to convert LE to BE in bgpio_pin2mask_be should be on byte level, not on bit level

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 grant.lik...@secretlab.ca 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

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

2013-02-13 Thread Andreas Larsson
Vorontsov an...@enomsg.org Signed-off-by: Andreas Larsson andr...@gaisler.com --- 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

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

2013-02-14 Thread Andreas Larsson
Vorontsov an...@enomsg.org Signed-off-by: Andreas Larsson andr...@gaisler.com --- [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

[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 an...@enomsg.org Signed-off-by: Andreas Larsson andr...@gaisler.com --- 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
and function differences exists but are not relevant to the driver. Acked-by: Anton Vorontsov an...@enomsg.org Signed-off-by: Andreas Larsson andr...@gaisler.com --- Documentation/devicetree/bindings/spi/fsl-spi.txt |2 +- .../devicetree/bindings/vendor-prefixes.txt|1 + drivers/spi

[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 an...@enomsg.org Signed-off-by: Andreas Larsson andr...@gaisler.com --- drivers/spi/spi-fsl-spi.c |4 1 files changed, 4 insertions(+), 0 deletions

[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
/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 andr...@gaisler.com 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

[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 an...@enomsg.org Signed-off-by: Andreas Larsson andr...@gaisler.com --- drivers/spi/spi-fsl-lib.h |1 + drivers/spi/spi-fsl-spi.c | 50 2 files

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

2013-02-15 Thread Andreas Larsson
. For devicetree probing a clock-frequency property is used for clock frequency instead of calls to FSL_SOC-specific functions. Acked-by: Anton Vorontsov an...@enomsg.org Signed-off-by: Andreas Larsson andr...@gaisler.com --- Change since v2: - Small style tweak lining up function arguments properly

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

2013-02-15 Thread Andreas Larsson
Acked-by: Anton Vorontsov an...@enomsg.org Signed-off-by: Andreas Larsson andr...@gaisler.com --- 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

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

2013-02-15 Thread Andreas Larsson
Acked-by: Anton Vorontsov an...@enomsg.org Signed-off-by: Andreas Larsson andr...@gaisler.com --- 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

[PATCH] of/address: sparc: Declare of_iomap as an extern function for sparc again

2012-11-23 Thread Andreas Larsson
approach as 0bce04b that solved the equivalent problem for of_address_to_resource. Signed-off-by: Andreas Larsson andr...@gaisler.com --- arch/sparc/include/asm/prom.h |5 - include/linux/of_address.h|2 ++ 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/arch/sparc/include

[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 andr...@gaisler.com --- 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

[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 andr...@gaisler.com --- Documentation/devicetree/bindings/spi/spi-bus.txt |3 +- drivers/spi/spi.c | 24

[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 andr...@gaisler.com --- include/linux/spi/spi.h |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/linux/spi/spi.h b/include

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

2012-12-27 Thread Andreas Larsson
that a native chipselect is to be used. Signed-off-by: Andreas Larsson andr...@gaisler.com --- 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

[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 andr...@gaisler.com --- 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

[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
fails. Adjust drivers/hwmon/gpio-fan.c to cope with error return. Signed-off-by: Andreas Larsson andr...@gaisler.com --- 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

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

[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
-off-by: Andreas Larsson andr...@gaisler.com --- 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

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 andr...@gaisler.com 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 register

[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 andr...@gaisler.com --- Changes since v3

[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 andr...@gaisler.com Changes since v3: - Use a separate entry in the of match table for the grlib variant and trigger grlib function usage on type put

[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 andr

[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 andr...@gaisler.com Changes since v4: - Replace the ocores_get_type function with inline code in the probe function - Replace the oc_(get|set)reg functions

[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 andr...@gaisler.com --- 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

[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 andr

[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 andr

[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
is 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 andr...@gaisler.com --- Changes since v5: - Function pointers for different widths are set together - oc_setreg and oc_getreg

[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 andr...@gaisler.com Changes since v5: - Function pointers for different widths are set together - oc_setreg and oc_getreg are kept as wrappers Andreas

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-27 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) defined

[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 andr...@gaisler.com --- include

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 andr...@gaisler.com 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

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

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

2013-08-22 Thread Andreas Larsson
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 majordomo info at http

  1   2   3   4   >