Re: [RFC bluetooth-next 05/21] mrf24j40: add device-tree support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

On 13/08/15 14:22, Alexander Aring wrote:
This patch adds devicetree support to mrf24j40 with proper devicetree
compatible strings.

Signed-off-by: Alexander Aring <alex.aring@xxxxxxxxx>
---
  .../devicetree/bindings/net/ieee802154/mrf24j40.txt  | 20 ++++++++++++++++++++
  MAINTAINERS                                          |  1 +
  drivers/net/ieee802154/mrf24j40.c                    |  9 +++++++++
  3 files changed, 30 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/net/ieee802154/mrf24j40.txt

diff --git a/Documentation/devicetree/bindings/net/ieee802154/mrf24j40.txt b/Documentation/devicetree/bindings/net/ieee802154/mrf24j40.txt
new file mode 100644
index 0000000..a4ed2ef
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/ieee802154/mrf24j40.txt
@@ -0,0 +1,20 @@
+* MRF24J40 IEEE 802.15.4 *
+
+Required properties:
+  - compatible:		should be "microchip,mrf24j40", "microchip,mrf24j40ma",
+			or "microchip,mrf24j40mc" depends on your transceiver
+			board
+  - spi-max-frequency:	maximal bus speed, should be set something under or equal
+			10000000
+  - reg:		the chipselect index
+  - interrupts:		the interrupt generated by the device.
+
+Example:
+
+	mrf24j40ma@0 {
+		compatible = "microchip,mrf24j40ma";
+		spi-max-frequency = <8500000>;
+		reg = <0>;
+		interrupts = <19 8>;
+		interrupt-parent = <&gpio3>;
+	};
diff --git a/MAINTAINERS b/MAINTAINERS
index 5baa91c..0af4165 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6816,6 +6816,7 @@ M:	Alan Ott <alan@xxxxxxxxxxx>
  L:	linux-wpan@xxxxxxxxxxxxxxx
  S:	Maintained
  F:	drivers/net/ieee802154/mrf24j40.c
+F:	Documentation/devicetree/bindings/net/ieee802154/mrf24j40.txt
MSI LAPTOP SUPPORT
  M:	"Lee, Chun-Yi" <jlee@xxxxxxxx>
diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c
index d16bef3..7df80d8 100644
--- a/drivers/net/ieee802154/mrf24j40.c
+++ b/drivers/net/ieee802154/mrf24j40.c
@@ -793,6 +793,14 @@ static int mrf24j40_remove(struct spi_device *spi)
  	return 0;
  }
+static const struct of_device_id mrf24j40_of_match[] = {
+	{ .compatible = "microchip,mrf24j40", .data = (void *)MRF24J40 },
+	{ .compatible = "microchip,mrf24j40ma", .data = (void *)MRF24J40MA },
+	{ .compatible = "microchip,mrf24j40mc", .data = (void *)MRF24J40MC },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, mrf24j40_of_match);
+
  static const struct spi_device_id mrf24j40_ids[] = {
  	{ "mrf24j40", MRF24J40 },
  	{ "mrf24j40ma", MRF24J40MA },
@@ -803,6 +811,7 @@ MODULE_DEVICE_TABLE(spi, mrf24j40_ids);
static struct spi_driver mrf24j40_driver = {
  	.driver = {
+		.of_match_table = of_match_ptr(mrf24j40_of_match),
  		.name = "mrf24j40",
  		.owner = THIS_MODULE,
  	},

Reviewed-by: Stefan Schmidt <stefan@xxxxxxxxxxxxxxx>

regards
Stefan Schmidt
--
To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux