Skip to contentSkip to conversation

ieee802154: Add support for Cascoda CA8210

PATCH Superseded Harry Morris 5 participants 14 messages Feb 6, 2017 – Mar 27, 2017

Subsystems (4)

v8 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

v8 cover ieee802154: Add support for Cascoda CA8210

This patchset adds a new device driver, documentation and build support for Cascoda's CA8210 IEEE 802.15.4 radio transceiver:
http://www.cascoda.com/products/ca-821x/

v8:
Use module_spi_driver helper
Remove async tx timeout at driver level Style conformance change
Rework synchronous command handling to remove mutex

v7:
Remove use of cs_change property, always transmit full length buffers Implement fully async spi transfers
Combine spi transmission and reception into one function Use completion objects when waiting for events
Rework a lot of locking
Remove deprecated xmit_sync
Remove use of workqueue for IRQ handling

v6:
Kernel style conformance changes
Additional documentation
More meaningful register structs/macros
Removal of old TODOs
Removal of unnecessary macros
Check for safe removal of test interface

v5:
+Cc: Marcel Holtmann

v4:
Added allowable tx_powers and cca_ed_levels Changed power units to mbm (tx_power & cca_ed_level)

Harry Morris (3):
ieee802154: Add CA8210 IEEE 802.15.4 device driver
ieee802154: Add device tree documentation for CA8210
ieee802154: Add entry in MAINTAINTERS for CA8210 driver

 .../devicetree/bindings/net/ieee802154/ca8210.txt  |   28 +
 .../devicetree/bindings/vendor-prefixes.txt        |    1 +
 MAINTAINERS                                        |    9 +
 drivers/net/ieee802154/Kconfig                     |   21 +
 drivers/net/ieee802154/Makefile                    |    1 +
 drivers/net/ieee802154/ca8210.c                    | 3155 ++++++++++++++++++++
 6 files changed, 3215 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/ieee802154/ca8210.txt
 create mode 100644 drivers/net/ieee802154/ca8210.c
Signature · 1 line
2.9.3.windows.1
#1 lore raw

PATCH v8 1/3 ieee802154: Add CA8210 IEEE 802.15.4 device driver

Add driver source and config for softMAC implementation of Cascoda's CA8210 IEEE 802.15.4 transceiver device. The driver mimics a common PHY-only implementation despite the CA8210 being a hardMAC device which exposes a SAP interface to the fully integrated MAC.

The chip is a modem-only device with an integrated processor which runs the 802.15.4 MAC. The chip communicates via full-duplex SPI with additional pins for NIRQ and NRESET. The chip can also output its 16MHz clock to a GPIO with a configurable divider.

The driver can be configured to implement a debugfs node that provides access to the SAP-based API to drive mechanisms not currently supported by the standard kernel interface.

---
 drivers/net/ieee802154/Kconfig  |   21 +
 drivers/net/ieee802154/Makefile |    1 +
 drivers/net/ieee802154/ca8210.c | 3155 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 3177 insertions(+)
 create mode 100644 drivers/net/ieee802154/ca8210.c
drivers/net/ieee802154/Kconfig +21 -0
index 3057a8d..d3b3a60 100644
@@ -82,3 +82,24 @@ config IEEE802154_ADF7242
 
 	  This driver can also be built as a module. To do so, say M here.
 	  the module will be called 'adf7242'.
+
+config IEEE802154_CA8210
+	tristate "Cascoda CA8210 transceiver driver"
+	depends on IEEE802154_DRIVERS && MAC802154
+	depends on SPI
+	---help---
+	  Say Y here to enable the CA8210 SPI 802.15.4 wireless
+	  controller.
+
+	  This driver can also be built as a module. To do so, say M here.
+	  the module will be called 'ca8210'.
+
+config IEEE802154_CA8210_DEBUGFS
+	bool "CA8210 debugfs interface"
+	depends on IEEE802154_CA8210
+	depends on DEBUG_FS
+	---help---
+	  This option compiles debugfs code for the ca8210 driver. This
+	  exposes a debugfs node for each CA8210 instance which allows
+	  direct use of the Cascoda API, exposing the 802.15.4 MAC
+	  management entities.
drivers/net/ieee802154/Makefile +1 -0
index 3a923d3..8374bb4 100644
@@ -4,3 +4,4 @@ obj-$(CONFIG_IEEE802154_MRF24J40) += mrf24j40.o
 obj-$(CONFIG_IEEE802154_CC2520) += cc2520.o
 obj-$(CONFIG_IEEE802154_ATUSB) += atusb.o
 obj-$(CONFIG_IEEE802154_ADF7242) += adf7242.o
+obj-$(CONFIG_IEEE802154_CA8210) += ca8210.o
drivers/net/ieee802154/ca8210.c new file +3155 -0

2,972 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.9.3.windows.1

Part of the diff is not shown here. View the raw message.

Acked-by on v8 1/3
#2 lore raw

Re: [PATCH v8 1/3] ieee802154: Add CA8210 IEEE 802.15.4 device driver

Hello.

Quoted 10 lines · Harry Morris

Add driver source and config for softMAC implementation of Cascoda's CA8210 IEEE 802.15.4 transceiver device. The driver mimics a common PHY-only implementation despite the CA8210 being a hardMAC device which exposes a SAP interface to the fully integrated MAC.

The chip is a modem-only device with an integrated processor which runs the 802.15.4 MAC. The chip communicates via full-duplex SPI with additional pins for NIRQ and NRESET. The chip can also output its 16MHz clock to a GPIO with a configurable divider.

Quoted 5 lines

The driver can be configured to implement a debugfs node that provides access to the SAP-based API to drive mechanisms not currently supported by the standard kernel interface.

With the compile problem from common clk solved you can add my ack for the next version:

regards
Stefan Schmidt

#3 lore raw

PATCH v8 2/3 ieee802154: Add device tree documentation for CA8210

In reply to Harry Morris
---
 .../devicetree/bindings/net/ieee802154/ca8210.txt  | 28 ++++++++++++++++++++++
 .../devicetree/bindings/vendor-prefixes.txt        |  1 +
 2 files changed, 29 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/ieee802154/ca8210.txt
Documentation/devicetree/bindings/net/ieee802154/ca8210.txt new file +28 -0
new file mode 100644
index 0000000..a1046e6
@@ -0,0 +1,28 @@
+* CA8210 IEEE 802.15.4 *
+
+Required properties:
+	- compatible:           Should be "cascoda,ca8210"
+	- reg:                  Controlling chip select
+	- spi-max-frequency:    Maximum clock speed, should be *less than*
+	                        4000000
+	- spi-cpol:             Requires inverted clock polarity
+	- reset-gpio:           GPIO attached to reset
+	- irq-gpio:             GPIO attached to IRQ
+Optional properties:
+	- extclock-enable:      Include for the ca8210 to route its 16MHz clock
+	                        to an output
+	- extclock-freq:        Frequency in Hz of the external clock
+	- extclock-gpio:        GPIO of the ca8210 to output the clock on
+
+Example:
+	ca8210@0 {
+		compatible = "cascoda,ca8210";
+		reg = <0>;
+		spi-max-frequency = <3000000>;
+		spi-cpol;
+		reset-gpio = <&gpio1 1 GPIO_ACTIVE_HIGH>;
+		irq-gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>;
+		extclock-enable;
+		extclock-freq = 16000000;
+		extclock-gpio = 2;
+	};
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
index 24c6f65..6c5609f 100644
@@ -47,6 +47,7 @@ brcm	Broadcom Corporation
 buffalo	Buffalo, Inc.
 calxeda	Calxeda
 capella	Capella Microsystems, Inc
+cascoda	Cascoda, Ltd.
 cavium	Cavium, Inc.
 cdns	Cadence Design Systems Inc.
 ceva	Ceva, Inc.
Signature · 1 line
2.9.3.windows.1
#4 lore raw

PATCH v8 3/3 ieee802154: Add entry in MAINTAINTERS for CA8210 driver

In reply to Harry Morris
---
 MAINTAINERS | 9 +++++++++
 1 file changed, 9 insertions(+)
MAINTAINERS +9 -0
index 5e925a2..cb3428f 100644
@@ -2829,6 +2829,15 @@ W:	http://www.linux-c6x.org/wiki/index.php/Main_Page
 S:	Maintained
 F:	arch/c6x/
 
+CA8210 IEEE-802.15.4 RADIO DRIVER
+M:	Harry Morris <[email protected]>
+M:	[email protected]
+L:	[email protected]
+W:	https://github.com/Cascoda/ca8210-linux.git
+S:	Maintained
+F:	drivers/net/ieee802154/ca8210.c
+F:	Documentation/devicetree/bindings/net/ieee802154/ca8210.txt
+
 CACHEFILES: FS-CACHE BACKEND FOR CACHING ON MOUNTED FILESYSTEMS
 M:	David Howells <[email protected]>
 L:	[email protected] (moderated for non-subscribers)
Signature · 1 line
2.9.3.windows.1
#5 lore raw
In reply to Harry Morris

Hi Harry,

Quoted 46 lines

This patchset adds a new device driver, documentation and build support for Cascoda's CA8210 IEEE 802.15.4 radio transceiver:
http://www.cascoda.com/products/ca-821x/

v8:
Use module_spi_driver helper
Remove async tx timeout at driver level Style conformance change
Rework synchronous command handling to remove mutex

v7:
Remove use of cs_change property, always transmit full length buffers Implement fully async spi transfers
Combine spi transmission and reception into one function Use completion objects when waiting for events
Rework a lot of locking
Remove deprecated xmit_sync
Remove use of workqueue for IRQ handling

v6:
Kernel style conformance changes
Additional documentation
More meaningful register structs/macros
Removal of old TODOs
Removal of unnecessary macros
Check for safe removal of test interface

v5:
+Cc: Marcel Holtmann

v4:
Added allowable tx_powers and cca_ed_levels Changed power units to mbm (tx_power & cca_ed_level)

Harry Morris (3):
ieee802154: Add CA8210 IEEE 802.15.4 device driver
ieee802154: Add device tree documentation for CA8210
ieee802154: Add entry in MAINTAINTERS for CA8210 driver

.../devicetree/bindings/net/ieee802154/ca8210.txt  |   28 +
.../devicetree/bindings/vendor-prefixes.txt        |    1 +
MAINTAINERS                                        |    9 +
drivers/net/ieee802154/Kconfig                     |   21 +
drivers/net/ieee802154/Makefile                    |    1 +
drivers/net/ieee802154/ca8210.c                    | 3155 ++++++++++++++++++++
6 files changed, 3215 insertions(+)
Quoted 2 lines

create mode 100644 Documentation/devicetree/bindings/net/ieee802154/ca8210.txt create mode 100644 drivers/net/ieee802154/ca8210.c

CC drivers/net/ieee802154/ca8210.o
drivers/net/ieee802154/ca8210.c: In function ‘ca8210_register_ext_clock’:
drivers/net/ieee802154/ca8210.c:2698:14: error: implicit declaration of function ‘clk_register_fixed_rate’ [-Werror=implicit-function-declaratio]
priv->clk = clk_register_fixed_rate(

              ^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2698:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
  priv->clk = clk_register_fixed_rate(
            ^
drivers/net/ieee802154/ca8210.c:2710:8: error: implicit declaration of function ‘of_clk_add_provider’ [-Werror=implicit-function-declaration]
  ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
        ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2710:32: error: ‘of_clk_src_simple_get’ undeclared (first use in this function)
  ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
                                ^~~~~~~~~~~~~~~~~~~~~

drivers/net/ieee802154/ca8210.c:2710:32: note: each undeclared identifier is reported only once for each function it appears in drivers/net/ieee802154/ca8210.c:2712:3: error: implicit declaration of function ‘clk_unregister’ [-Werror=implicit-function-declaration]
clk_unregister(priv->clk);
^~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c: In function ‘ca8210_unregister_ext_clock’:
drivers/net/ieee802154/ca8210.c:2736:2: error: implicit declaration of function ‘of_clk_del_provider’ [-Werror=implicit-function-declaration]
of_clk_del_provider(spi->dev.of_node);
^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2736:2: warning: ‘return’ with a value, in function returning void
of_clk_del_provider(spi->dev.of_node);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2729:13: note: declared here
static void ca8210_unregister_ext_clock(struct spi_device *spi)

             ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Regards

Marcel

#6 lore raw

Hi Marcel,

Quoted 70 lines · Marcel Holtmann

Hi Harry,

Quoted 46 lines

This patchset adds a new device driver, documentation and build support for Cascoda's CA8210 IEEE 802.15.4 radio transceiver:
http://www.cascoda.com/products/ca-821x/

v8:
Use module_spi_driver helper
Remove async tx timeout at driver level Style conformance change
Rework synchronous command handling to remove mutex

v7:
Remove use of cs_change property, always transmit full length buffers Implement fully async spi transfers
Combine spi transmission and reception into one function Use completion objects when waiting for events
Rework a lot of locking
Remove deprecated xmit_sync
Remove use of workqueue for IRQ handling

v6:
Kernel style conformance changes
Additional documentation
More meaningful register structs/macros
Removal of old TODOs
Removal of unnecessary macros
Check for safe removal of test interface

v5:
+Cc: Marcel Holtmann

v4:
Added allowable tx_powers and cca_ed_levels Changed power units to mbm (tx_power & cca_ed_level)

Harry Morris (3):
ieee802154: Add CA8210 IEEE 802.15.4 device driver
ieee802154: Add device tree documentation for CA8210
ieee802154: Add entry in MAINTAINTERS for CA8210 driver

.../devicetree/bindings/net/ieee802154/ca8210.txt  |   28 +
.../devicetree/bindings/vendor-prefixes.txt        |    1 +
MAINTAINERS                                        |    9 +
drivers/net/ieee802154/Kconfig                     |   21 +
drivers/net/ieee802154/Makefile                    |    1 +
drivers/net/ieee802154/ca8210.c                    | 3155 ++++++++++++++++++++
6 files changed, 3215 insertions(+)
Quoted 2 lines

create mode 100644 Documentation/devicetree/bindings/net/ieee802154/ca8210.txt create mode 100644 drivers/net/ieee802154/ca8210.c

CC drivers/net/ieee802154/ca8210.o
drivers/net/ieee802154/ca8210.c: In function ‘ca8210_register_ext_clock’:
drivers/net/ieee802154/ca8210.c:2698:14: error: implicit declaration of function ‘clk_register_fixed_rate’ [-Werror=implicit-function-declaratio]
priv->clk = clk_register_fixed_rate(

               ^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2698:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
   priv->clk = clk_register_fixed_rate(
             ^
drivers/net/ieee802154/ca8210.c:2710:8: error: implicit declaration of function ‘of_clk_add_provider’ [-Werror=implicit-function-declaration]
   ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
         ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2710:32: error: ‘of_clk_src_simple_get’ undeclared (first use in this function)
   ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
                                 ^~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2710:32: note: each undeclared identifier is reported only once for each function it appears in
drivers/net/ieee802154/ca8210.c:2712:3: error: implicit declaration of function ‘clk_unregister’ [-Werror=implicit-function-declaration]
    clk_unregister(priv->clk);
    ^~~~~~~~~~~~~~

drivers/net/ieee802154/ca8210.c: In function ‘ca8210_unregister_ext_clock’:
drivers/net/ieee802154/ca8210.c:2736:2: error: implicit declaration of function ‘of_clk_del_provider’ [-Werror=implicit-function-declaration]

Quoted 9 lines
   of_clk_del_provider(spi->dev.of_node);
   ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2736:2: warning: ‘return’ with a value, in function returning void
   of_clk_del_provider(spi->dev.of_node);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2729:13: note: declared here
  static void ca8210_unregister_ext_clock(struct spi_device *spi)
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~

I remember these same issues being raised previously and found the old exchange:

Quoted 34 lines

Hi Stefan, Marcel,

Apologies for the slow reply, I've been snowed under the past week or so...

Quoted 29 lines · Stefan Schmidt
Quoted 27 lines · Marcel Holtmann

drivers/net/ieee802154/ca8210.c: In function ‘ca8210_register_ext_clock’:
drivers/net/ieee802154/ca8210.c:3159:14: error: implicit declaration of function ‘clk_register_fixed_rate’ [-Werror=implicit-function-declaratio]
priv->clk = clk_register_fixed_rate(

              ^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3159:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
  priv->clk = clk_register_fixed_rate(
            ^
drivers/net/ieee802154/ca8210.c:3171:8: error: implicit declaration of function ‘of_clk_add_provider’ [-Werror=implicit-function-declaration]
  ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
        ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3171:32: error: ‘of_clk_src_simple_get’ undeclared (first use in this function)
  ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
                                ^~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3171:32: note: each undeclared identifier is reported only once for each function it appears in
drivers/net/ieee802154/ca8210.c:3173:3: error: implicit declaration of function ‘clk_unregister’ [-Werror=implicit-function-declaration]
   clk_unregister(priv->clk);
   ^~~~~~~~~~~~~~

drivers/net/ieee802154/ca8210.c: In function ‘ca8210_unregister_ext_clock’:
drivers/net/ieee802154/ca8210.c:3197:2: error: implicit declaration of function ‘of_clk_del_provider’ [-Werror=implicit-function-declaration]
of_clk_del_provider(spi->dev.of_node);
^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3197:2: warning: ‘return’ with a value, in function returning void
of_clk_del_provider(spi->dev.of_node);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3190:13: note: declared here
static void ca8210_unregister_ext_clock(struct spi_device *spi)

             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 3 lines
Quoted 1 line

None of these showed up here. A #include <linux/clk-provider.h> should fix those imho.

I'm also not seeing these, I am including <linux/clk-provider.h> in my file, is there any action needed on my part?

I couldn't find any further discussion but again I'm including clk-provider.h which should cover all this?

Regards,
Harry

#7 lore raw

Hello.

Quoted 146 lines · Harry Morris

Hi Marcel,

Quoted 82 lines · Marcel Holtmann

Hi Harry,

Quoted 48 lines

This patchset adds a new device driver, documentation and build support for
Cascoda's CA8210 IEEE 802.15.4 radio transceiver:
http://www.cascoda.com/products/ca-821x/

v8:
Use module_spi_driver helper
Remove async tx timeout at driver level Style conformance change
Rework synchronous command handling to remove mutex

v7:
Remove use of cs_change property, always transmit full length buffers Implement fully async spi transfers
Combine spi transmission and reception into one function Use completion objects when waiting for events
Rework a lot of locking
Remove deprecated xmit_sync
Remove use of workqueue for IRQ handling

v6:
Kernel style conformance changes
Additional documentation
More meaningful register structs/macros
Removal of old TODOs
Removal of unnecessary macros
Check for safe removal of test interface

v5:
+Cc: Marcel Holtmann

v4:
Added allowable tx_powers and cca_ed_levels Changed power units to mbm (tx_power & cca_ed_level)

Harry Morris (3):
ieee802154: Add CA8210 IEEE 802.15.4 device driver
ieee802154: Add device tree documentation for CA8210
ieee802154: Add entry in MAINTAINTERS for CA8210 driver

.../devicetree/bindings/net/ieee802154/ca8210.txt  |   28 +
.../devicetree/bindings/vendor-prefixes.txt        |    1 +
MAINTAINERS                                        |    9 +
drivers/net/ieee802154/Kconfig                     |   21 +
drivers/net/ieee802154/Makefile                    |    1 +
drivers/net/ieee802154/ca8210.c                    | 3155
++++++++++++++++++++
6 files changed, 3215 insertions(+)
Quoted 3 lines

create mode 100644 Documentation/devicetree/bindings/net/ieee802154/ca8210.txt create mode 100644 drivers/net/ieee802154/ca8210.c

CC drivers/net/ieee802154/ca8210.o
drivers/net/ieee802154/ca8210.c: In function ‘ca8210_register_ext_clock’:
drivers/net/ieee802154/ca8210.c:2698:14: error: implicit declaration of function ‘clk_register_fixed_rate’ [-Werror=implicit-function-declaratio]
priv->clk = clk_register_fixed_rate(

               ^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2698:12: warning: assignment makes
pointer from integer without a cast [-Wint-conversion]
   priv->clk = clk_register_fixed_rate(
             ^
drivers/net/ieee802154/ca8210.c:2710:8: error: implicit declaration of
function ‘of_clk_add_provider’ [-Werror=implicit-function-declaration]
   ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
         ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2710:32: error:
‘of_clk_src_simple_get’ undeclared (first use in this function)
   ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
                                 ^~~~~~~~~~~~~~~~~~~~~

drivers/net/ieee802154/ca8210.c:2710:32: note: each undeclared identifier is reported only once for each function it appears in drivers/net/ieee802154/ca8210.c:2712:3: error: implicit declaration of function ‘clk_unregister’ [-Werror=implicit-function-declaration]

    clk_unregister(priv->clk);
    ^~~~~~~~~~~~~~

drivers/net/ieee802154/ca8210.c: In function ‘ca8210_unregister_ext_clock’:
drivers/net/ieee802154/ca8210.c:2736:2: error: implicit declaration of function ‘of_clk_del_provider’ [-Werror=implicit-function-declaration]

Quoted 10 lines
   of_clk_del_provider(spi->dev.of_node);
   ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2736:2: warning: ‘return’ with a
value, in function returning void
   of_clk_del_provider(spi->dev.of_node);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2729:13: note: declared here
  static void ca8210_unregister_ext_clock(struct spi_device *spi)
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~

I remember these same issues being raised previously and found the old exchange:

Quoted 48 lines

Hi Stefan, Marcel,

Apologies for the slow reply, I've been snowed under the past week or so...

Quoted 42 lines · Stefan Schmidt
Quoted 40 lines · Marcel Holtmann

drivers/net/ieee802154/ca8210.c: In function ‘ca8210_register_ext_clock’:
drivers/net/ieee802154/ca8210.c:3159:14: error: implicit declaration of function ‘clk_register_fixed_rate’ [-Werror=implicit-function-declaratio]
priv->clk = clk_register_fixed_rate(

              ^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3159:12: warning: assignment makes
pointer from integer without a cast [-Wint-conversion]
  priv->clk = clk_register_fixed_rate(
            ^
drivers/net/ieee802154/ca8210.c:3171:8: error: implicit declaration
of function ‘of_clk_add_provider’
[-Werror=implicit-function-declaration]
  ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
        ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3171:32: error:
‘of_clk_src_simple_get’ undeclared (first use in this function)
  ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
                                ^~~~~~~~~~~~~~~~~~~~~

drivers/net/ieee802154/ca8210.c:3171:32: note: each undeclared identifier is reported only once for each function it appears in drivers/net/ieee802154/ca8210.c:3173:3: error: implicit declaration of function ‘clk_unregister’ [-Werror=implicit-function-declaration]

   clk_unregister(priv->clk);
   ^~~~~~~~~~~~~~

drivers/net/ieee802154/ca8210.c: In function ‘ca8210_unregister_ext_clock’:
drivers/net/ieee802154/ca8210.c:3197:2: error: implicit declaration of function ‘of_clk_del_provider’ [-Werror=implicit-function-declaration]
of_clk_del_provider(spi->dev.of_node); ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3197:2: warning: ‘return’ with a value, in function returning void
of_clk_del_provider(spi->dev.of_node); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3190:13: note: declared here
static void ca8210_unregister_ext_clock(struct spi_device *spi)

             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

None of these showed up here. A #include <linux/clk-provider.h> should fix those imho.

I'm also not seeing these, I am including <linux/clk-provider.h> in my file, is there any action needed on my part?

I couldn't find any further discussion but again I'm including clk-provider.h which should cover all this?

I had another look at this and I would suspect that the config Marcel used does no have CONFIG_COMMON_CLK enabled. Marcel, could you confirm this?

In that case we need either a select COMMON_CLK in the KConfig entry of your driver to make sure it really is enabled.

regards
Stefan Schmidt

#8 lore raw

Hi Stefan,

Quoted 147 lines
Quoted 147 lines
Quoted 88 lines
Quoted 48 lines

This patchset adds a new device driver, documentation and build support for
Cascoda's CA8210 IEEE 802.15.4 radio transceiver:
http://www.cascoda.com/products/ca-821x/

v8:
Use module_spi_driver helper
Remove async tx timeout at driver level Style conformance change
Rework synchronous command handling to remove mutex

v7:
Remove use of cs_change property, always transmit full length buffers Implement fully async spi transfers
Combine spi transmission and reception into one function Use completion objects when waiting for events
Rework a lot of locking
Remove deprecated xmit_sync
Remove use of workqueue for IRQ handling

v6:
Kernel style conformance changes
Additional documentation
More meaningful register structs/macros
Removal of old TODOs
Removal of unnecessary macros
Check for safe removal of test interface

v5:
+Cc: Marcel Holtmann

v4:
Added allowable tx_powers and cca_ed_levels Changed power units to mbm (tx_power & cca_ed_level)

Harry Morris (3):
ieee802154: Add CA8210 IEEE 802.15.4 device driver
ieee802154: Add device tree documentation for CA8210
ieee802154: Add entry in MAINTAINTERS for CA8210 driver

.../devicetree/bindings/net/ieee802154/ca8210.txt  |   28 +
.../devicetree/bindings/vendor-prefixes.txt        |    1 +
MAINTAINERS                                        |    9 +
drivers/net/ieee802154/Kconfig                     |   21 +
drivers/net/ieee802154/Makefile                    |    1 +
drivers/net/ieee802154/ca8210.c                    | 3155
++++++++++++++++++++
6 files changed, 3215 insertions(+)
Quoted 3 lines

create mode 100644 Documentation/devicetree/bindings/net/ieee802154/ca8210.txt create mode 100644 drivers/net/ieee802154/ca8210.c

CC drivers/net/ieee802154/ca8210.o
drivers/net/ieee802154/ca8210.c: In function ‘ca8210_register_ext_clock’:
drivers/net/ieee802154/ca8210.c:2698:14: error: implicit declaration of function ‘clk_register_fixed_rate’ [-Werror=implicit-function-declaratio]
priv->clk = clk_register_fixed_rate(

              ^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2698:12: warning: assignment makes
pointer from integer without a cast [-Wint-conversion]
  priv->clk = clk_register_fixed_rate(
            ^
drivers/net/ieee802154/ca8210.c:2710:8: error: implicit declaration of
function ‘of_clk_add_provider’ [-Werror=implicit-function-declaration]
  ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
        ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2710:32: error:
‘of_clk_src_simple_get’ undeclared (first use in this function)
  ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
                                ^~~~~~~~~~~~~~~~~~~~~

drivers/net/ieee802154/ca8210.c:2710:32: note: each undeclared identifier is reported only once for each function it appears in drivers/net/ieee802154/ca8210.c:2712:3: error: implicit declaration of function ‘clk_unregister’ [-Werror=implicit-function-declaration]

   clk_unregister(priv->clk);
   ^~~~~~~~~~~~~~

drivers/net/ieee802154/ca8210.c: In function ‘ca8210_unregister_ext_clock’:
drivers/net/ieee802154/ca8210.c:2736:2: error: implicit declaration of function ‘of_clk_del_provider’ [-Werror=implicit-function-declaration]
of_clk_del_provider(spi->dev.of_node); ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2736:2: warning: ‘return’ with a value, in function returning void
of_clk_del_provider(spi->dev.of_node); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2729:13: note: declared here
static void ca8210_unregister_ext_clock(struct spi_device *spi)

Quoted 2 lines
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~

I remember these same issues being raised previously and found the old exchange:

Quoted 53 lines

Hi Stefan, Marcel,

Apologies for the slow reply, I've been snowed under the past week or so...

Quoted 42 lines · Stefan Schmidt
Quoted 39 lines · Marcel Holtmann

drivers/net/ieee802154/ca8210.c: In function ‘ca8210_register_ext_clock’:
drivers/net/ieee802154/ca8210.c:3159:14: error: implicit declaration of function ‘clk_register_fixed_rate’ [-Werror=implicit-function-declaratio]
priv->clk = clk_register_fixed_rate(

             ^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3159:12: warning: assignment makes
pointer from integer without a cast [-Wint-conversion]
 priv->clk = clk_register_fixed_rate(
           ^
drivers/net/ieee802154/ca8210.c:3171:8: error: implicit declaration
of function ‘of_clk_add_provider’
[-Werror=implicit-function-declaration]
 ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
       ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3171:32: error:
‘of_clk_src_simple_get’ undeclared (first use in this function)
 ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
                               ^~~~~~~~~~~~~~~~~~~~~

drivers/net/ieee802154/ca8210.c:3171:32: note: each undeclared identifier is reported only once for each function it appears in drivers/net/ieee802154/ca8210.c:3173:3: error: implicit declaration of function ‘clk_unregister’ [-Werror=implicit-function-declaration]
clk_unregister(priv->clk);
^~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c: In function ‘ca8210_unregister_ext_clock’:
drivers/net/ieee802154/ca8210.c:3197:2: error: implicit declaration of function ‘of_clk_del_provider’ [-Werror=implicit-function-declaration]
of_clk_del_provider(spi->dev.of_node); ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3197:2: warning: ‘return’ with a value, in function returning void
of_clk_del_provider(spi->dev.of_node); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3190:13: note: declared here static void ca8210_unregister_ext_clock(struct spi_device *spi)

Quoted 1 line
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 2 lines

None of these showed up here. A #include <linux/clk-provider.h> should fix those imho.

I'm also not seeing these, I am including <linux/clk-provider.h> in my file, is there any action needed on my part?

Quoted 6 lines
Quoted 2 lines

I couldn't find any further discussion but again I'm including clk-provider.h which should cover all this?

I had another look at this and I would suspect that the config Marcel used does no have CONFIG_COMMON_CLK enabled. Marcel, could you confirm this?

In that case we need either a select COMMON_CLK in the KConfig entry of your driver to make sure it really is enabled.

I tried to select COMMON_CLK, but somehow that is not as easy as you think on an x86 kernel. However I want things to compile test at least on x86.

Regards

Marcel

#9 lore raw

Hello.

Quoted 149 lines · Marcel Holtmann

Hi Stefan,

Quoted 147 lines
Quoted 147 lines
Quoted 88 lines
Quoted 48 lines

This patchset adds a new device driver, documentation and build support for
Cascoda's CA8210 IEEE 802.15.4 radio transceiver:
http://www.cascoda.com/products/ca-821x/

v8:
Use module_spi_driver helper
Remove async tx timeout at driver level Style conformance change
Rework synchronous command handling to remove mutex

v7:
Remove use of cs_change property, always transmit full length buffers Implement fully async spi transfers
Combine spi transmission and reception into one function Use completion objects when waiting for events
Rework a lot of locking
Remove deprecated xmit_sync
Remove use of workqueue for IRQ handling

v6:
Kernel style conformance changes
Additional documentation
More meaningful register structs/macros
Removal of old TODOs
Removal of unnecessary macros
Check for safe removal of test interface

v5:
+Cc: Marcel Holtmann

v4:
Added allowable tx_powers and cca_ed_levels Changed power units to mbm (tx_power & cca_ed_level)

Harry Morris (3):
ieee802154: Add CA8210 IEEE 802.15.4 device driver
ieee802154: Add device tree documentation for CA8210
ieee802154: Add entry in MAINTAINTERS for CA8210 driver

.../devicetree/bindings/net/ieee802154/ca8210.txt  |   28 +
.../devicetree/bindings/vendor-prefixes.txt        |    1 +
MAINTAINERS                                        |    9 +
drivers/net/ieee802154/Kconfig                     |   21 +
drivers/net/ieee802154/Makefile                    |    1 +
drivers/net/ieee802154/ca8210.c                    | 3155
++++++++++++++++++++
6 files changed, 3215 insertions(+)
Quoted 3 lines

create mode 100644 Documentation/devicetree/bindings/net/ieee802154/ca8210.txt create mode 100644 drivers/net/ieee802154/ca8210.c

CC drivers/net/ieee802154/ca8210.o
drivers/net/ieee802154/ca8210.c: In function ‘ca8210_register_ext_clock’:
drivers/net/ieee802154/ca8210.c:2698:14: error: implicit declaration of function ‘clk_register_fixed_rate’ [-Werror=implicit-function-declaratio]
priv->clk = clk_register_fixed_rate(

              ^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2698:12: warning: assignment makes
pointer from integer without a cast [-Wint-conversion]
  priv->clk = clk_register_fixed_rate(
            ^
drivers/net/ieee802154/ca8210.c:2710:8: error: implicit declaration of
function ‘of_clk_add_provider’ [-Werror=implicit-function-declaration]
  ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
        ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2710:32: error:
‘of_clk_src_simple_get’ undeclared (first use in this function)
  ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
                                ^~~~~~~~~~~~~~~~~~~~~

drivers/net/ieee802154/ca8210.c:2710:32: note: each undeclared identifier is reported only once for each function it appears in drivers/net/ieee802154/ca8210.c:2712:3: error: implicit declaration of function ‘clk_unregister’ [-Werror=implicit-function-declaration]

   clk_unregister(priv->clk);
   ^~~~~~~~~~~~~~

drivers/net/ieee802154/ca8210.c: In function ‘ca8210_unregister_ext_clock’:
drivers/net/ieee802154/ca8210.c:2736:2: error: implicit declaration of function ‘of_clk_del_provider’ [-Werror=implicit-function-declaration]
of_clk_del_provider(spi->dev.of_node); ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2736:2: warning: ‘return’ with a value, in function returning void
of_clk_del_provider(spi->dev.of_node); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2729:13: note: declared here
static void ca8210_unregister_ext_clock(struct spi_device *spi)

Quoted 2 lines
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~

I remember these same issues being raised previously and found the old exchange:

Quoted 53 lines

Hi Stefan, Marcel,

Apologies for the slow reply, I've been snowed under the past week or so...

Quoted 42 lines · Stefan Schmidt
Quoted 39 lines · Marcel Holtmann

drivers/net/ieee802154/ca8210.c: In function ‘ca8210_register_ext_clock’:
drivers/net/ieee802154/ca8210.c:3159:14: error: implicit declaration of function ‘clk_register_fixed_rate’ [-Werror=implicit-function-declaratio]
priv->clk = clk_register_fixed_rate(

             ^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3159:12: warning: assignment makes
pointer from integer without a cast [-Wint-conversion]
 priv->clk = clk_register_fixed_rate(
           ^
drivers/net/ieee802154/ca8210.c:3171:8: error: implicit declaration
of function ‘of_clk_add_provider’
[-Werror=implicit-function-declaration]
 ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
       ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3171:32: error:
‘of_clk_src_simple_get’ undeclared (first use in this function)
 ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
                               ^~~~~~~~~~~~~~~~~~~~~

drivers/net/ieee802154/ca8210.c:3171:32: note: each undeclared identifier is reported only once for each function it appears in drivers/net/ieee802154/ca8210.c:3173:3: error: implicit declaration of function ‘clk_unregister’ [-Werror=implicit-function-declaration]
clk_unregister(priv->clk);
^~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c: In function ‘ca8210_unregister_ext_clock’:
drivers/net/ieee802154/ca8210.c:3197:2: error: implicit declaration of function ‘of_clk_del_provider’ [-Werror=implicit-function-declaration]
of_clk_del_provider(spi->dev.of_node); ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3197:2: warning: ‘return’ with a value, in function returning void
of_clk_del_provider(spi->dev.of_node); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3190:13: note: declared here static void ca8210_unregister_ext_clock(struct spi_device *spi)

Quoted 1 line
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 2 lines

None of these showed up here. A #include <linux/clk-provider.h> should fix those imho.

I'm also not seeing these, I am including <linux/clk-provider.h> in my file, is there any action needed on my part?

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

I couldn't find any further discussion but again I'm including clk-provider.h which should cover all this?

I had another look at this and I would suspect that the config Marcel used does no have CONFIG_COMMON_CLK enabled. Marcel, could you confirm this?

In that case we need either a select COMMON_CLK in the KConfig entry of your driver to make sure it really is enabled.

I tried to select COMMON_CLK, but somehow that is not as easy as you think on an x86 kernel.

Hmm, strange. Any special configuration that you have there? I have it enabled in a minnow board config as well as a fedora derived config for my x86_64 laptop. Both configs compile the driver just fine, which is the reason I did not spot the build breakage before.

Looking into arch/x86/Kconfig a few X86 options actually use "select COMMON_CLK" already.

Quoted 1 line

However I want things to compile test at least on x86.

Fully agreed. Our drivers should at least be able to compile for it.

If we want to avoid such build breaks for other situation like yours the driver should really either use "select COMMON_CLK" or "depends on OMMON_CLK" in its own KConfig entry. That way we enforce that its enabled when compiling the driver.

I would prefer the select approach as that avoids the user digging around through there config to find and enable it manually. I would think that selecting COMMON_CLK directly is safe enough but if you would like to avoid that we can use depends on.

regards
Stefan Schmidt

#10 lore raw

Hello

Quoted 165 lines · Stefan Schmidt

Hello.

Quoted 149 lines · Marcel Holtmann

Hi Stefan,

Quoted 147 lines
Quoted 147 lines
Quoted 88 lines
Quoted 48 lines

This patchset adds a new device driver, documentation and build support for
Cascoda's CA8210 IEEE 802.15.4 radio transceiver:
http://www.cascoda.com/products/ca-821x/

v8:
Use module_spi_driver helper
Remove async tx timeout at driver level Style conformance change
Rework synchronous command handling to remove mutex

v7:
Remove use of cs_change property, always transmit full length buffers Implement fully async spi transfers
Combine spi transmission and reception into one function Use completion objects when waiting for events
Rework a lot of locking
Remove deprecated xmit_sync
Remove use of workqueue for IRQ handling

v6:
Kernel style conformance changes
Additional documentation
More meaningful register structs/macros
Removal of old TODOs
Removal of unnecessary macros
Check for safe removal of test interface

v5:
+Cc: Marcel Holtmann

v4:
Added allowable tx_powers and cca_ed_levels Changed power units to mbm (tx_power & cca_ed_level)

Harry Morris (3):
ieee802154: Add CA8210 IEEE 802.15.4 device driver
ieee802154: Add device tree documentation for CA8210
ieee802154: Add entry in MAINTAINTERS for CA8210 driver

.../devicetree/bindings/net/ieee802154/ca8210.txt  | 28 +
.../devicetree/bindings/vendor-prefixes.txt        | 1 +
MAINTAINERS                                        | 9 +
drivers/net/ieee802154/Kconfig                     | 21 +
drivers/net/ieee802154/Makefile                    | 1 +
drivers/net/ieee802154/ca8210.c                    | 3155
++++++++++++++++++++
6 files changed, 3215 insertions(+)
Quoted 3 lines

create mode 100644 Documentation/devicetree/bindings/net/ieee802154/ca8210.txt create mode 100644 drivers/net/ieee802154/ca8210.c

CC drivers/net/ieee802154/ca8210.o
drivers/net/ieee802154/ca8210.c: In function ‘ca8210_register_ext_clock’:
drivers/net/ieee802154/ca8210.c:2698:14: error: implicit declaration of function ‘clk_register_fixed_rate’ [-Werror=implicit-function-declaratio]
priv->clk = clk_register_fixed_rate(

              ^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2698:12: warning: assignment makes
pointer from integer without a cast [-Wint-conversion]
  priv->clk = clk_register_fixed_rate(
            ^
drivers/net/ieee802154/ca8210.c:2710:8: error: implicit declaration of
function ‘of_clk_add_provider’ [-Werror=implicit-function-declaration]
  ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
        ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2710:32: error:
‘of_clk_src_simple_get’ undeclared (first use in this function)
  ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
                                ^~~~~~~~~~~~~~~~~~~~~

drivers/net/ieee802154/ca8210.c:2710:32: note: each undeclared identifier is reported only once for each function it appears in drivers/net/ieee802154/ca8210.c:2712:3: error: implicit declaration of function ‘clk_unregister’ [-Werror=implicit-function-declaration]

   clk_unregister(priv->clk);
   ^~~~~~~~~~~~~~

drivers/net/ieee802154/ca8210.c: In function ‘ca8210_unregister_ext_clock’:
drivers/net/ieee802154/ca8210.c:2736:2: error: implicit declaration of function ‘of_clk_del_provider’ [-Werror=implicit-function-declaration]
of_clk_del_provider(spi->dev.of_node); ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2736:2: warning: ‘return’ with a value, in function returning void
of_clk_del_provider(spi->dev.of_node); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2729:13: note: declared here
static void ca8210_unregister_ext_clock(struct spi_device *spi)

Quoted 2 lines
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~

I remember these same issues being raised previously and found the old exchange:

Quoted 53 lines

Hi Stefan, Marcel,

Apologies for the slow reply, I've been snowed under the past week or so...

Quoted 42 lines · Stefan Schmidt
Quoted 39 lines · Marcel Holtmann

drivers/net/ieee802154/ca8210.c: In function ‘ca8210_register_ext_clock’:
drivers/net/ieee802154/ca8210.c:3159:14: error: implicit declaration of function ‘clk_register_fixed_rate’ [-Werror=implicit-function-declaratio]
priv->clk = clk_register_fixed_rate(

             ^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3159:12: warning: assignment makes
pointer from integer without a cast [-Wint-conversion]
 priv->clk = clk_register_fixed_rate(
           ^
drivers/net/ieee802154/ca8210.c:3171:8: error: implicit declaration
of function ‘of_clk_add_provider’
[-Werror=implicit-function-declaration]
 ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
       ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3171:32: error:
‘of_clk_src_simple_get’ undeclared (first use in this function)
 ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
                               ^~~~~~~~~~~~~~~~~~~~~

drivers/net/ieee802154/ca8210.c:3171:32: note: each undeclared identifier is reported only once for each function it appears in drivers/net/ieee802154/ca8210.c:3173:3: error: implicit declaration of function ‘clk_unregister’ [-Werror=implicit-function-declaration]
clk_unregister(priv->clk);
^~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c: In function ‘ca8210_unregister_ext_clock’:
drivers/net/ieee802154/ca8210.c:3197:2: error: implicit declaration of function ‘of_clk_del_provider’ [-Werror=implicit-function-declaration]
of_clk_del_provider(spi->dev.of_node); ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3197:2: warning: ‘return’ with a value, in function returning void
of_clk_del_provider(spi->dev.of_node); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3190:13: note: declared here static void ca8210_unregister_ext_clock(struct spi_device *spi)

Quoted 1 line
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 2 lines

None of these showed up here. A #include <linux/clk-provider.h> should fix those imho.

I'm also not seeing these, I am including <linux/clk-provider.h> in my file, is there any action needed on my part?

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

I couldn't find any further discussion but again I'm including clk-provider.h which should cover all this?

I had another look at this and I would suspect that the config Marcel used does no have CONFIG_COMMON_CLK enabled. Marcel, could you confirm this?

In that case we need either a select COMMON_CLK in the KConfig entry of your driver to make sure it really is enabled.

I tried to select COMMON_CLK, but somehow that is not as easy as you think on an x86 kernel.

Hmm, strange. Any special configuration that you have there? I have it enabled in a minnow board config as well as a fedora derived config for my x86_64 laptop. Both configs compile the driver just fine, which is the reason I did not spot the build breakage before.

Looking into arch/x86/Kconfig a few X86 options actually use "select COMMON_CLK" already.

Quoted 7 lines
Quoted 1 line

However I want things to compile test at least on x86.

Fully agreed. Our drivers should at least be able to compile for it.

If we want to avoid such build breaks for other situation like yours the driver should really either use "select COMMON_CLK" or "depends on OMMON_CLK" in its own KConfig entry. That way we enforce that its enabled when compiling the driver.

I would prefer the select approach as that avoids the user digging around through there config to find and enable it manually. I would think that selecting COMMON_CLK directly is safe enough but if you would like to avoid that we can use depends on.

I was looking into this "select vs depends on" and it seems select is by far the more widely used approach when it comes to COMMON_CLK. I guess this doesn't exactly justify it but also I agree having to manually enable it feels a bit unintuitive. I'd appreciate any further thoughts though.

Thanks,
Harry

#11 lore raw

Hello.

Quoted 200 lines · Harry Morris

Hello

Quoted 192 lines · Stefan Schmidt

Hello.

Quoted 166 lines · Marcel Holtmann

Hi Stefan,

Quoted 164 lines
Quoted 153 lines
Quoted 95 lines
Quoted 49 lines

This patchset adds a new device driver, documentation and build support for
Cascoda's CA8210 IEEE 802.15.4 radio transceiver:
http://www.cascoda.com/products/ca-821x/

v8:
Use module_spi_driver helper
Remove async tx timeout at driver level Style conformance change
Rework synchronous command handling to remove mutex

v7:
Remove use of cs_change property, always transmit full length buffers
Implement fully async spi transfers
Combine spi transmission and reception into one function Use completion objects when waiting for events Rework a lot of locking
Remove deprecated xmit_sync
Remove use of workqueue for IRQ handling

v6:
Kernel style conformance changes
Additional documentation
More meaningful register structs/macros
Removal of old TODOs
Removal of unnecessary macros
Check for safe removal of test interface

v5:
+Cc: Marcel Holtmann

v4:
Added allowable tx_powers and cca_ed_levels Changed power units to mbm (tx_power & cca_ed_level)

Harry Morris (3):
ieee802154: Add CA8210 IEEE 802.15.4 device driver
ieee802154: Add device tree documentation for CA8210
ieee802154: Add entry in MAINTAINTERS for CA8210 driver

.../devicetree/bindings/net/ieee802154/ca8210.txt  | 28 +
.../devicetree/bindings/vendor-prefixes.txt        | 1 +
MAINTAINERS                                        | 9 +
drivers/net/ieee802154/Kconfig                     | 21 +
drivers/net/ieee802154/Makefile                    | 1 +
drivers/net/ieee802154/ca8210.c                    | 3155
++++++++++++++++++++
6 files changed, 3215 insertions(+)
Quoted 3 lines

create mode 100644 Documentation/devicetree/bindings/net/ieee802154/ca8210.txt create mode 100644 drivers/net/ieee802154/ca8210.c

CC drivers/net/ieee802154/ca8210.o
drivers/net/ieee802154/ca8210.c: In function ‘ca8210_register_ext_clock’:
drivers/net/ieee802154/ca8210.c:2698:14: error: implicit declaration of function ‘clk_register_fixed_rate’ [-Werror=implicit-function-declaratio]
priv->clk = clk_register_fixed_rate(

              ^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2698:12: warning: assignment makes
pointer from integer without a cast [-Wint-conversion]
  priv->clk = clk_register_fixed_rate(
            ^

drivers/net/ieee802154/ca8210.c:2710:8: error: implicit declaration of
function ‘of_clk_add_provider’ [-Werror=implicit-function-declaration]

  ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
        ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2710:32: error:
‘of_clk_src_simple_get’ undeclared (first use in this function)
  ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
                                ^~~~~~~~~~~~~~~~~~~~~

drivers/net/ieee802154/ca8210.c:2710:32: note: each undeclared identifier is reported only once for each function it appears in drivers/net/ieee802154/ca8210.c:2712:3: error: implicit declaration of
function ‘clk_unregister’ [-Werror=implicit-function-declaration]

   clk_unregister(priv->clk);
   ^~~~~~~~~~~~~~

drivers/net/ieee802154/ca8210.c: In function ‘ca8210_unregister_ext_clock’:
drivers/net/ieee802154/ca8210.c:2736:2: error: implicit declaration of
function ‘of_clk_del_provider’ [-Werror=implicit-function-declaration]
of_clk_del_provider(spi->dev.of_node); ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2736:2: warning: ‘return’ with a value, in function returning void
of_clk_del_provider(spi->dev.of_node); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:2729:13: note: declared here
static void ca8210_unregister_ext_clock(struct spi_device *spi)

Quoted 2 lines
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~

I remember these same issues being raised previously and found the old exchange:

Quoted 53 lines

Hi Stefan, Marcel,

Apologies for the slow reply, I've been snowed under the past week or so...

Quoted 46 lines · Stefan Schmidt
Quoted 41 lines · Marcel Holtmann

drivers/net/ieee802154/ca8210.c: In function ‘ca8210_register_ext_clock’:
drivers/net/ieee802154/ca8210.c:3159:14: error: implicit declaration
of function ‘clk_register_fixed_rate’ [-Werror=implicit-function-declaratio]
priv->clk = clk_register_fixed_rate(

             ^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3159:12: warning: assignment makes
pointer from integer without a cast [-Wint-conversion]
 priv->clk = clk_register_fixed_rate(
           ^
drivers/net/ieee802154/ca8210.c:3171:8: error: implicit declaration
of function ‘of_clk_add_provider’
[-Werror=implicit-function-declaration]
 ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
       ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3171:32: error:
‘of_clk_src_simple_get’ undeclared (first use in this function)
 ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
                               ^~~~~~~~~~~~~~~~~~~~~

drivers/net/ieee802154/ca8210.c:3171:32: note: each undeclared identifier is reported only once for each function it appears in drivers/net/ieee802154/ca8210.c:3173:3: error: implicit declaration of function ‘clk_unregister’ [-Werror=implicit-function-declaration]
clk_unregister(priv->clk);
^~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c: In function ‘ca8210_unregister_ext_clock’:
drivers/net/ieee802154/ca8210.c:3197:2: error: implicit declaration of function ‘of_clk_del_provider’ [-Werror=implicit-function-declaration]
of_clk_del_provider(spi->dev.of_node); ^~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3197:2: warning: ‘return’ with a value, in function returning void
of_clk_del_provider(spi->dev.of_node); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ieee802154/ca8210.c:3190:13: note: declared here static void ca8210_unregister_ext_clock(struct spi_device *spi)

Quoted 1 line
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~

None of these showed up here. A #include <linux/clk-provider.h> should fix those imho.

Quoted 6 lines
Quoted 3 lines

I'm also not seeing these, I am including <linux/clk-provider.h> in my
file, is there any action needed on my part?

I couldn't find any further discussion but again I'm including clk-provider.h which should cover all this?

I had another look at this and I would suspect that the config Marcel used does no have CONFIG_COMMON_CLK enabled. Marcel, could you confirm this?

Quoted 5 lines
Quoted 2 lines

In that case we need either a select COMMON_CLK in the KConfig entry of your driver to make sure it really is enabled.

I tried to select COMMON_CLK, but somehow that is not as easy as you think on an x86 kernel.

Hmm, strange. Any special configuration that you have there? I have it enabled in a minnow board config as well as a fedora derived config for my x86_64 laptop. Both configs compile the driver just fine, which is the reason I did not spot the build breakage before.

Looking into arch/x86/Kconfig a few X86 options actually use "select COMMON_CLK" already.

Quoted 1 line

However I want things to compile test at least on x86.

Fully agreed. Our drivers should at least be able to compile for it.

If we want to avoid such build breaks for other situation like yours the driver should really either use "select COMMON_CLK" or "depends on OMMON_CLK" in its own KConfig entry. That way we enforce that its enabled when compiling the driver.

Quoted 4 lines

I would prefer the select approach as that avoids the user digging around through there config to find and enable it manually. I would think that selecting COMMON_CLK directly is safe enough but if you would like to avoid that we can use depends on.

Quoted 5 lines

I was looking into this "select vs depends on" and it seems select is by far the more widely used approach when it comes to COMMON_CLK. I guess this doesn't exactly justify it but also I agree having to manually enable it feels a bit unintuitive. I'd appreciate any further thoughts though.

It seems Marcel is rather busy right now.

Please go ahead and ad the select COMMON_CLK bit and respin your patchset. Hopefully we finally can get this merged. :)

regards
Stefan Schmidt

#12 lore raw
In reply to Harry Morris

Hi,

On 03/02/2017 06:42 PM, Harry Morris wrote:
...

Quoted 3 lines

I was looking into this "select vs depends on" and it seems select is by far the more widely used approach when it comes to COMMON_CLK. I guess this doesn't exactly justify it but also I agree having to manually enable it feels a bit unintuitive. I'd appreciate any further thoughts though.

Please note, so far I know:

Select is used mostly on Top Level Entries. It can't solve dependencies... it can solve it, but then you need also select them in your entry.

Depends on can solve it by make it simple available only if the depended menu entry is selected.

- Alex

#13 lore raw

Hi,

Quoted 10 lines
Quoted 2 lines

I was looking into this "select vs depends on" and it seems select is by far the more widely used approach when it comes to COMMON_CLK. I guess this doesn't exactly justify it but also I agree having to manually enable it feels a bit unintuitive. I'd appreciate any further thoughts though.

Please note, so far I know:

Select is used mostly on Top Level Entries. It can't solve dependencies... it can solve it, but then you need also select them in your entry.

Depends on can solve it by make it simple available only if the depended menu entry is selected.

can someone send me a version of this patchset where this is solved?

Regards

Marcel