Skip to content

Commit

Permalink
enc28j60: Add device tree compatible string and an overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Elwell authored and popcornmix committed Mar 7, 2015
1 parent 4c8a8d6 commit 3276502
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm/boot/dts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ dtb-$(CONFIG_BCM2708_DT) += bcm2708-rpi-b-plus.dtb
dtb-$(CONFIG_BCM2709_DT) += bcm2709-rpi-2-b.dtb
dtb-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += ds1307-rtc-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += enc28j60-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += i2c-rtc-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += hifiberry-dac-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += hifiberry-dacplus-overlay.dtb
Expand Down
29 changes: 29 additions & 0 deletions arch/arm/boot/dts/enc28j60-overlay.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Overlay for the Microchip ENC28J60 Ethernet Controller
/dts-v1/;
/plugin/;

/ {
compatible = "brcm,bcm2708";

fragment@0 {
target = <&spi0>;
__overlay__ {
/* needed to avoid dtc warning */
#address-cells = <1>;
#size-cells = <0>;

status = "okay";

spidev@0{
status = "disabled";
};

enc28j60@0{
compatible = "microchip,enc28j60";
reg = <0>; /* CE0 */
spi-max-frequency = <12000000>;
status = "okay";
};
};
};
};
11 changes: 11 additions & 0 deletions drivers/net/ethernet/microchip/enc28j60.c
Original file line number Diff line number Diff line change
Expand Up @@ -1630,10 +1630,21 @@ static int enc28j60_remove(struct spi_device *spi)
return 0;
}

#ifdef CONFIG_OF
static const struct of_device_id enc28j60_of_match[] = {
{ .compatible = "microchip,enc28j60", },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, enc28j60_of_match);
#endif

static struct spi_driver enc28j60_driver = {
.driver = {
.name = DRV_NAME,
.owner = THIS_MODULE,
#ifdef CONFIG_OF
.of_match_table = enc28j60_of_match,
#endif
},
.probe = enc28j60_probe,
.remove = enc28j60_remove,
Expand Down

0 comments on commit 3276502

Please sign in to comment.