Re: Reply to [RFC PATCH v2 0/1] Adding support for IIO SCMI based sensors

2021-01-18 Thread Jonathan Cameron
On Sun, 17 Jan 2021 13:02:31 -0800 Jyoti Bhayana wrote: > Hi Jonathan, > > Instead of IIO_VAL_INT_PLUS_MICRO, we can also use IIO_VAL_FRACTIONAL > right for the raw values for min/max range and resolution? But, to Sure on IIO_VAL_FRACTIONAL, that should be fine. > keep things simple though,

Re: Reply to [RFC PATCH v2 0/1] Adding support for IIO SCMI based sensors

2021-01-17 Thread Jyoti Bhayana
Hi Jonathan, Instead of IIO_VAL_INT_PLUS_MICRO, we can also use IIO_VAL_FRACTIONAL right for the raw values for min/max range and resolution? But, to keep things simple though, it will be nice if the IIO driver uses IIO_VAL_INT and throws an error if there is a negative exponent in the following

Re: Reply to [RFC PATCH v2 0/1] Adding support for IIO SCMI based sensors

2021-01-17 Thread Jonathan Cameron
On Sat, 16 Jan 2021 23:15:56 -0800 Jyoti Bhayana wrote: > Hi Jonathan, > > Can you clarify one thing ? If we go with option 2 which is using > IIO_AVAIL_RANGE for min,step,high using IIO_VAL_INT then how will it > ensure the possible floating value for step as we are using int type? As you've

Re: Reply to [RFC PATCH v2 0/1] Adding support for IIO SCMI based sensors

2021-01-16 Thread Jyoti Bhayana
Hi Jonathan, Can you clarify one thing ? If we go with option 2 which is using IIO_AVAIL_RANGE for min,step,high using IIO_VAL_INT then how will it ensure the possible floating value for step as we are using int type? Thanks, Jyoti On Sat, Jan 16, 2021 at 11:33 AM Jonathan Cameron wrote: > >

Re: Reply to [RFC PATCH v2 0/1] Adding support for IIO SCMI based sensors

2021-01-16 Thread Jonathan Cameron
On Mon, 11 Jan 2021 13:17:51 -0800 Jyoti Bhayana wrote: > Hi Jonathan, > > I know it is a bit confusing. Let me try to explain it with some > examples to hopefully clarify some things here. > SCMI Platform talks to the native/actual sensor, gets the raw values > from the native sensor and

Re: Reply to [RFC PATCH v2 0/1] Adding support for IIO SCMI based sensors

2021-01-11 Thread Jyoti Bhayana
Hi Jonathan, I know it is a bit confusing. Let me try to explain it with some examples to hopefully clarify some things here. SCMI Platform talks to the native/actual sensor, gets the raw values from the native sensor and applies the scale and then sends those values to the SCMI agent and the

Re: Reply to [RFC PATCH v2 0/1] Adding support for IIO SCMI based sensors

2021-01-11 Thread Jonathan Cameron
On Sun, 10 Jan 2021 22:44:44 -0800 Jyoti Bhayana wrote: > Hi Jonathan, > > In section 4.7.2.5.1 of the specification, the following exponent is > the scale value > > uint32 axis_attributes_high > Bits[15:11] Exponent: The power-of-10 multiplier in two’s-complement > format that is applied to

Re: Reply to [RFC PATCH v2 0/1] Adding support for IIO SCMI based sensors

2021-01-10 Thread Jyoti Bhayana
Hi Jonathan, In section 4.7.2.5.1 of the specification, the following exponent is the scale value uint32 axis_attributes_high Bits[15:11] Exponent: The power-of-10 multiplier in two’s-complement format that is applied to the sensor unit specified by the SensorType field. and the resolution is

Re: Reply to [RFC PATCH v2 0/1] Adding support for IIO SCMI based sensors

2021-01-09 Thread Jonathan Cameron
On Wed, 6 Jan 2021 21:23:53 + Jyoti Bhayana wrote: > Hi Jonathan, > > Instead of adding IIO_VAL_INT_H32_L32, I am thinking of adding > IIO_VAL_FRACTIONAL_LONG > or IIO_VAL_FRACTIONAL_64 as the scale/exponent used for min/max range can be > different > than the one used in resolution

Re: Reply to [RFC PATCH v2 0/1] Adding support for IIO SCMI based sensors

2021-01-06 Thread Cristian Marussi
On Wed, Jan 06, 2021 at 02:36:45PM +, Jonathan Cameron wrote: > On Wed, 6 Jan 2021 11:26:59 + > Cristian Marussi wrote: > > > Hi > > > > On Wed, Jan 06, 2021 at 10:29:17AM +, Jonathan Cameron wrote: > > > On Tue, 5 Jan 2021 23:09:20 + > > > Jyoti Bhayana wrote: > > > > > > >

Re: Reply to [RFC PATCH v2 0/1] Adding support for IIO SCMI based sensors

2021-01-06 Thread Jonathan Cameron
On Wed, 6 Jan 2021 11:26:59 + Cristian Marussi wrote: > Hi > > On Wed, Jan 06, 2021 at 10:29:17AM +, Jonathan Cameron wrote: > > On Tue, 5 Jan 2021 23:09:20 + > > Jyoti Bhayana wrote: > > > > > Hi Jonathan, > > > > > > > So, sensor_max_range can effectively be exposed as a

Re: Reply to [RFC PATCH v2 0/1] Adding support for IIO SCMI based sensors

2021-01-06 Thread Cristian Marussi
Hi On Wed, Jan 06, 2021 at 10:29:17AM +, Jonathan Cameron wrote: > On Tue, 5 Jan 2021 23:09:20 + > Jyoti Bhayana wrote: > > > Hi Jonathan, > > > > > So, sensor_max_range can effectively be exposed as a combination of > > > scale and the *_raw_avail for a raw read (via the read_avail

Re: Reply to [RFC PATCH v2 0/1] Adding support for IIO SCMI based sensors

2021-01-06 Thread Jonathan Cameron
On Tue, 5 Jan 2021 23:09:20 + Jyoti Bhayana wrote: > Hi Jonathan, > > > So, sensor_max_range can effectively be exposed as a combination of > > scale and the *_raw_avail for a raw read (via the read_avail callback in > > IIO). > > We'll ignore the fact the interface assumes a single value