[v2,2/2] spi: spidev: add new mediatek support

Message ID 20230118-mt8365-spi-support-v2-2-be3ac97a28c6@baylibre.com
State New
Headers
Series Add MediaTek MT8365 SPI support |

Commit Message

Alexandre Mergnat Jan. 19, 2023, 5:28 p.m. UTC
  Add the "mediatek,genio" compatible string to support Mediatek
SPI controller on the genio boards.

Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
 drivers/spi/spidev.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Mark Brown Jan. 19, 2023, 5:36 p.m. UTC | #1
On Thu, Jan 19, 2023 at 06:28:20PM +0100, Alexandre Mergnat wrote:
> Add the "mediatek,genio" compatible string to support Mediatek
> SPI controller on the genio boards.

All my previous review comments stand, please don't ignore review
feedback.
  
Alexandre Mergnat Jan. 19, 2023, 7:30 p.m. UTC | #2
Le jeu. 19 janv. 2023 à 18:36, Mark Brown <broonie@kernel.org> a écrit :
>
> On Thu, Jan 19, 2023 at 06:28:20PM +0100, Alexandre Mergnat wrote:
> > Add the "mediatek,genio" compatible string to support Mediatek
> > SPI controller on the genio boards.
>
> All my previous review comments stand, please don't ignore review
> feedback.

Hi Mark,

Yes sorry about that, I wasn't aware that I've some feedback when I
sent V2 for a quickfix.

I will take care about your comment:

> We need a matching update to the binding document.
>
> This does also seem like a terribly generic name - Google
> suggests that this is actually a series of numbered products (eg,
> Genio 700), perhaps we should be using the specific numbers here?
> I guess users would care which they're talking to.  It really
> parses as being "generic I/O" which would be an end run around
> describing the actual product though it's not actually that.

Is there a binding documentation for spidev ? I didn't find it.

My understanding is to have something more specific like:
compatible = "mediatek,genio350"
Or maybe use the SoC name, to be aligned with the DTS ?
compatible = "mediatek,spi-mt8365"

Regards,
Alex
  
Krzysztof Kozlowski Jan. 20, 2023, 8:23 a.m. UTC | #3
On 19/01/2023 20:30, Alexandre Mergnat wrote:
> Le jeu. 19 janv. 2023 à 18:36, Mark Brown <broonie@kernel.org> a écrit :
>>
>> On Thu, Jan 19, 2023 at 06:28:20PM +0100, Alexandre Mergnat wrote:
>>> Add the "mediatek,genio" compatible string to support Mediatek
>>> SPI controller on the genio boards.
>>
>> All my previous review comments stand, please don't ignore review
>> feedback.
> 
> Hi Mark,
> 
> Yes sorry about that, I wasn't aware that I've some feedback when I
> sent V2 for a quickfix.
> 
> I will take care about your comment:
> 
>> We need a matching update to the binding document.
>>
>> This does also seem like a terribly generic name - Google
>> suggests that this is actually a series of numbered products (eg,
>> Genio 700), perhaps we should be using the specific numbers here?
>> I guess users would care which they're talking to.  It really
>> parses as being "generic I/O" which would be an end run around
>> describing the actual product though it's not actually that.
> 
> Is there a binding documentation for spidev ? I didn't find it.
> 
> My understanding is to have something more specific like:
> compatible = "mediatek,genio350"
> Or maybe use the SoC name, to be aligned with the DTS ?
> compatible = "mediatek,spi-mt8365"

This should be specific compatible for your device attached over SPI. If
you have there "Genio 350", then the first.

Compatible can be documented in its own binding or in trivial-devices (I
sent a patch for existing ones).

Best regards,
Krzysztof
  
Krzysztof Kozlowski Jan. 20, 2023, 8:26 a.m. UTC | #4
On 19/01/2023 18:28, Alexandre Mergnat wrote:
> Add the "mediatek,genio" compatible string to support Mediatek
> SPI controller on the genio boards.
> 
> Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
> ---
>  drivers/spi/spidev.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
> index 6313e7d0cdf8..e23b825b8d30 100644
> --- a/drivers/spi/spidev.c
> +++ b/drivers/spi/spidev.c
> @@ -702,6 +702,7 @@ static const struct spi_device_id spidev_spi_ids[] = {
>  	{ .name = "m53cpld" },
>  	{ .name = "spi-petra" },
>  	{ .name = "spi-authenta" },
> +	{ .name = "genio" },
>  	{},
>  };
>  MODULE_DEVICE_TABLE(spi, spidev_spi_ids);
> @@ -728,6 +729,7 @@ static const struct of_device_id spidev_dt_ids[] = {
>  	{ .compatible = "menlo,m53cpld", .data = &spidev_of_check },
>  	{ .compatible = "cisco,spi-petra", .data = &spidev_of_check },
>  	{ .compatible = "micron,spi-authenta", .data = &spidev_of_check },
> +	{ .compatible = "mediatek,genio", .data = &spidev_of_check },

Please, stop adding stuff to the end. It leads to unnecessary conflicts
with simultaneous edits and increases overall entropy.

Best regards,
Krzysztof
  

Patch

diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 6313e7d0cdf8..e23b825b8d30 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -702,6 +702,7 @@  static const struct spi_device_id spidev_spi_ids[] = {
 	{ .name = "m53cpld" },
 	{ .name = "spi-petra" },
 	{ .name = "spi-authenta" },
+	{ .name = "genio" },
 	{},
 };
 MODULE_DEVICE_TABLE(spi, spidev_spi_ids);
@@ -728,6 +729,7 @@  static const struct of_device_id spidev_dt_ids[] = {
 	{ .compatible = "menlo,m53cpld", .data = &spidev_of_check },
 	{ .compatible = "cisco,spi-petra", .data = &spidev_of_check },
 	{ .compatible = "micron,spi-authenta", .data = &spidev_of_check },
+	{ .compatible = "mediatek,genio", .data = &spidev_of_check },
 	{},
 };
 MODULE_DEVICE_TABLE(of, spidev_dt_ids);