dac7512: some cleanups and DT bindings
Subsystems (2)
cover dac7512: some cleanups and DT bindings
Here are some trivial things for the ti_dac7512 driver.
Mark, can you take them through your spi tree?
Thanks,
Daniel
Daniel Mack (4):
drivers: misc: ti_dac7512: drop module version
drivers: misc: ti_dac7512: drop DAC7512_DRV_NAME
drivers: misc: ti_dac7512: provide a SPI ID table
drivers: misc: ti_dac7512: add support for DT matching
.../devicetree/bindings/misc/ti,dac7512.txt | 20 +++++++++++++++++++ drivers/misc/ti_dac7512.c | 23 +++++++++++++++++----- 2 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 Documentation/devicetree/bindings/misc/ti,dac7512.txt
Signature · 1 line
1.8.3.1
PATCH 1/4 drivers: misc: ti_dac7512: drop module version
Providing a module version doesn't add any value, so drop it.
--- drivers/misc/ti_dac7512.c | 2 -- 1 file changed, 2 deletions(-)
drivers/misc/ti_dac7512.c +0 -2
@@ -24,7 +24,6 @@#include <linux/spi/spi.h> #define DAC7512_DRV_NAME "dac7512" -#define DRIVER_VERSION "1.0" static ssize_t dac7512_store_val(struct device *dev, struct device_attribute *attr,
@@ -89,4 +88,3 @@ module_spi_driver(dac7512_driver);MODULE_AUTHOR ("Daniel Mack <[email protected]>" );MODULE_DESCRIPTION ("DAC7512 16-bit DAC" );MODULE_LICENSE ("GPL v2" ); -MODULE_VERSION (DRIVER_VERSION );
Signature · 1 line
1.8.3.1
PATCH 2/4 drivers: misc: ti_dac7512: drop DAC7512_DRV_NAME
In reply to Daniel MackThe driver's name can be provided directly, so drop the #define.
--- drivers/misc/ti_dac7512.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/misc/ti_dac7512.c +1 -3
@@ -23,8 +23,6 @@#include <linux/init.h> #include <linux/spi/spi.h> -#define DAC7512_DRV_NAME "dac7512" -static ssize_t dac7512_store_val (struct device *dev,struct device_attribute *attr,const char *buf,size_t count)
@@ -76,7 +74,7 @@ static int dac7512_remove(struct spi_device *spi)static struct spi_driver dac7512_driver = { .driver = { - .name =DAC7512_DRV_NAME , + .name ="dac7512" , .owner =THIS_MODULE , }, .probe = dac7512_probe,
Signature · 1 line
1.8.3.1
PATCH 3/4 drivers: misc: ti_dac7512: provide a SPI ID table
In reply to Daniel MackThis way, the module can be autoloaded by the SPI core.
--- drivers/misc/ti_dac7512.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/misc/ti_dac7512.c +7 -0
@@ -72,6 +72,12 @@ static int dac7512_remove(struct spi_device *spi)return 0 ; } +static const struct spi_device_id dac7512_id_table[] = { + {"dac7512" ,0 }, + { } +}; +MODULE_DEVICE_TABLE (spi, dac7512_id_table); +static struct spi_driver dac7512_driver = { .driver = { .name ="dac7512" ,
@@ -79,6 +85,7 @@ static struct spi_driver dac7512_driver = { }, .probe = dac7512_probe, .remove = dac7512_remove, + .id_table = dac7512_id_table, };module_spi_driver (dac7512_driver);
Signature · 6 lines
1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 4/4 drivers: misc: ti_dac7512: add support for DT matching
In reply to Daniel MackOnly matching is done via DT, no other details can be passed.
--- .../devicetree/bindings/misc/ti,dac7512.txt | 20 ++++++++++++++++++++ drivers/misc/ti_dac7512.c | 10 ++++++++++ 2 files changed, 30 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/ti,dac7512.txt
Documentation/devicetree/bindings/misc/ti,dac7512.txt new file +20 -0
@@ -0,0 +1,20 @@ +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
@@ -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,
@@ -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,
Signature · 6 lines
1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 3 lines · Daniel Mack
Here are some trivial things for the
ti_dac7512driver.Mark, can you take them through your spi tree?
I can but it's normally Greg who looks after drivers/misc - probably best to at least run these by him.
Quoted 7 lines · Mark Brown
Quoted 3 lines · Daniel Mack
Here are some trivial things for the
ti_dac7512driver.Mark, can you take them through your spi tree?
I can but it's normally Greg who looks after
drivers/misc- probably best to at least run these by him.
Alright. Greg, I posted the series to LKML yesterday. Can you pick the patches from there or do you want me to resend?
Thanks,
Daniel
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Greg Kroah-Hartman
maintainerQuoted 11 lines · Daniel Mack
Quoted 7 lines · Mark Brown
Quoted 3 lines · Daniel Mack
Here are some trivial things for the
ti_dac7512driver.Mark, can you take them through your spi tree?
I can but it's normally Greg who looks after
drivers/misc- probably best to at least run these by him.Alright. Greg, I posted the series to LKML yesterday. Can you pick the patches from there or do you want me to resend?
I'll pick them up from there, thanks for pointing them out to me.
greg k-h
Greg Kroah-Hartman
maintainerQuoted 11 lines · Daniel Mack
Quoted 7 lines · Mark Brown
Quoted 3 lines · Daniel Mack
Here are some trivial things for the
ti_dac7512driver.Mark, can you take them through your spi tree?
I can but it's normally Greg who looks after
drivers/misc- probably best to at least run these by him.Alright. Greg, I posted the series to LKML yesterday. Can you pick the patches from there or do you want me to resend?
I've got them and will take them through my tree, thanks.
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html