All of lore.kernel.org
 help / color / mirror / Atom feed
From: Uri Mashiach <uri.mashiach-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
To: Grygorii Strashko
	<grygorii.strashko-l0cyMroinI0@public.gmane.org>,
	Kalle Valo <kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
Cc: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Ian Campbell
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	bcousson-rdvid1DuHRBWk0Htik3J/w@public.gmane.org,
	Igor Grinberg <grinberg-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>,
	Eliad Peller <eliad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2 2/3] wlcore/wl12xx: spi: add device tree support
Date: Thu, 24 Dec 2015 19:24:17 +0200	[thread overview]
Message-ID: <567C2A41.1030207@compulab.co.il> (raw)
In-Reply-To: <567C1E19.1090500-l0cyMroinI0@public.gmane.org>

Hi Grygorii,

On 12/24/2015 06:32 PM, Grygorii Strashko wrote:
> On 12/24/2015 05:35 PM, Uri Mashiach wrote:
>> Add DT support for the wl1271 SPI WiFi.
>>
>> Add documentation file for the wl1271 SPI WiFi.
>>
>> Signed-off-by: Uri Mashiach <uri.mashiach-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
>> Acked-by: Igor Grinberg <grinberg-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
>> ---
>> v1 -> v2: update interrupt documentation.
>>             replace interrupts and interrupt-parent with interrupts-extended.
>> 	  IRQ parameters retrieved from spi_device instead of DT.
>> 	  remove redundant #ifdef CONFIG_OF
>>
>>    .../bindings/net/wireless/ti,wlcore,spi.txt        | 34 +++++++++++++
>>    drivers/net/wireless/ti/wlcore/spi.c               | 55 ++++++++++++++++++++--
>>    2 files changed, 85 insertions(+), 4 deletions(-)
>>    create mode 100644 Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt
>>
>> diff --git a/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt b/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt
>> new file mode 100644
>> index 0000000..502c27e
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt
>> @@ -0,0 +1,34 @@
>> +* Texas Instruments wl1271 wireless lan controller
>> +
>> +The wl1271 chip can be connected via SPI or via SDIO. This
>> +document describes the binding for the SPI connected chip.
>> +
>> +Required properties:
>> +- compatible :          Should be "ti,wl1271"
>> +- reg :                 Chip select address of device
>> +- spi-max-frequency :   Maximum SPI clocking speed of device in Hz
>> +- ref-clock-frequency : Reference clock frequency
>> +- interrupts-extended : Should contain parameters for 1 interrupt line.
>> +                        Interrupt parameters: parent, line number, type.
>> +- vwlan-supply :        Point the node of the regulator that powers/enable the wl1271 chip
>> +
>> +Optional properties:
>> +- clock-xtal :          boolean, clock is generated from XTAL
>> +
>> +- Please consult Documentation/devicetree/bindings/spi/spi-bus.txt
>> +  for optional SPI connection related properties,
>> +
>> +Examples:
>> +
>> +&spi1 {
>> +	wl1271@1 {
>> +		compatible = "ti,wl1271";
>> +
>> +		reg = <1>;
>> +		spi-max-frequency = <48000000>;
>> +		clock-xtal;
>> +		ref-clock-frequency = <38400000>;
>> +		interrupts-extended = <&gpio3 8 IRQ_TYPE_LEVEL_HIGH>;
>> +		vwlan-supply = <&vwlan_fixed>;
>> +	};
>> +};
>> diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c
>> index d3a4bcb..e9e8d54 100644
>> --- a/drivers/net/wireless/ti/wlcore/spi.c
>> +++ b/drivers/net/wireless/ti/wlcore/spi.c
>> @@ -30,6 +30,7 @@
>>    #include <linux/spi/spi.h>
>>    #include <linux/wl12xx.h>
>>    #include <linux/platform_device.h>
>> +#include <linux/of_irq.h>
>>    #include <linux/regulator/consumer.h>
>>
>>    #include "wlcore.h"
>> @@ -357,6 +358,46 @@ static struct wl1271_if_operations spi_ops = {
>>    	.set_block_size = NULL,
>>    };
>>
>> +#ifdef CONFIG_OF
>> +static const struct of_device_id wlcore_spi_of_match_table[] = {
>> +	{ .compatible = "ti,wl1271" },
>> +	{ }
>> +};
>> +
>> +/**
>> + * wlcore_probe_of - DT node parsing.
>> + * @spi: SPI slave device parameters.
>> + * @res: resource parameters.
>> + * @glue: wl12xx SPI bus to slave device glue parameters.
>> + * @pdev_data: wlcore device parameters
>> + */
>> +static int wlcore_probe_of(struct spi_device *spi, struct wl12xx_spi_glue *glue,
>> +			   struct wlcore_platdev_data *pdev_data)
>> +{
>> +	struct device_node *dt_node = spi->dev.of_node;
>> +	int ret;
>> +
>> +	if (of_find_property(dt_node, "clock-xtal", NULL))
>> +		pdev_data->ref_clock_xtal = true;
>> +
>> +	ret = of_property_read_u32(dt_node, "ref-clock-frequency",
>> +				   &pdev_data->ref_clock_freq);
>> +	if (IS_ERR_VALUE(ret)) {
>> +		dev_err(glue->dev,
>> +			"can't get reference clock frequency (%d)\n", ret);
>> +		return ret;
>> +	}
>> +
>> +	return 0;
>> +}
>> +#else /* CONFIG_OF */
>> +static int wlcore_probe_of(struct spi_device *spi, struct wl12xx_spi_glue *glue,
>> +			   struct wlcore_platdev_data *pdev_data)
>> +{
>> +	return -ENODATA;
>> +}
>> +#endif /* CONFIG_OF */
>
> My question for your v1 was related to all above ifdefs.
> If CONFIG_OF=n is not going to be supported then all this ifdefs
> can be dropped and proper dependency can be added to Kconfig instead.
>

Will be done in v3.

>> +
>>    static int wl1271_probe(struct spi_device *spi)
>>    {
>>    	struct wl12xx_spi_glue *glue;
>> @@ -366,8 +407,6 @@ static int wl1271_probe(struct spi_device *spi)
>>
>>    	memset(&pdev_data, 0x00, sizeof(pdev_data));
>>
>> -	/* TODO: add DT parsing when needed */
>> -
>>    	pdev_data.if_ops = &spi_ops;
>>
>>    	glue = devm_kzalloc(&spi->dev, sizeof(*glue), GFP_KERNEL);
>> @@ -390,6 +429,13 @@ static int wl1271_probe(struct spi_device *spi)
>>    		return PTR_ERR(glue->reg);
>>    	}
>>
>> +	ret = wlcore_probe_of(spi, glue, &pdev_data);
>> +	if (IS_ERR_VALUE(ret)) {
>> +		dev_err(glue->dev,
>> +			"can't get device tree parameters (%d)\n", ret);
>> +		return ret;
>> +	}
>> +
>>    	ret = spi_setup(spi);
>>    	if (ret < 0) {
>>    		dev_err(glue->dev, "spi_setup failed\n");
>> @@ -407,7 +453,8 @@ static int wl1271_probe(struct spi_device *spi)
>>    	memset(res, 0x00, sizeof(res));
>>
>>    	res[0].start = spi->irq;
>> -	res[0].flags = IORESOURCE_IRQ;
>> +	res[0].flags = IORESOURCE_IRQ |
>> +			irqd_get_trigger_type(irq_get_irq_data(spi->irq));
>
>
> irq_get_trigger_type()?
>

Will be replaced in v3.

>>    	res[0].name = "irq";
>>
>>    	ret = platform_device_add_resources(glue->core, res, ARRAY_SIZE(res));
>> @@ -445,10 +492,10 @@ static int wl1271_remove(struct spi_device *spi)
>>    	return 0;
>>    }
>>
>> -
>>    static struct spi_driver wl1271_spi_driver = {
>>    	.driver = {
>>    		.name		= "wl1271_spi",
>> +		.of_match_table = of_match_ptr(wlcore_spi_of_match_table),
>>    	},
>>
>>    	.probe		= wl1271_probe,
>>
>
> Sorry for delayed replay.
>

-- 
Thanks,
Uri
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Uri Mashiach <uri.mashiach@compulab.co.il>
To: Grygorii Strashko <grygorii.strashko@ti.com>,
	Kalle Valo <kvalo@codeaurora.org>,
	Rob Herring <robh+dt@kernel.org>,
	Tony Lindgren <tony@atomide.com>
Cc: Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	bcousson@baylibre.com, Igor Grinberg <grinberg@compulab.co.il>,
	Eliad Peller <eliad@wizery.com>,
	devicetree@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH v2 2/3] wlcore/wl12xx: spi: add device tree support
Date: Thu, 24 Dec 2015 19:24:17 +0200	[thread overview]
Message-ID: <567C2A41.1030207@compulab.co.il> (raw)
In-Reply-To: <567C1E19.1090500@ti.com>

Hi Grygorii,

On 12/24/2015 06:32 PM, Grygorii Strashko wrote:
> On 12/24/2015 05:35 PM, Uri Mashiach wrote:
>> Add DT support for the wl1271 SPI WiFi.
>>
>> Add documentation file for the wl1271 SPI WiFi.
>>
>> Signed-off-by: Uri Mashiach <uri.mashiach@compulab.co.il>
>> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
>> ---
>> v1 -> v2: update interrupt documentation.
>>             replace interrupts and interrupt-parent with interrupts-extended.
>> 	  IRQ parameters retrieved from spi_device instead of DT.
>> 	  remove redundant #ifdef CONFIG_OF
>>
>>    .../bindings/net/wireless/ti,wlcore,spi.txt        | 34 +++++++++++++
>>    drivers/net/wireless/ti/wlcore/spi.c               | 55 ++++++++++++++++++++--
>>    2 files changed, 85 insertions(+), 4 deletions(-)
>>    create mode 100644 Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt
>>
>> diff --git a/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt b/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt
>> new file mode 100644
>> index 0000000..502c27e
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt
>> @@ -0,0 +1,34 @@
>> +* Texas Instruments wl1271 wireless lan controller
>> +
>> +The wl1271 chip can be connected via SPI or via SDIO. This
>> +document describes the binding for the SPI connected chip.
>> +
>> +Required properties:
>> +- compatible :          Should be "ti,wl1271"
>> +- reg :                 Chip select address of device
>> +- spi-max-frequency :   Maximum SPI clocking speed of device in Hz
>> +- ref-clock-frequency : Reference clock frequency
>> +- interrupts-extended : Should contain parameters for 1 interrupt line.
>> +                        Interrupt parameters: parent, line number, type.
>> +- vwlan-supply :        Point the node of the regulator that powers/enable the wl1271 chip
>> +
>> +Optional properties:
>> +- clock-xtal :          boolean, clock is generated from XTAL
>> +
>> +- Please consult Documentation/devicetree/bindings/spi/spi-bus.txt
>> +  for optional SPI connection related properties,
>> +
>> +Examples:
>> +
>> +&spi1 {
>> +	wl1271@1 {
>> +		compatible = "ti,wl1271";
>> +
>> +		reg = <1>;
>> +		spi-max-frequency = <48000000>;
>> +		clock-xtal;
>> +		ref-clock-frequency = <38400000>;
>> +		interrupts-extended = <&gpio3 8 IRQ_TYPE_LEVEL_HIGH>;
>> +		vwlan-supply = <&vwlan_fixed>;
>> +	};
>> +};
>> diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c
>> index d3a4bcb..e9e8d54 100644
>> --- a/drivers/net/wireless/ti/wlcore/spi.c
>> +++ b/drivers/net/wireless/ti/wlcore/spi.c
>> @@ -30,6 +30,7 @@
>>    #include <linux/spi/spi.h>
>>    #include <linux/wl12xx.h>
>>    #include <linux/platform_device.h>
>> +#include <linux/of_irq.h>
>>    #include <linux/regulator/consumer.h>
>>
>>    #include "wlcore.h"
>> @@ -357,6 +358,46 @@ static struct wl1271_if_operations spi_ops = {
>>    	.set_block_size = NULL,
>>    };
>>
>> +#ifdef CONFIG_OF
>> +static const struct of_device_id wlcore_spi_of_match_table[] = {
>> +	{ .compatible = "ti,wl1271" },
>> +	{ }
>> +};
>> +
>> +/**
>> + * wlcore_probe_of - DT node parsing.
>> + * @spi: SPI slave device parameters.
>> + * @res: resource parameters.
>> + * @glue: wl12xx SPI bus to slave device glue parameters.
>> + * @pdev_data: wlcore device parameters
>> + */
>> +static int wlcore_probe_of(struct spi_device *spi, struct wl12xx_spi_glue *glue,
>> +			   struct wlcore_platdev_data *pdev_data)
>> +{
>> +	struct device_node *dt_node = spi->dev.of_node;
>> +	int ret;
>> +
>> +	if (of_find_property(dt_node, "clock-xtal", NULL))
>> +		pdev_data->ref_clock_xtal = true;
>> +
>> +	ret = of_property_read_u32(dt_node, "ref-clock-frequency",
>> +				   &pdev_data->ref_clock_freq);
>> +	if (IS_ERR_VALUE(ret)) {
>> +		dev_err(glue->dev,
>> +			"can't get reference clock frequency (%d)\n", ret);
>> +		return ret;
>> +	}
>> +
>> +	return 0;
>> +}
>> +#else /* CONFIG_OF */
>> +static int wlcore_probe_of(struct spi_device *spi, struct wl12xx_spi_glue *glue,
>> +			   struct wlcore_platdev_data *pdev_data)
>> +{
>> +	return -ENODATA;
>> +}
>> +#endif /* CONFIG_OF */
>
> My question for your v1 was related to all above ifdefs.
> If CONFIG_OF=n is not going to be supported then all this ifdefs
> can be dropped and proper dependency can be added to Kconfig instead.
>

Will be done in v3.

>> +
>>    static int wl1271_probe(struct spi_device *spi)
>>    {
>>    	struct wl12xx_spi_glue *glue;
>> @@ -366,8 +407,6 @@ static int wl1271_probe(struct spi_device *spi)
>>
>>    	memset(&pdev_data, 0x00, sizeof(pdev_data));
>>
>> -	/* TODO: add DT parsing when needed */
>> -
>>    	pdev_data.if_ops = &spi_ops;
>>
>>    	glue = devm_kzalloc(&spi->dev, sizeof(*glue), GFP_KERNEL);
>> @@ -390,6 +429,13 @@ static int wl1271_probe(struct spi_device *spi)
>>    		return PTR_ERR(glue->reg);
>>    	}
>>
>> +	ret = wlcore_probe_of(spi, glue, &pdev_data);
>> +	if (IS_ERR_VALUE(ret)) {
>> +		dev_err(glue->dev,
>> +			"can't get device tree parameters (%d)\n", ret);
>> +		return ret;
>> +	}
>> +
>>    	ret = spi_setup(spi);
>>    	if (ret < 0) {
>>    		dev_err(glue->dev, "spi_setup failed\n");
>> @@ -407,7 +453,8 @@ static int wl1271_probe(struct spi_device *spi)
>>    	memset(res, 0x00, sizeof(res));
>>
>>    	res[0].start = spi->irq;
>> -	res[0].flags = IORESOURCE_IRQ;
>> +	res[0].flags = IORESOURCE_IRQ |
>> +			irqd_get_trigger_type(irq_get_irq_data(spi->irq));
>
>
> irq_get_trigger_type()?
>

Will be replaced in v3.

>>    	res[0].name = "irq";
>>
>>    	ret = platform_device_add_resources(glue->core, res, ARRAY_SIZE(res));
>> @@ -445,10 +492,10 @@ static int wl1271_remove(struct spi_device *spi)
>>    	return 0;
>>    }
>>
>> -
>>    static struct spi_driver wl1271_spi_driver = {
>>    	.driver = {
>>    		.name		= "wl1271_spi",
>> +		.of_match_table = of_match_ptr(wlcore_spi_of_match_table),
>>    	},
>>
>>    	.probe		= wl1271_probe,
>>
>
> Sorry for delayed replay.
>

-- 
Thanks,
Uri

WARNING: multiple messages have this Message-ID (diff)
From: uri.mashiach@compulab.co.il (Uri Mashiach)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/3] wlcore/wl12xx: spi: add device tree support
Date: Thu, 24 Dec 2015 19:24:17 +0200	[thread overview]
Message-ID: <567C2A41.1030207@compulab.co.il> (raw)
In-Reply-To: <567C1E19.1090500@ti.com>

Hi Grygorii,

On 12/24/2015 06:32 PM, Grygorii Strashko wrote:
> On 12/24/2015 05:35 PM, Uri Mashiach wrote:
>> Add DT support for the wl1271 SPI WiFi.
>>
>> Add documentation file for the wl1271 SPI WiFi.
>>
>> Signed-off-by: Uri Mashiach <uri.mashiach@compulab.co.il>
>> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
>> ---
>> v1 -> v2: update interrupt documentation.
>>             replace interrupts and interrupt-parent with interrupts-extended.
>> 	  IRQ parameters retrieved from spi_device instead of DT.
>> 	  remove redundant #ifdef CONFIG_OF
>>
>>    .../bindings/net/wireless/ti,wlcore,spi.txt        | 34 +++++++++++++
>>    drivers/net/wireless/ti/wlcore/spi.c               | 55 ++++++++++++++++++++--
>>    2 files changed, 85 insertions(+), 4 deletions(-)
>>    create mode 100644 Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt
>>
>> diff --git a/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt b/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt
>> new file mode 100644
>> index 0000000..502c27e
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt
>> @@ -0,0 +1,34 @@
>> +* Texas Instruments wl1271 wireless lan controller
>> +
>> +The wl1271 chip can be connected via SPI or via SDIO. This
>> +document describes the binding for the SPI connected chip.
>> +
>> +Required properties:
>> +- compatible :          Should be "ti,wl1271"
>> +- reg :                 Chip select address of device
>> +- spi-max-frequency :   Maximum SPI clocking speed of device in Hz
>> +- ref-clock-frequency : Reference clock frequency
>> +- interrupts-extended : Should contain parameters for 1 interrupt line.
>> +                        Interrupt parameters: parent, line number, type.
>> +- vwlan-supply :        Point the node of the regulator that powers/enable the wl1271 chip
>> +
>> +Optional properties:
>> +- clock-xtal :          boolean, clock is generated from XTAL
>> +
>> +- Please consult Documentation/devicetree/bindings/spi/spi-bus.txt
>> +  for optional SPI connection related properties,
>> +
>> +Examples:
>> +
>> +&spi1 {
>> +	wl1271 at 1 {
>> +		compatible = "ti,wl1271";
>> +
>> +		reg = <1>;
>> +		spi-max-frequency = <48000000>;
>> +		clock-xtal;
>> +		ref-clock-frequency = <38400000>;
>> +		interrupts-extended = <&gpio3 8 IRQ_TYPE_LEVEL_HIGH>;
>> +		vwlan-supply = <&vwlan_fixed>;
>> +	};
>> +};
>> diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c
>> index d3a4bcb..e9e8d54 100644
>> --- a/drivers/net/wireless/ti/wlcore/spi.c
>> +++ b/drivers/net/wireless/ti/wlcore/spi.c
>> @@ -30,6 +30,7 @@
>>    #include <linux/spi/spi.h>
>>    #include <linux/wl12xx.h>
>>    #include <linux/platform_device.h>
>> +#include <linux/of_irq.h>
>>    #include <linux/regulator/consumer.h>
>>
>>    #include "wlcore.h"
>> @@ -357,6 +358,46 @@ static struct wl1271_if_operations spi_ops = {
>>    	.set_block_size = NULL,
>>    };
>>
>> +#ifdef CONFIG_OF
>> +static const struct of_device_id wlcore_spi_of_match_table[] = {
>> +	{ .compatible = "ti,wl1271" },
>> +	{ }
>> +};
>> +
>> +/**
>> + * wlcore_probe_of - DT node parsing.
>> + * @spi: SPI slave device parameters.
>> + * @res: resource parameters.
>> + * @glue: wl12xx SPI bus to slave device glue parameters.
>> + * @pdev_data: wlcore device parameters
>> + */
>> +static int wlcore_probe_of(struct spi_device *spi, struct wl12xx_spi_glue *glue,
>> +			   struct wlcore_platdev_data *pdev_data)
>> +{
>> +	struct device_node *dt_node = spi->dev.of_node;
>> +	int ret;
>> +
>> +	if (of_find_property(dt_node, "clock-xtal", NULL))
>> +		pdev_data->ref_clock_xtal = true;
>> +
>> +	ret = of_property_read_u32(dt_node, "ref-clock-frequency",
>> +				   &pdev_data->ref_clock_freq);
>> +	if (IS_ERR_VALUE(ret)) {
>> +		dev_err(glue->dev,
>> +			"can't get reference clock frequency (%d)\n", ret);
>> +		return ret;
>> +	}
>> +
>> +	return 0;
>> +}
>> +#else /* CONFIG_OF */
>> +static int wlcore_probe_of(struct spi_device *spi, struct wl12xx_spi_glue *glue,
>> +			   struct wlcore_platdev_data *pdev_data)
>> +{
>> +	return -ENODATA;
>> +}
>> +#endif /* CONFIG_OF */
>
> My question for your v1 was related to all above ifdefs.
> If CONFIG_OF=n is not going to be supported then all this ifdefs
> can be dropped and proper dependency can be added to Kconfig instead.
>

Will be done in v3.

>> +
>>    static int wl1271_probe(struct spi_device *spi)
>>    {
>>    	struct wl12xx_spi_glue *glue;
>> @@ -366,8 +407,6 @@ static int wl1271_probe(struct spi_device *spi)
>>
>>    	memset(&pdev_data, 0x00, sizeof(pdev_data));
>>
>> -	/* TODO: add DT parsing when needed */
>> -
>>    	pdev_data.if_ops = &spi_ops;
>>
>>    	glue = devm_kzalloc(&spi->dev, sizeof(*glue), GFP_KERNEL);
>> @@ -390,6 +429,13 @@ static int wl1271_probe(struct spi_device *spi)
>>    		return PTR_ERR(glue->reg);
>>    	}
>>
>> +	ret = wlcore_probe_of(spi, glue, &pdev_data);
>> +	if (IS_ERR_VALUE(ret)) {
>> +		dev_err(glue->dev,
>> +			"can't get device tree parameters (%d)\n", ret);
>> +		return ret;
>> +	}
>> +
>>    	ret = spi_setup(spi);
>>    	if (ret < 0) {
>>    		dev_err(glue->dev, "spi_setup failed\n");
>> @@ -407,7 +453,8 @@ static int wl1271_probe(struct spi_device *spi)
>>    	memset(res, 0x00, sizeof(res));
>>
>>    	res[0].start = spi->irq;
>> -	res[0].flags = IORESOURCE_IRQ;
>> +	res[0].flags = IORESOURCE_IRQ |
>> +			irqd_get_trigger_type(irq_get_irq_data(spi->irq));
>
>
> irq_get_trigger_type()?
>

Will be replaced in v3.

>>    	res[0].name = "irq";
>>
>>    	ret = platform_device_add_resources(glue->core, res, ARRAY_SIZE(res));
>> @@ -445,10 +492,10 @@ static int wl1271_remove(struct spi_device *spi)
>>    	return 0;
>>    }
>>
>> -
>>    static struct spi_driver wl1271_spi_driver = {
>>    	.driver = {
>>    		.name		= "wl1271_spi",
>> +		.of_match_table = of_match_ptr(wlcore_spi_of_match_table),
>>    	},
>>
>>    	.probe		= wl1271_probe,
>>
>
> Sorry for delayed replay.
>

-- 
Thanks,
Uri

  parent reply	other threads:[~2015-12-24 17:24 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-24 15:35 [PATCH v2 0/3] wlcore/wl12xx: spi: add wifi support to cm-t335 Uri Mashiach
2015-12-24 15:35 ` Uri Mashiach
2015-12-24 15:35 ` Uri Mashiach
     [not found] ` <1450971335-15961-1-git-send-email-uri.mashiach-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
2015-12-24 15:35   ` [PATCH v2 1/3] wlcore/wl12xx: spi: add power operation function Uri Mashiach
2015-12-24 15:35     ` Uri Mashiach
2015-12-24 15:35     ` Uri Mashiach
     [not found]     ` <1450971335-15961-2-git-send-email-uri.mashiach-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
2015-12-24 16:32       ` Grygorii Strashko
2015-12-24 16:32         ` Grygorii Strashko
2015-12-24 16:32         ` Grygorii Strashko
     [not found]         ` <567C1E3B.3020404-l0cyMroinI0@public.gmane.org>
2015-12-27 17:14           ` Uri Mashiach
2015-12-27 17:14             ` Uri Mashiach
2015-12-27 17:14             ` Uri Mashiach
     [not found]             ` <56801C78.9040102-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
2015-12-28 11:59               ` Grygorii Strashko
2015-12-28 11:59                 ` Grygorii Strashko
2015-12-28 11:59                 ` Grygorii Strashko
     [not found]                 ` <5681241F.1060603-l0cyMroinI0@public.gmane.org>
2015-12-28 14:16                   ` Uri Mashiach
2015-12-28 14:16                     ` Uri Mashiach
2015-12-28 14:16                     ` Uri Mashiach
2015-12-24 15:35   ` [PATCH v2 2/3] wlcore/wl12xx: spi: add device tree support Uri Mashiach
2015-12-24 15:35     ` Uri Mashiach
2015-12-24 15:35     ` Uri Mashiach
     [not found]     ` <1450971335-15961-3-git-send-email-uri.mashiach-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
2015-12-24 16:25       ` Javier Martinez Canillas
2015-12-24 16:25         ` Javier Martinez Canillas
2015-12-24 16:25         ` Javier Martinez Canillas
     [not found]         ` <CABxcv=nS_RSXotJXqjY4QR3zDgM5iviC=YVwhjG=408znW1hiQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-24 17:21           ` Uri Mashiach
2015-12-24 17:21             ` Uri Mashiach
2015-12-24 17:21             ` Uri Mashiach
2015-12-24 16:32       ` Grygorii Strashko
2015-12-24 16:32         ` Grygorii Strashko
2015-12-24 16:32         ` Grygorii Strashko
     [not found]         ` <567C1E19.1090500-l0cyMroinI0@public.gmane.org>
2015-12-24 17:24           ` Uri Mashiach [this message]
2015-12-24 17:24             ` Uri Mashiach
2015-12-24 17:24             ` Uri Mashiach
2015-12-24 15:35   ` [PATCH v2 3/3] wlcore/wl12xx: spi: add wifi support to cm-t335 Uri Mashiach
2015-12-24 15:35     ` Uri Mashiach
2015-12-24 15:35     ` Uri Mashiach
     [not found]     ` <1450971335-15961-4-git-send-email-uri.mashiach-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
2015-12-24 16:33       ` Javier Martinez Canillas
2015-12-24 16:33         ` Javier Martinez Canillas
2015-12-24 16:33         ` Javier Martinez Canillas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=567C2A41.1030207@compulab.co.il \
    --to=uri.mashiach-utxizqzc01rs1mouv/rt9w@public.gmane.org \
    --cc=bcousson-rdvid1DuHRBWk0Htik3J/w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=eliad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=grinberg-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org \
    --cc=grygorii.strashko-l0cyMroinI0@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.