Re: [RFC 1/2] ACPI: x86: Move acpi_quirk_skip_serdev_enumeration() out of CONFIG_X86_ANDROID_TABLETS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 2/18/24 19:39, Andy Shevchenko wrote:
> On Sun, Feb 18, 2024 at 5:15 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
>>
>> Some recent(ish) Dell AIO devices have a backlight controller board
>> connected to an UART.
>>
>> This UART has a DELL0501 HID with CID set to PNP0501 so that the UART is
>> still handled by 8250_pnp.c. Unfortunately there is no separate ACPI device
>> with an UartSerialBusV2() resource to model the backlight-controller.
>>
>> The next patch in this series will use acpi_quirk_skip_serdev_enumeration()
>> to still create a serdev for this for a backlight driver to bind to
>> instead of creating a /dev/ttyS0.
>>
>> This new acpi_quirk_skip_serdev_enumeration() use is not limited to Android
>> X86 tablets, so move it out of the ifdef CONFIG_X86_ANDROID_TABLETS block.
> 
> ...
> 
>> +#else
>> +static int acpi_dmi_skip_serdev_enumeration(struct device *controller_parent, bool *skip)
>> +{
>> +       return 0;
>> +}
>>  #endif
> 
> ...
> 
>>  static inline int
>>  acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip)
>>  {
>>         *skip = false;
>>         return 0;
>>  }
>> +#endif
> 
> Now you have basically two identical blocks in two files. I believe
> you may reorganize the code to have only one of these.

One is #if IS_ENABLED(CONFIG_X86_ANDROID_TABLETS) the other is
#ifdef CONFIG_X86

Also one is for a private helper, the other is for a public function.

The whole idea of this patch is actually to have both, with the
upcoming DELL0501 handling we want acpi_quirk_skip_serdev_enumeration()
to be defined (and not just an inline stub in the .h) independent
of IS_ENABLED(CONFIG_X86_ANDROID_TABLETS), the first #if block
provides a dummy for the x86-android specific bits for
the now always defined acpi_quirk_skip_serdev_enumeration() to call
when CONFIG_X86_ANDROID_TABLETS is not set.

The second #if is because acpi_quirk_skip_serdev_enumeration() still
is only defined on X86 platforms and on non x86 platforms we need
a stub for it in the public .h file.

Regards,

Hans





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux