Re: [PATCH] staging: iio: ad5933: finalized device-tree support

2018-11-24 Thread Slawomir Stepien
E(of, ad5933_of_match); > + > static struct i2c_driver ad5933_driver = { > .driver = { > .name = "ad5933", > + .of_match_table = ad5933_of_match, > }, > .probe = ad5933_probe, > .remove = ad5933_remove, -- Slawomir Stepien

Re: [PATCH v5 2/2] staging: iio: ad2s1210: Add device tree support.

2018-10-27 Thread Slawomir Stepien
f_match[] = { > + { .compatible = "adi,ad2s1210", }, > + { } > +}; > +MODULE_DEVICE_TABLE(of, ad2s1210_of_match); > + > static const struct spi_device_id ad2s1210_id[] = { > { "ad2s1210" }, > {} > @@ -733,6 +773,7 @@ MODULE_DEVICE_TABLE(spi, ad2s1210_id); > static struct spi_driver ad2s1210_driver = { > .driver = { > .name = DRV_NAME, > + .of_match_table = of_match_ptr(ad2s1210_of_match), > }, > .probe = ad2s1210_probe, > .remove = ad2s1210_remove, -- Slawomir Stepien

Re: [PATCH v4] staging: iio: ad2s1210: Switch to the gpio descriptor interface

2018-10-24 Thread Slawomir Stepien
ad2s1210_free_gpios() as devm API is being used. > --- > drivers/staging/iio/resolver/ad2s1210.c | 92 ++--- > drivers/staging/iio/resolver/ad2s1210.h | 3 - > 2 files changed, 50 insertions(+), 45 deletions(-) Looks good to me. Reviewed-by: Slawomir Stepien -- Slawomir Stepien

Re: [PATCH v3] staging: iio: ad2s1210: Switch to the gpio descriptor interface

2018-10-23 Thread Slawomir Stepien
o error_free_gpios; > + return ret; > > st->fclkin = spi->max_speed_hz; > spi->mode = SPI_MODE_3; > @@ -700,10 +713,6 @@ static int ad2s1210_probe(struct spi_device *spi) > ad2s1210_initial(st); > > return 0; > - > -error_free_gpios: > - ad2s1210_free_gpios(st); > - return ret; > } > > static int ad2s1210_remove(struct spi_device *spi) > @@ -711,7 +720,6 @@ static int ad2s1210_remove(struct spi_device *spi) > struct iio_dev *indio_dev = spi_get_drvdata(spi); > > iio_device_unregister(indio_dev); > - ad2s1210_free_gpios(iio_priv(indio_dev)); > > return 0; > } > diff --git a/drivers/staging/iio/resolver/ad2s1210.h > b/drivers/staging/iio/resolver/ad2s1210.h > index e9b2147701fc..63d479b20a6c 100644 > --- a/drivers/staging/iio/resolver/ad2s1210.h > +++ b/drivers/staging/iio/resolver/ad2s1210.h > @@ -12,9 +12,6 @@ > #define _AD2S1210_H > > struct ad2s1210_platform_data { > - unsigned intsample; > - unsigned inta[2]; > - unsigned intres[2]; > boolgpioin; > }; > #endif /* _AD2S1210_H */ -- Slawomir Stepien

Re: [PATCH v2] staging: iio: ad2s1210: Switch to the gpio descriptor interface

2018-10-23 Thread Slawomir Stepien
gt;max_speed_hz; > spi->mode = SPI_MODE_3; > spi_setup(spi); > ad2s1210_initial(st); > > return 0; > - > -error_free_gpios: > - ad2s1210_free_gpios(st); > - return ret; > } > > static int ad2s1210_remove(struct spi_device *spi) > @@ -711,7 +717,6 @@ static int ad2s1210_remove(struct spi_device *spi) > struct iio_dev *indio_dev = spi_get_drvdata(spi); > > iio_device_unregister(indio_dev); > - ad2s1210_free_gpios(iio_priv(indio_dev)); > > return 0; > } > diff --git a/drivers/staging/iio/resolver/ad2s1210.h > b/drivers/staging/iio/resolver/ad2s1210.h > index e9b2147701fc..63d479b20a6c 100644 > --- a/drivers/staging/iio/resolver/ad2s1210.h > +++ b/drivers/staging/iio/resolver/ad2s1210.h > @@ -12,9 +12,6 @@ > #define _AD2S1210_H > > struct ad2s1210_platform_data { > - unsigned intsample; > - unsigned inta[2]; > - unsigned intres[2]; > boolgpioin; > }; > #endif /* _AD2S1210_H */ -- Slawomir Stepien

Re: [PATCH] staging: iio: ad2s1210: Switch to the gpio descriptor interface

2018-10-21 Thread Slawomir Stepien
On paź 21, 2018 10:31, Slawomir Stepien wrote: > On paź 21, 2018 11:49, Nishad Kamdar wrote: > > -static int ad2s1210_setup_gpios(struct ad2s1210_state *st) > > +static int ad2s1210_setup_gpios(struct spi_device *spi, > > + struct ad2s1210_state *st

Re: [PATCH] staging: iio: ad2s1210: Switch to the gpio descriptor interface

2018-10-21 Thread Slawomir Stepien
st->pdata = spi->dev.platform_data; > - ret = ad2s1210_setup_gpios(st); > + ret = ad2s1210_setup_gpios(spi, st); > if (ret < 0) > return ret; > > @@ -702,7 +734,7 @@ static int ad2s1210_probe(struct spi_device *spi) > return 0; > > error_free_gpios: > - ad2s1210_free_gpios(st); > + ad2s1210_free_gpios(spi, st); > return ret; > } > > @@ -711,7 +743,7 @@ static int ad2s1210_remove(struct spi_device *spi) > struct iio_dev *indio_dev = spi_get_drvdata(spi); > > iio_device_unregister(indio_dev); > - ad2s1210_free_gpios(iio_priv(indio_dev)); > + ad2s1210_free_gpios(spi, iio_priv(indio_dev)); > > return 0; > } > diff --git a/drivers/staging/iio/resolver/ad2s1210.h > b/drivers/staging/iio/resolver/ad2s1210.h > index e9b2147701fc..63d479b20a6c 100644 > --- a/drivers/staging/iio/resolver/ad2s1210.h > +++ b/drivers/staging/iio/resolver/ad2s1210.h > @@ -12,9 +12,6 @@ > #define _AD2S1210_H > > struct ad2s1210_platform_data { > - unsigned intsample; > - unsigned inta[2]; > - unsigned intres[2]; > boolgpioin; > }; > #endif /* _AD2S1210_H */ -- Slawomir Stepien

Re: [PATCH] staging: iio: adc: Add comments to prevent checks corrections

2018-10-16 Thread Slawomir Stepien
stepien/linux-1/commit/1adc0428b496f44f6a931637084bb619ddd9992d but I'm not that sure it is the best way to go. What do you all think? -- Slawomir Stepien

Re: [PATCH] staging: iio: adc: ad7280a: fix 2 checks

2018-10-11 Thread Slawomir Stepien
On paź 11, 2018 10:32, Dan Carpenter wrote: > On Sat, Oct 06, 2018 at 10:25:42PM +0200, Slawomir Stepien wrote: > > On paź 06, 2018 13:27, Gabriel Capella wrote: > > > This patch does not change the logic, it only > > > corrects the checkpatch checks. > > > &g

Re: [PATCH] staging: iio: adc: ad7280a: fix 2 checks

2018-10-06 Thread Slawomir Stepien
ELL_UNDERVOLTAGE); > > static IIO_DEVICE_ATTR_NAMED(in_thresh_high_value, > - in_voltage-voltage_thresh_high_value, > + in_voltage - voltage_thresh_high_value, > 0644, > ad7280_read_channel_config, > ad7280_write_channel_config, -- Slawomir Stepien

Re: [PATCH v3 1/8] iio:core: add a callback to allow drivers to provide _available attributes

2016-11-07 Thread Slawomir Stepien
2.00 2.50 > > > > Is there any driver using this format? :) > > Yes, soon. Hopefully. See patch 3/8 > iio: mcp4531: provide range of available raw values > https://patchwork.kernel.org/patch/9391283/ I would also like to add this to mcp4131.c and ds1803.c. -- Slawomir Stepien

Re: [PATCH] Input: gpio-keys - use module_platform_driver macro

2016-10-27 Thread Slawomir Stepien
hat. > > -module_exit(gpio_keys_exit); > > +module_platform_driver(gpio_keys_device_driver); > > > > MODULE_LICENSE("GPL"); > > MODULE_AUTHOR("Phil Blundell "); > > Thanks. Thank you. -- Slawomir Stepien

[PATCH] Input: gpio-keys - use module_platform_driver macro

2016-10-27 Thread Slawomir Stepien
The gpio_keys_init() and gpio_keys_exit() are not doing anything more then just register and unregister. Replace these functions with module_platform_driver. Signed-off-by: Slawomir Stepien --- drivers/input/keyboard/gpio_keys.c | 13 + 1 file changed, 1 insertion(+), 12 deletions

[PATCH v3] iio: potentiometer: add driver for Maxim Integrated DS1803

2016-04-10 Thread Slawomir Stepien
The following functions are supported: - write, read potentiometer value - potentiometer scale Datasheet: https://datasheets.maximintegrated.com/en/ds/DS1803.pdf Signed-off-by: Slawomir Stepien --- Changes since v2: - Use array of u8 as a result type for i2c_master_recv() call Changes since

Re: [PATCH v2] iio: potentiometer: add driver for Maxim Integrated DS1803

2016-04-09 Thread Slawomir Stepien
On Apr 08, 2016 23:27, Slawomir Stepien wrote: > +static int ds1803_read_raw(struct iio_dev *indio_dev, > + struct iio_chan_spec const *chan, > + int *val, int *val2, long mask) > +{ > + struct ds1803_data *data = iio_priv(indio_de

[PATCH v2] iio: potentiometer: add driver for Maxim Integrated DS1803

2016-04-08 Thread Slawomir Stepien
The following functions are supported: - write, read potentiometer value - potentiometer scale Datasheet: https://datasheets.maximintegrated.com/en/ds/DS1803.pdf Signed-off-by: Slawomir Stepien --- Changes since v1: - Removed unnecessary include file - Use i2c_master_recv() in place of

Re: [PATCH] iio: potentiometer: add driver for Maxim Integrated DS1803

2016-04-08 Thread Slawomir Stepien
if (val > DS1803_MAX_POS || val < 0) > > > > > > check that val2 is 0 or use .write_raw_get_fmt > > > > At this point I do not know why should I do it, but I will look into that. > > write_raw expects a VAL_INT_PLUS_MICROS per default, passed > in val and val2 > > you can change that with .write_raw_get_fmt (e.g. to expect VAL_INT), > or just make sure that the micros are 0 Thank you for the explanation. -- Slawomir Stepien

Re: [PATCH] iio: potentiometer: add driver for Maxim Integrated DS1803

2016-04-08 Thread Slawomir Stepien
l > DS1803_MAX_POS || val < 0) > > check that val2 is 0 or use .write_raw_get_fmt At this point I do not know why should I do it, but I will look into that. > > + indio_dev->dev.parent = dev; > > + indio_dev->info = &ds1803_info; > > + indio_dev->channels = ds1803_channels; > > + indio_dev->num_channels = DS1803_NUM_WIPERS; > > ARRAY_SIZE(ds1803_channels) Good point. -- Slawomir Stepien

[PATCH] iio: potentiometer: add driver for Maxim Integrated DS1803

2016-04-07 Thread Slawomir Stepien
The following functions are supported: - write, read potentiometer value - potentiometer scale Datasheet: https://datasheets.maximintegrated.com/en/ds/DS1803.pdf Signed-off-by: Slawomir Stepien --- .../bindings/iio/potentiometer/ds1803.txt | 21 +++ drivers/iio/potentiometer

Re: [PATCH v5] iio: potentiometer: add driver for Microchip MCP413X/414X/415X/416X/423X/424X/425X/426X

2016-03-29 Thread Slawomir Stepien
On Mar 28, 2016 15:58, Jonathan Cameron wrote: > On 23/03/16 08:57, Slawomir Stepien wrote: > > The following functionalities are supported: > > - write, read from volatile memory > > > > Datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/22060b.pdf >

[PATCH v5] iio: potentiometer: add driver for Microchip MCP413X/414X/415X/416X/423X/424X/425X/426X

2016-03-23 Thread Slawomir Stepien
The following functionalities are supported: - write, read from volatile memory Datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/22060b.pdf Signed-off-by: Slawomir Stepien --- Changes since v4: - Added necessary include files and sorted all includes - Added missing mutex unlock when

Re: [PATCH v4] iio: potentiometer: add driver for Microchip MCP413X/414X/415X/416X/423X/424X/425X/426X

2016-03-22 Thread Slawomir Stepien
On Mar 22, 2016 17:10, Joachim Eastwood wrote: > Hi Slawomir, > > On 22 March 2016 at 16:44, Slawomir Stepien wrote: > > The following functionalities are supported: > > - write, read from volatile memory > > > > Datasheet: http://ww1.microchip.com/

[PATCH v4] iio: potentiometer: add driver for Microchip MCP413X/414X/415X/416X/423X/424X/425X/426X

2016-03-22 Thread Slawomir Stepien
The following functionalities are supported: - write, read from volatile memory Datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/22060b.pdf Signed-off-by: Slawomir Stepien --- Changes since v3: - Added 'potentiometer' to subject - Replaced mcp4131_exec with spi_write and mc

Re: [PATCH v3] iio: add driver for Microchip MCP413X/414X/415X/416X/423X/424X/425X/426X

2016-03-21 Thread Slawomir Stepien
ally > > something like w4r12 in the read case anyway. The write case could indeed > > be done with spi_write. > > Indeed. I didn't notice that for the read case. > > The read case could almost be copy of spi_read, though. One would only > need to add ".tx_buf = buf" when setting up the transfer struct, I > think. Having it in its a own function with a comment would make it > easier to spot the difference. Just to see if I get it. For write case I should use the spi_write as it is: case MCP4131_WRITE: spi_write(...); For read case I should create new function (e.g. mcp4131_read) that will look like spi_read but with additional tx_buf content so I can read the data on miso? case MCP4131_READ: mcp4131_read(...) Keep the needed buffers (transfer/message) local. -- Slawomir Stepien

Re: [PATCH v3] iio: add driver for Microchip MCP413X/414X/415X/416X/423X/424X/425X/426X

2016-03-20 Thread Slawomir Stepien
On Mar 20, 2016 17:12, Joachim Eastwood wrote: > Hi Slawomir, > > On 20 March 2016 at 15:30, Slawomir Stepien wrote: > > The following functionalities are supported: > > - write, read from volatile memory > > I think it would be useful if you could put 'potent

[PATCH v3] iio: add driver for Microchip MCP413X/414X/415X/416X/423X/424X/425X/426X

2016-03-20 Thread Slawomir Stepien
The following functionalities are supported: - write, read from volatile memory Datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/22060b.pdf Signed-off-by: Slawomir Stepien --- Changes since v2: - Removed unnecessary parentheses in MCP4131_WIPER_SHIFT macro - Replaced the rx and tx

Re: [PATCH v2] iio: add driver for Microchip MCP413X/414X/415X/416X/423X/424X/425X/426X

2016-03-20 Thread Slawomir Stepien
gt; > no need to call > Hmm. This is an oddity, the mutex_destroy exists to aid in debugging locking > issues by explicity marking the mutex as do not use - iff the mutex > debugging is enabled. In this case the storage is promptly deleted anyway > so any attempt to use the mutex would result in a null pointer dereference > anyway. Hence probably not worth having it here. OK. Thank your for all the explanations. This helps a lot. -- Slawomir Stepien

Re: [PATCH v2] iio: add driver for Microchip MCP413X/414X/415X/416X/423X/424X/425X/426X

2016-03-20 Thread Slawomir Stepien
dio_dev); > > don't call this explicitly, it is done automatically after _remove That's why it's called managed (devm_*)? > > + > > + dev_info(&spi->dev, "Unregistered %s\n", indio_dev->name); > > don't > > I think the entire _remove can be removed OK. Thank you for the review. I'm learning a lot! -- Slawomir Stepien

[PATCH] iio: add driver for Microchip MCP414X/416X/424X/426X

2016-03-19 Thread Slawomir Stepien
ding new entries keep the list in alphabetical order +obj-$(CONFIG_MCP41XX) += mcp41xx.o obj-$(CONFIG_MCP4531) += mcp4531.o diff --git a/drivers/iio/potentiometer/mcp41xx.c b/drivers/iio/potentiometer/mcp41xx.c new file mode 100644 index 000..654965b --- /dev/null +++ b/drivers/iio/potentiometer/

Re: [PATCH] iio: add driver for Microchip MCP414X/416X/424X/426X

2016-03-19 Thread Slawomir Stepien
On Mar 16, 2016 13:30, Peter Meerwald-Stadler wrote: > On Wed, 16 Mar 2016, Slawomir Stepien wrote: > > > The following functionalities are supported: > > - write, read from volatile and non volatile memory > > - increase and decrease commands > > - read from st

[PATCH v2] iio: add driver for Microchip MCP413X/414X/415X/416X/423X/424X/425X/426X

2016-03-19 Thread Slawomir Stepien
The following functionalities are supported: - write, read from volatile memory Datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/22060b.pdf Signed-off-by: Slawomir Stepien --- This is v2 of patch: "iio: add driver for Microchip MCP414X/416X/424X/426X" Changes since v1:

Re: [PATCH] iio: add driver for Microchip MCP414X/416X/424X/426X

2016-03-19 Thread Slawomir Stepien
On Mar 16, 2016 20:28, Daniel Baluta wrote: > On Wed, Mar 16, 2016 at 6:25 PM, Slawomir Stepien wrote: > > On Mar 16, 2016 13:30, Peter Meerwald-Stadler wrote: > >> On Wed, 16 Mar 2016, Slawomir Stepien wrote: > >> > >> > The following functionalities ar

Re: [PATCH] iio: add driver for Microchip MCP414X/416X/424X/426X

2016-03-19 Thread Slawomir Stepien
On Mar 16, 2016 19:24, Lars-Peter Clausen wrote: > On 03/16/2016 05:25 PM, Slawomir Stepien wrote: > > On Mar 16, 2016 13:30, Peter Meerwald-Stadler wrote: > [...] > >> plenty of the private API, some of which seems to be debug only? > >> what is really needed to in