From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Nechita, Ramona" <Ramona.Nechita@analog.com>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
"Hennerich, Michael" <Michael.Hennerich@analog.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, "Sa, Nuno" <Nuno.Sa@analog.com>,
Marius Cristea <marius.cristea@microchip.com>,
"Schmitt, Marcelo" <Marcelo.Schmitt@analog.com>,
Maksim Kiselev <bigunclemax@gmail.com>,
Ivan Mikhaylov <fr0st61te@gmail.com>,
Marcus Folkesson <marcus.folkesson@gmail.com>,
Liam Beguin <liambeguin@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drivers: iio: adc: add support for ad777x family
Date: Wed, 29 May 2024 18:11:33 +0300 [thread overview]
Message-ID: <ZldFpSQPAmAhbW2I@smile.fi.intel.com> (raw)
In-Reply-To: <SN6PR03MB432071701D6A19C3B4C0C33FF3F22@SN6PR03MB4320.namprd03.prod.outlook.com>
On Wed, May 29, 2024 at 03:01:06PM +0000, Nechita, Ramona wrote:
...
> >> + /*
> >> + * DMA (thus cache coherency maintenance) requires the
> >> + * transfer buffers to live in their own cache lines.
> >> + */
> >> + u8 reg_rx_buf[3] ____cacheline_aligned;
> >> + u8 reg_tx_buf[3];
> >
> >> + u8 spidata_rx[32];
> >> + u8 spidata_tx[32];
> >
> >These will not be cache aligned. Is it a problem?
>
> No, it should be fine without the alignment.
I.o.w. it means that only reg_*x_buf are supposed to be in the different cache lines, correct?
...
> >Btw, can't you use regmap for IO?
>
> Unfortunately, I don't think regmap could be used, because of the crc and the
> fact that data is shifted out on the SPI SDO line in the interrupt. I
> consider perhaps adding regmap to the mix might complicate things a bit.
Can you add this into the comment area of the patch?
...
> >> + ret = ad777x_spi_write(st, AD777X_REG_SRC_N_LSB, lsb);
> >> + if (ret)
> >> + return ret;
> >> + ret = ad777x_spi_write(st, AD777X_REG_SRC_N_MSB, msb);
> >> + if (ret)
> >> + return ret;
> >
> >Can you use 16-bit writes?
> >Same Q to all similar LSB/MSB write groups.
>
> I cannot do 16-bit writes due to how the spi functions on the chip and
> because the registers for MSB/LSB are at different addresses.
They are supposed to be on the different addresses.
You mean the distance between them > than stride?
...
> >> + ret = devm_add_action_or_reset(&spi->dev,
> >> + ad777x_clk_disable,
> >> + st->mclk);
> >> + if (ret)
> >> + return ret;
> >
> >So, what's wrong with the _enabled() API?
>
> Sorry, I am not sure what you mean here by _enabled() API, is there a
> different mechanism that can be used for this type of operations?
devm_clk_get_enabled()
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2024-05-29 15:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-22 11:59 [PATCH] drivers: iio: adc: add support for ad777x family ranechita
2024-05-22 14:18 ` Andy Shevchenko
2024-05-29 15:01 ` Nechita, Ramona
2024-05-29 15:11 ` Andy Shevchenko [this message]
2024-05-29 15:45 ` Nechita, Ramona
2024-05-30 15:07 ` Andy Shevchenko
2024-05-22 14:35 ` Nuno Sá
2024-05-22 15:01 ` Nechita, Ramona
2024-05-22 15:07 ` Andy Shevchenko
2024-05-22 22:40 ` kernel test robot
2024-05-24 7:17 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZldFpSQPAmAhbW2I@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=Marcelo.Schmitt@analog.com \
--cc=Michael.Hennerich@analog.com \
--cc=Nuno.Sa@analog.com \
--cc=Ramona.Nechita@analog.com \
--cc=bigunclemax@gmail.com \
--cc=broonie@kernel.org \
--cc=fr0st61te@gmail.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=liambeguin@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcus.folkesson@gmail.com \
--cc=marius.cristea@microchip.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox