2023-07-11 20:16:50

by George Stark

[permalink] [raw]
Subject: [PATCH v5 0/6] iio: adc: meson: add iio channels to read channel 7 mux inputs

Changelog:

v1->v2:
split refactoring patch [1] into 4 smaller patches, fix comment style

[1] https://lore.kernel.org/lkml/[email protected]/

v2->v3:
remove patch 'meson saradc: unite iio channel array definitions' [1] after discussion

patch 'meson saradc: add enum for iio channel array indexes'
- change enum items prefix from INDEX_ to NUM_ since name 'channel index' is
more relevant to channel array index in iio world and with 2 tables our array index is
not always equal to channel number
- resolve conflicts after deleting [1]
- update commit message, previous patch [2]
- return channel number for temp channel. It wasn't used and isn't used currently
but may need later

patch meson saradc: support reading from channel 7 mux inputs
- resolve conflicts after deleting [1]
- update commit message, previous patch [3]
- add routine find_channel_by_num to get channel by channel number

[1] https://lore.kernel.org/lkml/[email protected]/
[2] https://lore.kernel.org/lkml/[email protected]/
[3] https://lore.kernel.org/lkml/[email protected]/

v3->v4:
add new patch 'iio: adc: meson: remove unused timestamp channel' [1]

patch 'iio: adc: meson: move enums declaration before'
update commit message, previous patch [2]
patch 'iio: adc: meson: move meson_sar_adc_set_chan7_mux'
update commit message, previous patch [3]
patch 'iio: adc: meson: add enum for iio channel numbers'
update commit message, previous patch [4]
patch 'iio: adc: meson: add channel labels'
update commit message, previous patch [5]
change sprintf(label, "%s\n", "temp-sensor") to sprintf(label, "temp-sensor\n")
patch 'iio: adc: meson: support reading from channel 7 mux'
rewrite enum meson_sar_adc_chan7_mux_sel definition and
read_label routine proposed by Andy [7], previous patch [6]

[1] https://lore.kernel.org/lkml/[email protected]/
[2] https://lore.kernel.org/lkml/[email protected]/
[3] https://lore.kernel.org/lkml/[email protected]/
[4] https://lore.kernel.org/lkml/[email protected]/
[5] https://lore.kernel.org/lkml/[email protected]/
[6] https://lore.kernel.org/lkml/[email protected]/
[7] https://lore.kernel.org/lkml/[email protected]/

v4->v5:
patch 'iio: adc: meson: move enums declaration before variables declaration'
update commit message, previous patch [1]
patch 'iio: adc: meson: move meson_sar_adc_set_chan7_mux routine upper'
update commit message, previous patch [2]
patch 'iio: adc: meson: add channel labels'
update commit message, previous patch [3]
patch 'iio: adc: meson: support reading from channel 7 mux inputs'
update commit message, previous patch [4]

[1] https://lore.kernel.org/lkml/[email protected]/
[2] https://www.spinics.net/lists/linux-iio/msg80226.html
[3] https://www.spinics.net/lists/linux-iio/msg80227.html
[4] https://www.spinics.net/lists/linux-iio/msg80230.html

George Stark (6):
iio: adc: meson: remove unused timestamp channel
iio: adc: meson: move enums declaration before variables declaration
iio: adc: meson: move meson_sar_adc_set_chan7_mux routine upper
iio: adc: meson: add enum for iio channel numbers
iio: adc: meson: add channel labels
iio: adc: meson: support reading from channel 7 mux inputs

drivers/iio/adc/meson_saradc.c | 173 +++++++++++++++++++++++++--------
1 file changed, 134 insertions(+), 39 deletions(-)

--
2.38.4



2023-07-11 20:16:51

by George Stark

[permalink] [raw]
Subject: [PATCH v5 1/6] iio: adc: meson: remove unused timestamp channel

Remove IIO_CHAN_SOFT_TIMESTAMP channel because it's used only for
buffering mode which is not implemented.

Signed-off-by: George Stark <[email protected]>
---
drivers/iio/adc/meson_saradc.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c
index 18937a262af6..569ffc178935 100644
--- a/drivers/iio/adc/meson_saradc.c
+++ b/drivers/iio/adc/meson_saradc.c
@@ -211,7 +211,6 @@ static const struct iio_chan_spec meson_sar_adc_iio_channels[] = {
MESON_SAR_ADC_CHAN(5),
MESON_SAR_ADC_CHAN(6),
MESON_SAR_ADC_CHAN(7),
- IIO_CHAN_SOFT_TIMESTAMP(8),
};

static const struct iio_chan_spec meson_sar_adc_and_temp_iio_channels[] = {
@@ -224,7 +223,6 @@ static const struct iio_chan_spec meson_sar_adc_and_temp_iio_channels[] = {
MESON_SAR_ADC_CHAN(6),
MESON_SAR_ADC_CHAN(7),
MESON_SAR_ADC_TEMP_CHAN(8),
- IIO_CHAN_SOFT_TIMESTAMP(9),
};

enum meson_sar_adc_avg_mode {
--
2.38.4


2023-07-11 20:34:45

by George Stark

[permalink] [raw]
Subject: [PATCH v5 5/6] iio: adc: meson: add channel labels

Add channel labels to provide human-readable names for the inputs.

Signed-off-by: George Stark <[email protected]>
---
drivers/iio/adc/meson_saradc.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c
index b14c66656bcc..918bd5da3605 100644
--- a/drivers/iio/adc/meson_saradc.c
+++ b/drivers/iio/adc/meson_saradc.c
@@ -1055,8 +1055,20 @@ static int meson_sar_adc_calib(struct iio_dev *indio_dev)
return ret;
}

+static int read_label(struct iio_dev *indio_dev,
+ struct iio_chan_spec const *chan,
+ char *label)
+{
+ if (chan->type == IIO_TEMP)
+ return sprintf(label, "temp-sensor\n");
+ if (chan->type == IIO_VOLTAGE)
+ return sprintf(label, "channel-%d\n", chan->channel);
+ return 0;
+}
+
static const struct iio_info meson_sar_adc_iio_info = {
.read_raw = meson_sar_adc_iio_info_read_raw,
+ .read_label = read_label,
};

static const struct meson_sar_adc_param meson_sar_adc_meson8_param = {
--
2.38.4


2023-07-12 15:58:26

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v5 0/6] iio: adc: meson: add iio channels to read channel 7 mux inputs

On Tue, Jul 11, 2023 at 11:00:16PM +0300, George Stark wrote:
> Changelog:

I gave you a tag, any reason why you haven't applied it to your patches?

--
With Best Regards,
Andy Shevchenko



2023-07-12 23:31:06

by George Stark

[permalink] [raw]
Subject: Re: [PATCH v5 0/6] iio: adc: meson: add iio channels to read channel 7 mux inputs

Hello Andy

On 7/12/23 18:26, Andy Shevchenko wrote:
> On Tue, Jul 11, 2023 at 11:00:16PM +0300, George Stark wrote:
>> Changelog:
>
> I gave you a tag, any reason why you haven't applied it to your patches?

if you're talking about patch 6 commit message - yes, I missed the last
line in your letter, I'll fix it.
--
Best regards
George

2023-07-13 12:15:17

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v5 0/6] iio: adc: meson: add iio channels to read channel 7 mux inputs

On Thu, Jul 13, 2023 at 02:04:05AM +0300, George Stark wrote:
> Hello Andy
>
> On 7/12/23 18:26, Andy Shevchenko wrote:
> > On Tue, Jul 11, 2023 at 11:00:16PM +0300, George Stark wrote:
> > > Changelog:
> >
> > I gave you a tag, any reason why you haven't applied it to your patches?
>
> if you're talking about patch 6 commit message - yes, I missed the last line
> in your letter, I'll fix it.

I believe I answered to the cover letter [1], which means that it applies to
the entire series. If you don't include tag of the reviewer(s) who spent time
on your code, you have to well justify WHY you did so.

[1]: https://lore.kernel.org/lkml/[email protected]/

--
With Best Regards,
Andy Shevchenko



2023-07-13 23:51:56

by George Stark

[permalink] [raw]
Subject: Re: [PATCH v5 0/6] iio: adc: meson: add iio channels to read channel 7 mux inputs



On 7/13/23 15:08, Andy Shevchenko wrote:
> On Thu, Jul 13, 2023 at 02:04:05AM +0300, George Stark wrote:
>> Hello Andy
>>
>> On 7/12/23 18:26, Andy Shevchenko wrote:
>>> On Tue, Jul 11, 2023 at 11:00:16PM +0300, George Stark wrote:
>>>
>>> I gave you a tag, any reason why you haven't applied it to your patches?
>>
>> if you're talking about patch 6 commit message - yes, I missed the last line
>> in your letter, I'll fix it.
>
> I believe I answered to the cover letter [1], which means that it applies to
> the entire series. If you don't include tag of the reviewer(s) who spent time
> on your code, you have to well justify WHY you did so.
>
> [1]: https://lore.kernel.org/lkml/[email protected]/
>

Hello Andy

I think I've understood at last what you meant by "not applied tag". I'm
not experienced kernel contributor yet and believed that RvBs and Acks
are added by one who merges patches or by some kind of magic :)
Of course I'll add the tag, I missed it not on purpose.
Thank you very much for help and your work for the common good.

--
Best regards
George

2023-07-14 07:53:40

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v5 0/6] iio: adc: meson: add iio channels to read channel 7 mux inputs

On Fri, Jul 14, 2023 at 02:11:19AM +0300, George Stark wrote:
> On 7/13/23 15:08, Andy Shevchenko wrote:
> > On Thu, Jul 13, 2023 at 02:04:05AM +0300, George Stark wrote:
> > > On 7/12/23 18:26, Andy Shevchenko wrote:
> > > > On Tue, Jul 11, 2023 at 11:00:16PM +0300, George Stark wrote:
> > > >
> > > > I gave you a tag, any reason why you haven't applied it to your patches?
> > >
> > > if you're talking about patch 6 commit message - yes, I missed the last line
> > > in your letter, I'll fix it.
> >
> > I believe I answered to the cover letter [1], which means that it applies to
> > the entire series. If you don't include tag of the reviewer(s) who spent time
> > on your code, you have to well justify WHY you did so.
> >
> > [1]: https://lore.kernel.org/lkml/[email protected]/
>
> Hello Andy
>
> I think I've understood at last what you meant by "not applied tag". I'm not
> experienced kernel contributor yet and believed that RvBs and Acks are added
> by one who merges patches or by some kind of magic :)

If you (not a maintainer) respin the series, it's your responsibility to add /
drop / update tags. And hence to explain any modifications to that.

> Of course I'll add the tag, I missed it not on purpose.
> Thank you very much for help and your work for the common good.

No problem, as I said, I'm in favour of your good contribution,
just some processing issues which can be easily fixed.

--
With Best Regards,
Andy Shevchenko