Loading Documentation/devicetree/bindings/misc/ti,dac7512.txt 0 → 100644 +20 −0 Original line number Diff line number Diff line TI DAC7512 DEVICETREE BINDINGS Required properties: - "compatible" Must be set to "ti,dac7512" Property rules described in Documentation/devicetree/bindings/spi/spi-bus.txt apply. In particular, "reg" and "spi-max-frequency" properties must be given. Example: spi_master { dac7512: dac7512@0 { compatible = "ti,dac7512"; reg = <0>; /* CS0 */ spi-max-frequency = <1000000>; }; }; drivers/misc/ti_dac7512.c +10 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <linux/module.h> #include <linux/init.h> #include <linux/spi/spi.h> #include <linux/of.h> static ssize_t dac7512_store_val(struct device *dev, struct device_attribute *attr, Loading Loading @@ -78,10 +79,19 @@ static const struct spi_device_id dac7512_id_table[] = { }; MODULE_DEVICE_TABLE(spi, dac7512_id_table); #ifdef CONFIG_OF static const struct of_device_id dac7512_of_match[] = { { .compatible = "ti,dac7512", }, { } }; MODULE_DEVICE_TABLE(of, dac7512_of_match); #endif static struct spi_driver dac7512_driver = { .driver = { .name = "dac7512", .owner = THIS_MODULE, .of_match_table = of_match_ptr(dac7512_of_match), }, .probe = dac7512_probe, .remove = dac7512_remove, Loading Loading
Documentation/devicetree/bindings/misc/ti,dac7512.txt 0 → 100644 +20 −0 Original line number Diff line number Diff line TI DAC7512 DEVICETREE BINDINGS Required properties: - "compatible" Must be set to "ti,dac7512" Property rules described in Documentation/devicetree/bindings/spi/spi-bus.txt apply. In particular, "reg" and "spi-max-frequency" properties must be given. Example: spi_master { dac7512: dac7512@0 { compatible = "ti,dac7512"; reg = <0>; /* CS0 */ spi-max-frequency = <1000000>; }; };
drivers/misc/ti_dac7512.c +10 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <linux/module.h> #include <linux/init.h> #include <linux/spi/spi.h> #include <linux/of.h> static ssize_t dac7512_store_val(struct device *dev, struct device_attribute *attr, Loading Loading @@ -78,10 +79,19 @@ static const struct spi_device_id dac7512_id_table[] = { }; MODULE_DEVICE_TABLE(spi, dac7512_id_table); #ifdef CONFIG_OF static const struct of_device_id dac7512_of_match[] = { { .compatible = "ti,dac7512", }, { } }; MODULE_DEVICE_TABLE(of, dac7512_of_match); #endif static struct spi_driver dac7512_driver = { .driver = { .name = "dac7512", .owner = THIS_MODULE, .of_match_table = of_match_ptr(dac7512_of_match), }, .probe = dac7512_probe, .remove = dac7512_remove, Loading