linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] staging: wilc1000: use 'interrupts' property instead of 'irq-gpio'
  2020-03-06 14:44 [PATCH 0/2] staging: wilc1000: handle DT binding documentation comments Ajay.Kathat
@ 2020-03-06 14:44 ` Ajay.Kathat
  2020-03-06 15:35   ` Rob Herring
  2020-03-06 14:44 ` [PATCH 2/2] staging: wilc1000: use single DT binding documentation for SDIO and SPI Ajay.Kathat
  1 sibling, 1 reply; 5+ messages in thread
From: Ajay.Kathat @ 2020-03-06 14:44 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, devicetree, gregkh, Adham.Abozaeid, johannes, robh, Ajay.Kathat

From: Ajay Singh <ajay.kathat@microchip.com>

Make use of 'interrupts' property instead of using gpio for handling
the interrupt as suggested in [1].

[1]. https://lore.kernel.org/linux-wireless/20200303015558.GA6876@bogus/

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
 .../net/wireless/microchip,wilc1000.yaml      | 79 +++++++++++++++++++
 .../wilc1000/microchip,wilc1000,sdio.yaml     |  8 +-
 .../wilc1000/microchip,wilc1000,spi.yaml      |  8 +-
 drivers/staging/wilc1000/netdev.c             | 24 ++----
 drivers/staging/wilc1000/netdev.h             |  1 -
 drivers/staging/wilc1000/sdio.c               | 31 +++-----
 drivers/staging/wilc1000/spi.c                | 15 +---
 drivers/staging/wilc1000/wlan.h               |  1 -
 8 files changed, 108 insertions(+), 59 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/microchip,wilc1000.yaml

diff --git a/Documentation/devicetree/bindings/net/wireless/microchip,wilc1000.yaml b/Documentation/devicetree/bindings/net/wireless/microchip,wilc1000.yaml
new file mode 100644
index 000000000000..a1914449ad07
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/wireless/microchip,wilc1000.yaml
@@ -0,0 +1,79 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/wireless/microchip,wilc1000.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip WILC wireless devicetree bindings
+
+maintainers:
+  - Adham Abozaeid <adham.abozaeid@microchip.com>
+  - Ajay Singh <ajay.kathat@microchip.com>
+
+description:
+  The wilc1000 chips can be connected via SPI or SDIO. This document
+  describes the binding to connect wilc devices.
+
+properties:
+  compatible:
+    const: microchip,wilc1000
+
+  spi-max-frequency:
+    description: Maximum SPI clocking speed of device in Hz.
+    maxItems: 1
+
+  reg:
+    description: Chip select address of device.
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    description: phandle to the clock connected on rtc clock line.
+    maxItems: 1
+
+  clock-names:
+    const: rtc
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+examples:
+  - |
+    spi1: spi@fc018000 {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      cs-gpios = <&pioB 21 0>;
+      wifi@0 {
+        compatible = "microchip,wilc1000";
+        spi-max-frequency = <48000000>;
+        reg = <0>;
+        interrupt-parent = <&pioC>;
+        interrupts = <27 0>;
+        clocks = <&pck1>;
+        clock-names = "rtc";
+      };
+    };
+
+  - |
+    mmc1: mmc@fc000000 {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      pinctrl-names = "default";
+      pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3>;
+      non-removable;
+      vmmc-supply = <&vcc_mmc1_reg>;
+      vqmmc-supply = <&vcc_3v3_reg>;
+      bus-width = <4>;
+      wifi@0 {
+        compatible = "microchip,wilc1000";
+        reg = <0>;
+        interrupt-parent = <&pioC>;
+        interrupts = <27 0>;
+        clocks = <&pck1>;
+        clock-names = "rtc";
+      };
+    };
diff --git a/drivers/staging/wilc1000/microchip,wilc1000,sdio.yaml b/drivers/staging/wilc1000/microchip,wilc1000,sdio.yaml
index b338f569f7e2..9df7327bc668 100644
--- a/drivers/staging/wilc1000/microchip,wilc1000,sdio.yaml
+++ b/drivers/staging/wilc1000/microchip,wilc1000,sdio.yaml
@@ -19,8 +19,7 @@ properties:
   compatible:
     const: microchip,wilc1000-sdio
 
-  irq-gpios:
-    description: The GPIO phandle connect to a host IRQ.
+  interrupts:
     maxItems: 1
 
   reg:
@@ -40,7 +39,7 @@ properties:
 
 required:
   - compatible
-  - irq-gpios
+  - interrupts
   - reg
 
 examples:
@@ -56,7 +55,8 @@ examples:
       status = "okay";
       wilc_sdio@0 {
         compatible = "microchip,wilc1000-sdio";
-          irq-gpios = <&pioC 27 0>;
+        interrupt-parent = <&pioC>;
+        interrupts = <27 0>;
           reg = <0>;
           clocks = <&pck1>;
           clock-names = "rtc_clk";
diff --git a/drivers/staging/wilc1000/microchip,wilc1000,spi.yaml b/drivers/staging/wilc1000/microchip,wilc1000,spi.yaml
index cc8ed64ce627..dd5e8da1f562 100644
--- a/drivers/staging/wilc1000/microchip,wilc1000,spi.yaml
+++ b/drivers/staging/wilc1000/microchip,wilc1000,spi.yaml
@@ -26,8 +26,7 @@ properties:
     description: Chip select address of device.
     maxItems: 1
 
-  irq-gpios:
-    description: The GPIO phandle connect to a host IRQ.
+  interrupts:
     maxItems: 1
 
   clocks:
@@ -38,7 +37,7 @@ required:
   - compatible
   - spi-max-frequency
   - reg
-  - irq-gpios
+  - interrupts
 
 examples:
   - |
@@ -51,7 +50,8 @@ examples:
         compatible = "microchip,wilc1000-spi";
         spi-max-frequency = <48000000>;
         reg = <0>;
-        irq-gpios = <&pioC 27 0>;
+        interrupt-parent = <&pioC>;
+        interrupts = <27 0>;
         clocks = <&pck1>;
         clock-names = "rtc_clk";
         assigned-clocks = <&pck1>;
diff --git a/drivers/staging/wilc1000/netdev.c b/drivers/staging/wilc1000/netdev.c
index 045f5cdfdca0..a61c1a7aefa8 100644
--- a/drivers/staging/wilc1000/netdev.c
+++ b/drivers/staging/wilc1000/netdev.c
@@ -46,29 +46,21 @@ static irqreturn_t isr_bh_routine(int irq, void *userdata)
 
 static int init_irq(struct net_device *dev)
 {
-	int ret = 0;
 	struct wilc_vif *vif = netdev_priv(dev);
 	struct wilc *wl = vif->wilc;
-
-	ret = gpiod_direction_input(wl->gpio_irq);
-	if (ret) {
-		netdev_err(dev, "could not obtain gpio for WILC_INTR\n");
-		return ret;
-	}
-
-	wl->dev_irq_num = gpiod_to_irq(wl->gpio_irq);
+	int ret;
 
 	ret = request_threaded_irq(wl->dev_irq_num, isr_uh_routine,
 				   isr_bh_routine,
 				   IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
 				   "WILC_IRQ", dev);
-	if (ret < 0)
-		netdev_err(dev, "Failed to request IRQ\n");
-	else
-		netdev_dbg(dev, "IRQ request succeeded IRQ-NUM= %d\n",
-			   wl->dev_irq_num);
+	if (ret) {
+		netdev_err(dev, "Failed to request IRQ [%d]\n", ret);
+		return ret;
+	}
+	netdev_dbg(dev, "IRQ request succeeded IRQ-NUM= %d\n", wl->dev_irq_num);
 
-	return ret;
+	return 0;
 }
 
 static void deinit_irq(struct net_device *dev)
@@ -501,7 +493,7 @@ static int wilc_wlan_initialize(struct net_device *dev, struct wilc_vif *vif)
 		if (ret)
 			goto fail_wilc_wlan;
 
-		if (wl->gpio_irq && init_irq(dev)) {
+		if (wl->dev_irq_num && init_irq(dev)) {
 			ret = -EIO;
 			goto fail_threads;
 		}
diff --git a/drivers/staging/wilc1000/netdev.h b/drivers/staging/wilc1000/netdev.h
index e3689e2a4abb..61cbec674a62 100644
--- a/drivers/staging/wilc1000/netdev.h
+++ b/drivers/staging/wilc1000/netdev.h
@@ -209,7 +209,6 @@ struct wilc {
 	const struct wilc_hif_func *hif_func;
 	int io_type;
 	s8 mac_status;
-	struct gpio_desc *gpio_irq;
 	struct clk *rtc_clk;
 	bool initialized;
 	int dev_irq_num;
diff --git a/drivers/staging/wilc1000/sdio.c b/drivers/staging/wilc1000/sdio.c
index 2301e90c21ca..44b426874c1b 100644
--- a/drivers/staging/wilc1000/sdio.c
+++ b/drivers/staging/wilc1000/sdio.c
@@ -8,6 +8,7 @@
 #include <linux/mmc/sdio_func.h>
 #include <linux/mmc/host.h>
 #include <linux/mmc/sdio.h>
+#include <linux/of_irq.h>
 
 #include "netdev.h"
 #include "cfg80211.h"
@@ -122,33 +123,32 @@ static int wilc_sdio_probe(struct sdio_func *func,
 {
 	struct wilc *wilc;
 	int ret;
-	struct gpio_desc *gpio = NULL;
 	struct wilc_sdio *sdio_priv;
 
 	sdio_priv = kzalloc(sizeof(*sdio_priv), GFP_KERNEL);
 	if (!sdio_priv)
 		return -ENOMEM;
 
-	if (IS_ENABLED(CONFIG_WILC1000_HW_OOB_INTR)) {
-		gpio = gpiod_get(&func->dev, "irq", GPIOD_IN);
-		if (IS_ERR(gpio)) {
-			/* get the GPIO descriptor from hardcode GPIO number */
-			gpio = gpio_to_desc(GPIO_NUM);
-			if (!gpio)
-				dev_err(&func->dev, "failed to get irq gpio\n");
-		}
-	}
-
 	ret = wilc_cfg80211_init(&wilc, &func->dev, WILC_HIF_SDIO,
 				 &wilc_hif_sdio);
 	if (ret) {
 		kfree(sdio_priv);
 		return ret;
 	}
+
+	if (IS_ENABLED(CONFIG_WILC1000_HW_OOB_INTR)) {
+		struct device_node *np = func->card->dev.of_node;
+		int irq_num = of_irq_get(np, 0);
+
+		if (irq_num > 0) {
+			wilc->dev_irq_num = irq_num;
+			sdio_priv->irq_gpio = true;
+		}
+	}
+
 	sdio_set_drvdata(func, wilc);
 	wilc->bus_data = sdio_priv;
 	wilc->dev = &func->dev;
-	wilc->gpio_irq = gpio;
 
 	wilc->rtc_clk = devm_clk_get(&func->card->dev, "rtc_clk");
 	if (PTR_ERR_OR_ZERO(wilc->rtc_clk) == -EPROBE_DEFER)
@@ -164,10 +164,6 @@ static void wilc_sdio_remove(struct sdio_func *func)
 {
 	struct wilc *wilc = sdio_get_drvdata(func);
 
-	/* free the GPIO in module remove */
-	if (wilc->gpio_irq)
-		gpiod_put(wilc->gpio_irq);
-
 	if (!IS_ERR(wilc->rtc_clk))
 		clk_disable_unprepare(wilc->rtc_clk);
 
@@ -592,9 +588,6 @@ static int wilc_sdio_init(struct wilc *wilc, bool resume)
 	int loop, ret;
 	u32 chipid;
 
-	if (!resume)
-		sdio_priv->irq_gpio = wilc->dev_irq_num;
-
 	/**
 	 *      function 0 csa enable
 	 **/
diff --git a/drivers/staging/wilc1000/spi.c b/drivers/staging/wilc1000/spi.c
index dfd25df75780..852f318a86f0 100644
--- a/drivers/staging/wilc1000/spi.c
+++ b/drivers/staging/wilc1000/spi.c
@@ -151,21 +151,12 @@ static int wilc_bus_probe(struct spi_device *spi)
 {
 	int ret;
 	struct wilc *wilc;
-	struct gpio_desc *gpio;
 	struct wilc_spi *spi_priv;
 
 	spi_priv = kzalloc(sizeof(*spi_priv), GFP_KERNEL);
 	if (!spi_priv)
 		return -ENOMEM;
 
-	gpio = gpiod_get(&spi->dev, "irq", GPIOD_IN);
-	if (IS_ERR(gpio)) {
-		/* get the GPIO descriptor from hardcode GPIO number */
-		gpio = gpio_to_desc(GPIO_NUM);
-		if (!gpio)
-			dev_err(&spi->dev, "failed to get the irq gpio\n");
-	}
-
 	ret = wilc_cfg80211_init(&wilc, &spi->dev, WILC_HIF_SPI, &wilc_hif_spi);
 	if (ret) {
 		kfree(spi_priv);
@@ -175,7 +166,7 @@ static int wilc_bus_probe(struct spi_device *spi)
 	spi_set_drvdata(spi, wilc);
 	wilc->dev = &spi->dev;
 	wilc->bus_data = spi_priv;
-	wilc->gpio_irq = gpio;
+	wilc->dev_irq_num = spi->irq;
 
 	wilc->rtc_clk = devm_clk_get(&spi->dev, "rtc_clk");
 	if (PTR_ERR_OR_ZERO(wilc->rtc_clk) == -EPROBE_DEFER)
@@ -190,10 +181,6 @@ static int wilc_bus_remove(struct spi_device *spi)
 {
 	struct wilc *wilc = spi_get_drvdata(spi);
 
-	/* free the GPIO in module remove */
-	if (wilc->gpio_irq)
-		gpiod_put(wilc->gpio_irq);
-
 	if (!IS_ERR(wilc->rtc_clk))
 		clk_disable_unprepare(wilc->rtc_clk);
 
diff --git a/drivers/staging/wilc1000/wlan.h b/drivers/staging/wilc1000/wlan.h
index 5999c5490ea5..7689569cd82f 100644
--- a/drivers/staging/wilc1000/wlan.h
+++ b/drivers/staging/wilc1000/wlan.h
@@ -206,7 +206,6 @@
 #define WILC_TX_BUFF_SIZE	(64 * 1024)
 
 #define MODALIAS		"WILC_SPI"
-#define GPIO_NUM		0x44
 
 #define WILC_PKT_HDR_CONFIG_FIELD	BIT(31)
 #define WILC_PKT_HDR_OFFSET_FIELD	GENMASK(30, 22)
-- 
2.24.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 0/2] staging: wilc1000: handle DT binding documentation comments
@ 2020-03-06 14:44 Ajay.Kathat
  2020-03-06 14:44 ` [PATCH 1/2] staging: wilc1000: use 'interrupts' property instead of 'irq-gpio' Ajay.Kathat
  2020-03-06 14:44 ` [PATCH 2/2] staging: wilc1000: use single DT binding documentation for SDIO and SPI Ajay.Kathat
  0 siblings, 2 replies; 5+ messages in thread
From: Ajay.Kathat @ 2020-03-06 14:44 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, devicetree, gregkh, Adham.Abozaeid, johannes, robh, Ajay.Kathat

From: Ajay Singh <ajay.kathat@microchip.com>

This patch series contains changes to handle DT binding documentation
related review comments. The changes were suggested during the full
driver review [1] & [2].
First submitting these patches to staging and later will include them
as part of the full driver review patch series.

[1]. https://patchwork.kernel.org/patch/11415897
[2]. https://patchwork.kernel.org/patch/11415901

Ajay Singh (2):
  staging: wilc1000: use 'interrupts' property instead of 'irq-gpio'
  staging: wilc1000: use single DT binding documentation for SDIO and
    SPI

 .../net/wireless/microchip,wilc1000.yaml      | 79 +++++++++++++++++++
 .../wilc1000/microchip,wilc1000,sdio.yaml     | 68 ----------------
 .../wilc1000/microchip,wilc1000,spi.yaml      | 61 --------------
 .../staging/wilc1000/microchip,wilc1000.yaml  | 79 +++++++++++++++++++
 drivers/staging/wilc1000/netdev.c             | 24 ++----
 drivers/staging/wilc1000/netdev.h             |  1 -
 drivers/staging/wilc1000/sdio.c               | 35 ++++----
 drivers/staging/wilc1000/spi.c                | 17 +---
 drivers/staging/wilc1000/wlan.h               |  1 -
 9 files changed, 182 insertions(+), 183 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/microchip,wilc1000.yaml
 delete mode 100644 drivers/staging/wilc1000/microchip,wilc1000,sdio.yaml
 delete mode 100644 drivers/staging/wilc1000/microchip,wilc1000,spi.yaml
 create mode 100644 drivers/staging/wilc1000/microchip,wilc1000.yaml

-- 
2.24.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] staging: wilc1000: use single DT binding documentation for SDIO and SPI
  2020-03-06 14:44 [PATCH 0/2] staging: wilc1000: handle DT binding documentation comments Ajay.Kathat
  2020-03-06 14:44 ` [PATCH 1/2] staging: wilc1000: use 'interrupts' property instead of 'irq-gpio' Ajay.Kathat
@ 2020-03-06 14:44 ` Ajay.Kathat
  1 sibling, 0 replies; 5+ messages in thread
From: Ajay.Kathat @ 2020-03-06 14:44 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, devicetree, gregkh, Adham.Abozaeid, johannes, robh, Ajay.Kathat

From: Ajay Singh <ajay.kathat@microchip.com>

Merged the DT binding documentation of SDIO and SPI into a single file.
Removed documentation for some of the properties which are not required
and handled review comments received in [1] & [2].

[1]. https://lore.kernel.org/linux-wireless/20200303020230.GA15543@bogus
[2]. https://lore.kernel.org/linux-wireless/20200303015558.GA6876@bogus

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
 .../wilc1000/microchip,wilc1000,sdio.yaml     | 68 -------------------
 ...c1000,spi.yaml => microchip,wilc1000.yaml} | 44 ++++++++----
 drivers/staging/wilc1000/sdio.c               |  4 +-
 drivers/staging/wilc1000/spi.c                |  2 +-
 4 files changed, 34 insertions(+), 84 deletions(-)
 delete mode 100644 drivers/staging/wilc1000/microchip,wilc1000,sdio.yaml
 rename drivers/staging/wilc1000/{microchip,wilc1000,spi.yaml => microchip,wilc1000.yaml} (53%)

diff --git a/drivers/staging/wilc1000/microchip,wilc1000,sdio.yaml b/drivers/staging/wilc1000/microchip,wilc1000,sdio.yaml
deleted file mode 100644
index 9df7327bc668..000000000000
--- a/drivers/staging/wilc1000/microchip,wilc1000,sdio.yaml
+++ /dev/null
@@ -1,68 +0,0 @@
-# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
-%YAML 1.2
----
-$id: http://devicetree.org/schemas/net/wireless/microchip,wilc1000,sdio.yaml#
-$schema: http://devicetree.org/meta-schemas/core.yaml#
-
-title: Microchip WILC wireless SDIO devicetree bindings
-
-maintainers:
-  - Adham Abozaeid <adham.abozaeid@microchip.com>
-  - Ajay Singh <ajay.kathat@microchip.com>
-
-description:
-  The wilc1000 chips can be connected via SDIO. The node is used to
-  specify child node to the SDIO controller that connects the device
-  to the system.
-
-properties:
-  compatible:
-    const: microchip,wilc1000-sdio
-
-  interrupts:
-    maxItems: 1
-
-  reg:
-    description: Slot ID used in the controller.
-    maxItems: 1
-
-  clocks:
-    description: phandle to the clock connected on rtc clock line.
-    maxItems: 1
-
-  bus-width:
-    description: The number of data lines wired up the slot.
-    allOf:
-      - $ref: /schemas/types.yaml#/definitions/uint32
-      - enum: [1, 4, 8]
-      - default: 1
-
-required:
-  - compatible
-  - interrupts
-  - reg
-
-examples:
-  - |
-    mmc1: mmc@fc000000 {
-      #address-cells = <1>;
-      #size-cells = <0>;
-      pinctrl-names = "default";
-      pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3>;
-      non-removable;
-      vmmc-supply = <&vcc_mmc1_reg>;
-      vqmmc-supply = <&vcc_3v3_reg>;
-      status = "okay";
-      wilc_sdio@0 {
-        compatible = "microchip,wilc1000-sdio";
-        interrupt-parent = <&pioC>;
-        interrupts = <27 0>;
-          reg = <0>;
-          clocks = <&pck1>;
-          clock-names = "rtc_clk";
-          assigned-clocks = <&pck1>;
-          assigned-clock-rates = <32768>;
-          status = "okay";
-          bus-width = <4>;
-        };
-    };
diff --git a/drivers/staging/wilc1000/microchip,wilc1000,spi.yaml b/drivers/staging/wilc1000/microchip,wilc1000.yaml
similarity index 53%
rename from drivers/staging/wilc1000/microchip,wilc1000,spi.yaml
rename to drivers/staging/wilc1000/microchip,wilc1000.yaml
index dd5e8da1f562..a1914449ad07 100644
--- a/drivers/staging/wilc1000/microchip,wilc1000,spi.yaml
+++ b/drivers/staging/wilc1000/microchip,wilc1000.yaml
@@ -1,22 +1,22 @@
 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
 %YAML 1.2
 ---
-$id: http://devicetree.org/schemas/net/wireless/microchip,wilc1000,spi.yaml#
+$id: http://devicetree.org/schemas/net/wireless/microchip,wilc1000.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
-title: Microchip WILC wireless SPI devicetree bindings
+title: Microchip WILC wireless devicetree bindings
 
 maintainers:
   - Adham Abozaeid <adham.abozaeid@microchip.com>
   - Ajay Singh <ajay.kathat@microchip.com>
 
 description:
-  The wilc1000 chips can be connected via SPI. This document describes
-  the binding for the SPI connected module.
+  The wilc1000 chips can be connected via SPI or SDIO. This document
+  describes the binding to connect wilc devices.
 
 properties:
   compatible:
-    const: microchip,wilc1000-spi
+    const: microchip,wilc1000
 
   spi-max-frequency:
     description: Maximum SPI clocking speed of device in Hz.
@@ -33,9 +33,11 @@ properties:
     description: phandle to the clock connected on rtc clock line.
     maxItems: 1
 
+  clock-names:
+    const: rtc
+
 required:
   - compatible
-  - spi-max-frequency
   - reg
   - interrupts
 
@@ -45,17 +47,33 @@ examples:
       #address-cells = <1>;
       #size-cells = <0>;
       cs-gpios = <&pioB 21 0>;
-      status = "okay";
-      wilc_spi@0 {
-        compatible = "microchip,wilc1000-spi";
+      wifi@0 {
+        compatible = "microchip,wilc1000";
         spi-max-frequency = <48000000>;
         reg = <0>;
         interrupt-parent = <&pioC>;
         interrupts = <27 0>;
         clocks = <&pck1>;
-        clock-names = "rtc_clk";
-        assigned-clocks = <&pck1>;
-        assigned-clock-rates = <32768>;
-        status = "okay";
+        clock-names = "rtc";
+      };
+    };
+
+  - |
+    mmc1: mmc@fc000000 {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      pinctrl-names = "default";
+      pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3>;
+      non-removable;
+      vmmc-supply = <&vcc_mmc1_reg>;
+      vqmmc-supply = <&vcc_3v3_reg>;
+      bus-width = <4>;
+      wifi@0 {
+        compatible = "microchip,wilc1000";
+        reg = <0>;
+        interrupt-parent = <&pioC>;
+        interrupts = <27 0>;
+        clocks = <&pck1>;
+        clock-names = "rtc";
       };
     };
diff --git a/drivers/staging/wilc1000/sdio.c b/drivers/staging/wilc1000/sdio.c
index 44b426874c1b..36eb589263bf 100644
--- a/drivers/staging/wilc1000/sdio.c
+++ b/drivers/staging/wilc1000/sdio.c
@@ -150,7 +150,7 @@ static int wilc_sdio_probe(struct sdio_func *func,
 	wilc->bus_data = sdio_priv;
 	wilc->dev = &func->dev;
 
-	wilc->rtc_clk = devm_clk_get(&func->card->dev, "rtc_clk");
+	wilc->rtc_clk = devm_clk_get(&func->card->dev, "rtc");
 	if (PTR_ERR_OR_ZERO(wilc->rtc_clk) == -EPROBE_DEFER)
 		return -EPROBE_DEFER;
 	else if (!IS_ERR(wilc->rtc_clk))
@@ -997,7 +997,7 @@ static int wilc_sdio_resume(struct device *dev)
 }
 
 static const struct of_device_id wilc_of_match[] = {
-	{ .compatible = "microchip,wilc1000-sdio", },
+	{ .compatible = "microchip,wilc1000", },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, wilc_of_match);
diff --git a/drivers/staging/wilc1000/spi.c b/drivers/staging/wilc1000/spi.c
index 852f318a86f0..d77582c55326 100644
--- a/drivers/staging/wilc1000/spi.c
+++ b/drivers/staging/wilc1000/spi.c
@@ -189,7 +189,7 @@ static int wilc_bus_remove(struct spi_device *spi)
 }
 
 static const struct of_device_id wilc_of_match[] = {
-	{ .compatible = "microchip,wilc1000-spi", },
+	{ .compatible = "microchip,wilc1000", },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, wilc_of_match);
-- 
2.24.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] staging: wilc1000: use 'interrupts' property instead of 'irq-gpio'
  2020-03-06 14:44 ` [PATCH 1/2] staging: wilc1000: use 'interrupts' property instead of 'irq-gpio' Ajay.Kathat
@ 2020-03-06 15:35   ` Rob Herring
  2020-03-07  8:50     ` Ajay.Kathat
  0 siblings, 1 reply; 5+ messages in thread
From: Rob Herring @ 2020-03-06 15:35 UTC (permalink / raw)
  To: Ajay.Kathat
  Cc: linux-wireless, open list:STAGING SUBSYSTEM, devicetree,
	Greg Kroah-Hartman, Adham.Abozaeid, Johannes Berg

On Fri, Mar 6, 2020 at 8:44 AM <Ajay.Kathat@microchip.com> wrote:
>
> From: Ajay Singh <ajay.kathat@microchip.com>
>
> Make use of 'interrupts' property instead of using gpio for handling
> the interrupt as suggested in [1].
>
> [1]. https://lore.kernel.org/linux-wireless/20200303015558.GA6876@bogus/
>
> Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
> ---
>  .../net/wireless/microchip,wilc1000.yaml      | 79 +++++++++++++++++++
>  .../wilc1000/microchip,wilc1000,sdio.yaml     |  8 +-
>  .../wilc1000/microchip,wilc1000,spi.yaml      |  8 +-

Bindings should be a separate patch.

>  drivers/staging/wilc1000/netdev.c             | 24 ++----
>  drivers/staging/wilc1000/netdev.h             |  1 -
>  drivers/staging/wilc1000/sdio.c               | 31 +++-----
>  drivers/staging/wilc1000/spi.c                | 15 +---
>  drivers/staging/wilc1000/wlan.h               |  1 -
>  8 files changed, 108 insertions(+), 59 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/net/wireless/microchip,wilc1000.yaml
>
> diff --git a/Documentation/devicetree/bindings/net/wireless/microchip,wilc1000.yaml b/Documentation/devicetree/bindings/net/wireless/microchip,wilc1000.yaml
> new file mode 100644
> index 000000000000..a1914449ad07
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/wireless/microchip,wilc1000.yaml
> @@ -0,0 +1,79 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/wireless/microchip,wilc1000.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Microchip WILC wireless devicetree bindings
> +
> +maintainers:
> +  - Adham Abozaeid <adham.abozaeid@microchip.com>
> +  - Ajay Singh <ajay.kathat@microchip.com>
> +
> +description:
> +  The wilc1000 chips can be connected via SPI or SDIO. This document
> +  describes the binding to connect wilc devices.
> +
> +properties:
> +  compatible:
> +    const: microchip,wilc1000
> +
> +  spi-max-frequency:
> +    description: Maximum SPI clocking speed of device in Hz.
> +    maxItems: 1

No need to redefine a common property. Just:

spi-max-frequency: true

> +
> +  reg:
> +    description: Chip select address of device.

Drop this.

> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  clocks:
> +    description: phandle to the clock connected on rtc clock line.
> +    maxItems: 1
> +
> +  clock-names:
> +    const: rtc
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +
> +examples:
> +  - |
> +    spi1: spi@fc018000 {
> +      #address-cells = <1>;
> +      #size-cells = <0>;
> +      cs-gpios = <&pioB 21 0>;
> +      wifi@0 {
> +        compatible = "microchip,wilc1000";
> +        spi-max-frequency = <48000000>;
> +        reg = <0>;
> +        interrupt-parent = <&pioC>;
> +        interrupts = <27 0>;
> +        clocks = <&pck1>;
> +        clock-names = "rtc";
> +      };
> +    };
> +
> +  - |
> +    mmc1: mmc@fc000000 {
> +      #address-cells = <1>;
> +      #size-cells = <0>;
> +      pinctrl-names = "default";
> +      pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3>;
> +      non-removable;
> +      vmmc-supply = <&vcc_mmc1_reg>;
> +      vqmmc-supply = <&vcc_3v3_reg>;
> +      bus-width = <4>;
> +      wifi@0 {
> +        compatible = "microchip,wilc1000";
> +        reg = <0>;
> +        interrupt-parent = <&pioC>;
> +        interrupts = <27 0>;
> +        clocks = <&pck1>;
> +        clock-names = "rtc";
> +      };
> +    };
> diff --git a/drivers/staging/wilc1000/microchip,wilc1000,sdio.yaml b/drivers/staging/wilc1000/microchip,wilc1000,sdio.yaml
> index b338f569f7e2..9df7327bc668 100644
> --- a/drivers/staging/wilc1000/microchip,wilc1000,sdio.yaml
> +++ b/drivers/staging/wilc1000/microchip,wilc1000,sdio.yaml

Why aren't you just removing this file and the spi one?

Rob

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] staging: wilc1000: use 'interrupts' property instead of 'irq-gpio'
  2020-03-06 15:35   ` Rob Herring
@ 2020-03-07  8:50     ` Ajay.Kathat
  0 siblings, 0 replies; 5+ messages in thread
From: Ajay.Kathat @ 2020-03-07  8:50 UTC (permalink / raw)
  To: robh; +Cc: devel, devicetree, gregkh, linux-wireless, Adham.Abozaeid, johannes

Hi Rob,

On 06/03/20 9:05 pm, Rob Herring wrote:
> 
> On Fri, Mar 6, 2020 at 8:44 AM <Ajay.Kathat@microchip.com> wrote:
>>
>> From: Ajay Singh <ajay.kathat@microchip.com>
>>
>> Make use of 'interrupts' property instead of using gpio for handling
>> the interrupt as suggested in [1].
>>
>> [1]. https://lore.kernel.org/linux-wireless/20200303015558.GA6876@bogus/
>>
>> Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
>> ---
>>  .../net/wireless/microchip,wilc1000.yaml      | 79 +++++++++++++++++++
>>  .../wilc1000/microchip,wilc1000,sdio.yaml     |  8 +-
>>  .../wilc1000/microchip,wilc1000,spi.yaml      |  8 +-
> 
> Bindings should be a separate patch.
> 

Ok. I will add them in separate patch.

>>  drivers/staging/wilc1000/netdev.c             | 24 ++----
>>  drivers/staging/wilc1000/netdev.h             |  1 -
>>  drivers/staging/wilc1000/sdio.c               | 31 +++-----
>>  drivers/staging/wilc1000/spi.c                | 15 +---
>>  drivers/staging/wilc1000/wlan.h               |  1 -
>>  8 files changed, 108 insertions(+), 59 deletions(-)
>>  create mode 100644 Documentation/devicetree/bindings/net/wireless/microchip,wilc1000.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/net/wireless/microchip,wilc1000.yaml b/Documentation/devicetree/bindings/net/wireless/microchip,wilc1000.yaml
>> new file mode 100644
>> index 000000000000..a1914449ad07
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/wireless/microchip,wilc1000.yaml
>> @@ -0,0 +1,79 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/net/wireless/microchip,wilc1000.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Microchip WILC wireless devicetree bindings
>> +
>> +maintainers:
>> +  - Adham Abozaeid <adham.abozaeid@microchip.com>
>> +  - Ajay Singh <ajay.kathat@microchip.com>
>> +
>> +description:
>> +  The wilc1000 chips can be connected via SPI or SDIO. This document
>> +  describes the binding to connect wilc devices.
>> +
>> +properties:
>> +  compatible:
>> +    const: microchip,wilc1000
>> +
>> +  spi-max-frequency:
>> +    description: Maximum SPI clocking speed of device in Hz.
>> +    maxItems: 1
> 
> No need to redefine a common property. Just:
> 
> spi-max-frequency: true
> 
Ok. I will changes this.

>> +
>> +  reg:
>> +    description: Chip select address of device.
> 
> Drop this.
>

Ok.

>> +    maxItems: 1
>> +
>> +  interrupts:
>> +    maxItems: 1
>> +
>> +  clocks:
>> +    description: phandle to the clock connected on rtc clock line.
>> +    maxItems: 1
>> +
>> +  clock-names:
>> +    const: rtc
>> +
>> +required:
>> +  - compatible
>> +  - reg
>> +  - interrupts
>> +
>> +examples:
>> +  - |
>> +    spi1: spi@fc018000 {
>> +      #address-cells = <1>;
>> +      #size-cells = <0>;
>> +      cs-gpios = <&pioB 21 0>;
>> +      wifi@0 {
>> +        compatible = "microchip,wilc1000";
>> +        spi-max-frequency = <48000000>;
>> +        reg = <0>;
>> +        interrupt-parent = <&pioC>;
>> +        interrupts = <27 0>;
>> +        clocks = <&pck1>;
>> +        clock-names = "rtc";
>> +      };
>> +    };
>> +
>> +  - |
>> +    mmc1: mmc@fc000000 {
>> +      #address-cells = <1>;
>> +      #size-cells = <0>;
>> +      pinctrl-names = "default";
>> +      pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3>;
>> +      non-removable;
>> +      vmmc-supply = <&vcc_mmc1_reg>;
>> +      vqmmc-supply = <&vcc_3v3_reg>;
>> +      bus-width = <4>;
>> +      wifi@0 {
>> +        compatible = "microchip,wilc1000";
>> +        reg = <0>;
>> +        interrupt-parent = <&pioC>;
>> +        interrupts = <27 0>;
>> +        clocks = <&pck1>;
>> +        clock-names = "rtc";
>> +      };
>> +    };
>> diff --git a/drivers/staging/wilc1000/microchip,wilc1000,sdio.yaml b/drivers/staging/wilc1000/microchip,wilc1000,sdio.yaml
>> index b338f569f7e2..9df7327bc668 100644
>> --- a/drivers/staging/wilc1000/microchip,wilc1000,sdio.yaml
>> +++ b/drivers/staging/wilc1000/microchip,wilc1000,sdio.yaml
> 
> Why aren't you just removing this file and the spi one?


The binding file wrongly got added in this patch. It needs to be added
only to '/driver/staging/wilc1000'. I will update this and send v2
series by keeping binding patch separate from code changes.

Regards,
Ajay

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-03-07  8:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-06 14:44 [PATCH 0/2] staging: wilc1000: handle DT binding documentation comments Ajay.Kathat
2020-03-06 14:44 ` [PATCH 1/2] staging: wilc1000: use 'interrupts' property instead of 'irq-gpio' Ajay.Kathat
2020-03-06 15:35   ` Rob Herring
2020-03-07  8:50     ` Ajay.Kathat
2020-03-06 14:44 ` [PATCH 2/2] staging: wilc1000: use single DT binding documentation for SDIO and SPI Ajay.Kathat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).