diff mbox series

[6/6] iio:pressure:ms5637: add ms5803 support

Message ID 20201209234857.1521453-7-alexandre.belloni@bootlin.com (mailing list archive)
State New, archived
Headers show
Series iio:pressure:ms5637: add ms5803 support | expand

Commit Message

Alexandre Belloni Dec. 9, 2020, 11:48 p.m. UTC
The ms5803 is very similar to the ms5805 but has less resolution options
and has the 128bit PROM layout.

Cc: Rob Herring <robh+dt@kernel.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++
 drivers/iio/pressure/ms5637.c                          | 8 ++++++++
 2 files changed, 10 insertions(+)

Comments

Rob Herring (Arm) Dec. 11, 2020, 3:34 a.m. UTC | #1
On Thu, Dec 10, 2020 at 12:48:57AM +0100, Alexandre Belloni wrote:
> The ms5803 is very similar to the ms5805 but has less resolution options
> and has the 128bit PROM layout.
> 
> Cc: Rob Herring <robh+dt@kernel.org>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> ---
>  Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++
>  drivers/iio/pressure/ms5637.c                          | 8 ++++++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml
> index ab623ba930d5..84b0e44235c1 100644
> --- a/Documentation/devicetree/bindings/trivial-devices.yaml
> +++ b/Documentation/devicetree/bindings/trivial-devices.yaml
> @@ -132,6 +132,8 @@ properties:
>            - mcube,mc3230
>              # MEMSIC 2-axis 8-bit digital accelerometer
>            - memsic,mxc6225
> +            # Measurement Specialities I2C pressure and temperature sensor
> +          - meas,ms5803

Alphabetical order please.

>              # Microchip differential I2C ADC, 1 Channel, 18 bit
>            - microchip,mcp3421
>              # Microchip differential I2C ADC, 2 Channel, 18 bit
> diff --git a/drivers/iio/pressure/ms5637.c b/drivers/iio/pressure/ms5637.c
> index 2943b88734b3..39830a51ca78 100644
> --- a/drivers/iio/pressure/ms5637.c
> +++ b/drivers/iio/pressure/ms5637.c
> @@ -192,8 +192,15 @@ static const struct ms_tp_hw_data ms5637_hw_data  = {
>  	.max_res_index = 5
>  };
>  
> +static const struct ms_tp_hw_data ms5803_hw_data  = {
> +	.prom_len = 8,
> +	.max_res_index = 4
> +};
> +
>  static const struct ms_tp_data ms5637_data = { .name = "ms5637", .hw = &ms5637_hw_data };
>  
> +static const struct ms_tp_data ms5803_data = { .name = "ms5803", .hw = &ms5803_hw_data };
> +
>  static const struct ms_tp_data ms5805_data = { .name = "ms5805", .hw = &ms5637_hw_data };
>  
>  static const struct ms_tp_data ms5837_data = { .name = "ms5837", .hw = &ms5637_hw_data };
> @@ -205,6 +212,7 @@ static const struct ms_tp_data ms8607_data = {
>  
>  static const struct of_device_id ms5637_of_match[] = {
>  	{ .compatible = "meas,ms5637", .data = &ms5637_data },
> +	{ .compatible = "meas,ms5803", .data = &ms5803_data },
>  	{ .compatible = "meas,ms5805", .data = &ms5805_data },
>  	{ .compatible = "meas,ms5837", .data = &ms5837_data },
>  	{ .compatible = "meas,ms8607-temppressure", .data = &ms8607_data },
> -- 
> 2.28.0
>
Alexandre Belloni Dec. 11, 2020, 8:08 a.m. UTC | #2
On 10/12/2020 21:34:13-0600, Rob Herring wrote:
> On Thu, Dec 10, 2020 at 12:48:57AM +0100, Alexandre Belloni wrote:
> > The ms5803 is very similar to the ms5805 but has less resolution options
> > and has the 128bit PROM layout.
> > 
> > Cc: Rob Herring <robh+dt@kernel.org>
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> > ---
> >  Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++
> >  drivers/iio/pressure/ms5637.c                          | 8 ++++++++
> >  2 files changed, 10 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml
> > index ab623ba930d5..84b0e44235c1 100644
> > --- a/Documentation/devicetree/bindings/trivial-devices.yaml
> > +++ b/Documentation/devicetree/bindings/trivial-devices.yaml
> > @@ -132,6 +132,8 @@ properties:
> >            - mcube,mc3230
> >              # MEMSIC 2-axis 8-bit digital accelerometer
> >            - memsic,mxc6225
> > +            # Measurement Specialities I2C pressure and temperature sensor
> > +          - meas,ms5803
> 
> Alphabetical order please.

Ah, this was my intention, it will conflict with the togreg branch of
iio.git anyway.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml
index ab623ba930d5..84b0e44235c1 100644
--- a/Documentation/devicetree/bindings/trivial-devices.yaml
+++ b/Documentation/devicetree/bindings/trivial-devices.yaml
@@ -132,6 +132,8 @@  properties:
           - mcube,mc3230
             # MEMSIC 2-axis 8-bit digital accelerometer
           - memsic,mxc6225
+            # Measurement Specialities I2C pressure and temperature sensor
+          - meas,ms5803
             # Microchip differential I2C ADC, 1 Channel, 18 bit
           - microchip,mcp3421
             # Microchip differential I2C ADC, 2 Channel, 18 bit
diff --git a/drivers/iio/pressure/ms5637.c b/drivers/iio/pressure/ms5637.c
index 2943b88734b3..39830a51ca78 100644
--- a/drivers/iio/pressure/ms5637.c
+++ b/drivers/iio/pressure/ms5637.c
@@ -192,8 +192,15 @@  static const struct ms_tp_hw_data ms5637_hw_data  = {
 	.max_res_index = 5
 };
 
+static const struct ms_tp_hw_data ms5803_hw_data  = {
+	.prom_len = 8,
+	.max_res_index = 4
+};
+
 static const struct ms_tp_data ms5637_data = { .name = "ms5637", .hw = &ms5637_hw_data };
 
+static const struct ms_tp_data ms5803_data = { .name = "ms5803", .hw = &ms5803_hw_data };
+
 static const struct ms_tp_data ms5805_data = { .name = "ms5805", .hw = &ms5637_hw_data };
 
 static const struct ms_tp_data ms5837_data = { .name = "ms5837", .hw = &ms5637_hw_data };
@@ -205,6 +212,7 @@  static const struct ms_tp_data ms8607_data = {
 
 static const struct of_device_id ms5637_of_match[] = {
 	{ .compatible = "meas,ms5637", .data = &ms5637_data },
+	{ .compatible = "meas,ms5803", .data = &ms5803_data },
 	{ .compatible = "meas,ms5805", .data = &ms5805_data },
 	{ .compatible = "meas,ms5837", .data = &ms5837_data },
 	{ .compatible = "meas,ms8607-temppressure", .data = &ms8607_data },