Add device-tree ID tables and document bindings.
Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
--- /dev/null
+MEAS ms5611 family pressure sensors
+
+Pressure sensors from MEAS Switzerland with SPI and I2C bus interfaces.
+
+Required properties:
+- compatible: "meas,ms5611" or "meas,ms5607"
+- reg: the I2C address or SPI chip select the device will respond to
+
+Optional properties:
+- vdd-supply: an optional regulator that needs to be on to provide VDD
+  power to the sensor.
+
+Example:
+
+ms5607@77 {
+       compatible = "meas,ms5607";
+       reg = <0x77>;
+       vdd-supply = <&ldo_3v3_gnss>;
+};
 
 lltc   Linear Technology Corporation
 marvell        Marvell Technology Group Ltd.
 maxim  Maxim Integrated Products
+meas   Measurement Specialties
 mediatek       MediaTek Inc.
 melexis        Melexis N.V.
 merrii Merrii Technology Co., Ltd.
 
 #include <linux/delay.h>
 #include <linux/i2c.h>
 #include <linux/module.h>
+#include <linux/of_device.h>
 
 #include "ms5611.h"
 
        return ms5611_remove(i2c_get_clientdata(client));
 }
 
+#if defined(CONFIG_OF)
+static const struct of_device_id ms5611_i2c_matches[] = {
+       { .compatible = "meas,ms5611" },
+       { .compatible = "ms5611" },
+       { .compatible = "meas,ms5607" },
+       { .compatible = "ms5607" },
+       { }
+};
+MODULE_DEVICE_TABLE(of, ms5611_i2c_matches);
+#endif
+
 static const struct i2c_device_id ms5611_id[] = {
        { "ms5611", MS5611 },
        { "ms5607", MS5607 },
 static struct i2c_driver ms5611_driver = {
        .driver = {
                .name = "ms5611",
+               .of_match_table = of_match_ptr(ms5611_i2c_matches)
        },
        .id_table = ms5611_id,
        .probe = ms5611_i2c_probe,
 
 #include <linux/delay.h>
 #include <linux/module.h>
 #include <linux/spi/spi.h>
+#include <linux/of_device.h>
 
 #include "ms5611.h"
 
        return ms5611_remove(spi_get_drvdata(spi));
 }
 
+#if defined(CONFIG_OF)
+static const struct of_device_id ms5611_spi_matches[] = {
+       { .compatible = "meas,ms5611" },
+       { .compatible = "ms5611" },
+       { .compatible = "meas,ms5607" },
+       { .compatible = "ms5607" },
+       { }
+};
+MODULE_DEVICE_TABLE(of, ms5611_spi_matches);
+#endif
+
 static const struct spi_device_id ms5611_id[] = {
        { "ms5611", MS5611 },
        { "ms5607", MS5607 },
 static struct spi_driver ms5611_driver = {
        .driver = {
                .name = "ms5611",
+               .of_match_table = of_match_ptr(ms5611_spi_matches)
        },
        .id_table = ms5611_id,
        .probe = ms5611_spi_probe,