linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: fbtft: add spi_device_id table
@ 2021-11-27 22:20 Heiner Kallweit
  2021-11-30  8:16 ` Geert Uytterhoeven
  0 siblings, 1 reply; 3+ messages in thread
From: Heiner Kallweit @ 2021-11-27 22:20 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: dri-devel, linux-fbdev, linux-staging

After 5fa6863ba692 ("spi: Check we have a spi_device_id for each DT
compatible") we need the following to make the SPI core happy.

Works for me with a SH1106-based OLED display.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/staging/fbtft/fbtft.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
index 6869f3603..3f1fbdd48 100644
--- a/drivers/staging/fbtft/fbtft.h
+++ b/drivers/staging/fbtft/fbtft.h
@@ -307,12 +307,19 @@ static const struct of_device_id dt_ids[] = {                              \
 									   \
 MODULE_DEVICE_TABLE(of, dt_ids);                                           \
 									   \
+static const struct spi_device_id spi_ids[] = {                            \
+	{ .name = _compatible },					   \
+	{},                                                                \
+};                                                                         \
+									   \
+MODULE_DEVICE_TABLE(spi, spi_ids);					   \
 									   \
 static struct spi_driver fbtft_driver_spi_driver = {                       \
 	.driver = {                                                        \
 		.name   = _name,                                           \
 		.of_match_table = dt_ids,                                  \
 	},                                                                 \
+	.id_table = spi_ids,						   \
 	.probe  = fbtft_driver_probe_spi,                                  \
 	.remove = fbtft_driver_remove_spi,                                 \
 };                                                                         \
-- 
2.34.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: fbtft: add spi_device_id table
  2021-11-27 22:20 [PATCH] staging: fbtft: add spi_device_id table Heiner Kallweit
@ 2021-11-30  8:16 ` Geert Uytterhoeven
  2021-11-30 20:22   ` Heiner Kallweit
  0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2021-11-30  8:16 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Greg Kroah-Hartman, DRI Development, Linux Fbdev development list,
	linux-staging

Hi Heiner,

On Mon, Nov 29, 2021 at 10:12 PM Heiner Kallweit <hkallweit1@gmail.com> wrote:
> After 5fa6863ba692 ("spi: Check we have a spi_device_id for each DT
> compatible") we need the following to make the SPI core happy.
>
> Works for me with a SH1106-based OLED display.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Thanks for your patch!

> --- a/drivers/staging/fbtft/fbtft.h
> +++ b/drivers/staging/fbtft/fbtft.h
> @@ -307,12 +307,19 @@ static const struct of_device_id dt_ids[] = {                              \
>                                                                            \
>  MODULE_DEVICE_TABLE(of, dt_ids);                                           \
>                                                                            \
> +static const struct spi_device_id spi_ids[] = {                            \
> +       { .name = _compatible },                                           \

Shouldn't this be the part of _compatible after the "<vendor>," prefix?

> +       {},                                                                \
> +};                                                                         \
> +                                                                          \
> +MODULE_DEVICE_TABLE(spi, spi_ids);                                        \
>                                                                            \
>  static struct spi_driver fbtft_driver_spi_driver = {                       \
>         .driver = {                                                        \
>                 .name   = _name,                                           \
>                 .of_match_table = dt_ids,                                  \
>         },                                                                 \
> +       .id_table = spi_ids,                                               \
>         .probe  = fbtft_driver_probe_spi,                                  \
>         .remove = fbtft_driver_remove_spi,                                 \
>  };                                                                         \

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: fbtft: add spi_device_id table
  2021-11-30  8:16 ` Geert Uytterhoeven
@ 2021-11-30 20:22   ` Heiner Kallweit
  0 siblings, 0 replies; 3+ messages in thread
From: Heiner Kallweit @ 2021-11-30 20:22 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Greg Kroah-Hartman, DRI Development, Linux Fbdev development list,
	linux-staging

On 30.11.2021 09:16, Geert Uytterhoeven wrote:
> Hi Heiner,
> 
> On Mon, Nov 29, 2021 at 10:12 PM Heiner Kallweit <hkallweit1@gmail.com> wrote:
>> After 5fa6863ba692 ("spi: Check we have a spi_device_id for each DT
>> compatible") we need the following to make the SPI core happy.
>>
>> Works for me with a SH1106-based OLED display.
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> 
> Thanks for your patch!
> 
>> --- a/drivers/staging/fbtft/fbtft.h
>> +++ b/drivers/staging/fbtft/fbtft.h
>> @@ -307,12 +307,19 @@ static const struct of_device_id dt_ids[] = {                              \
>>                                                                            \
>>  MODULE_DEVICE_TABLE(of, dt_ids);                                           \
>>                                                                            \
>> +static const struct spi_device_id spi_ids[] = {                            \
>> +       { .name = _compatible },                                           \
> 
> Shouldn't this be the part of _compatible after the "<vendor>," prefix?
> 

You're right. I was fooled by a new bug in SPI core that made the warning
suddenly disappear:
https://patchwork.kernel.org/project/spi-devel-general/patch/44b2ad71-dc4b-801c-237f-9c233f675c0d@gmail.com/

>> +       {},                                                                \
>> +};                                                                         \
>> +                                                                          \
>> +MODULE_DEVICE_TABLE(spi, spi_ids);                                        \
>>                                                                            \
>>  static struct spi_driver fbtft_driver_spi_driver = {                       \
>>         .driver = {                                                        \
>>                 .name   = _name,                                           \
>>                 .of_match_table = dt_ids,                                  \
>>         },                                                                 \
>> +       .id_table = spi_ids,                                               \
>>         .probe  = fbtft_driver_probe_spi,                                  \
>>         .remove = fbtft_driver_remove_spi,                                 \
>>  };                                                                         \
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-30 20:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-27 22:20 [PATCH] staging: fbtft: add spi_device_id table Heiner Kallweit
2021-11-30  8:16 ` Geert Uytterhoeven
2021-11-30 20:22   ` Heiner Kallweit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).