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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
>
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
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/
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
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
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
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
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
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
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/
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
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:
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
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
33 matches
Mail list logo