X86 platform drivers
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"AceLan Kao" <acelan.kao@canonical.com>,
	"Kai-Heng Feng" <kai.heng.feng@canonical.com>,
	platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH 1/2] platform/x86: Add new Dell UART backlight driver
Date: Mon, 13 May 2024 12:01:55 +0200	[thread overview]
Message-ID: <796db4c0-e81f-4067-9deb-bef8b36979c9@redhat.com> (raw)
In-Reply-To: <CAHp75VeMT+Pcvf-T9-iVqchSx1tppaeORWMmFhP66ZMg-ybmPw@mail.gmail.com>

Hi,

On 5/12/24 9:35 PM, Andy Shevchenko wrote:
> On Sun, May 12, 2024 at 7:24 PM Hans de Goede <hdegoede@redhat.com> wrote:
>>
>> Dell All In One (AIO) models released after 2017 use a backlight controller
>> board connected to an UART.
>>
>> In DSDT this uart port will be defined as:
>>
>>    Name (_HID, "DELL0501")
>>    Name (_CID, EisaId ("PNP0501")
>>
>> Instead of having a separate ACPI device with an UartSerialBusV2() resource
>> to model the backlight-controller, which would be the standard way to do
>> this.
>>
>> The acpi_quirk_skip_serdev_enumeration() has special handling for this
>> and it will make the serial port code create a serdev controller device
>> for the UART instead of a /dev/ttyS0 char-dev. It will also create
>> a dell-uart-backlight driver platform device for this driver to bind too.
>>
>> This new kernel module contains 2 drivers for this:
>>
>> 1. A simple platform driver which creates the actual serdev device
>>    (with the serdev controller device as parent)
>>
>> 2. A serdev driver for the created serdev device which exports
>>    the backlight functionality uses a standard backlight class device.
> 
> ...
> 
>> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> 
> How is this being used?

#include "../serdev_helpers.h"

uses this.

> 
> ...
> 
>> +#include <linux/acpi.h>
> 
> + array_size.h
> 
>> +#include <linux/backlight.h>
>> +#include <linux/delay.h>
> 
> + device.h // devm_kzalloc(), dev_err() et al.
> 
> + err.h
> 
>> +#include <linux/module.h>
>> +#include <linux/mutex.h>
>> +#include <linux/platform_device.h>
>> +#include <linux/serdev.h>
> 
> + string.h
> + types.h
> 
>> +#include <linux/wait.h>

Ack, all includes added, thanks.

<snip>


>> +static int dell_uart_update_status(struct backlight_device *bd)
>> +{
>> +       struct dell_uart_backlight *dell_bl = bl_get_data(bd);
>> +       int ret;
>> +
>> +       ret = dell_uart_set_brightness(dell_bl, bd->props.brightness);
>> +       if (ret)
>> +               return ret;
>> +
>> +       if (bd->props.power != dell_uart_get_bl_power(dell_bl))
>> +               ret = dell_uart_set_bl_power(dell_bl, bd->props.power);
> 
>     return ...;
> 
>> +       return ret;
> 
>   return 0;
> 
> ?

Ack, fixed for v2.

Regards,

Hans


  reply	other threads:[~2024-05-13 10:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-12 16:23 [PATCH 0/2] platform/x86: Add new Dell UART backlight driver Hans de Goede
2024-05-12 16:23 ` [PATCH 1/2] " Hans de Goede
2024-05-12 19:35   ` Andy Shevchenko
2024-05-13 10:01     ` Hans de Goede [this message]
2024-05-13 12:28       ` Andy Shevchenko
2024-05-13 12:36         ` Ilpo Järvinen
2024-05-13  8:34   ` Ilpo Järvinen
2024-05-13  9:55     ` Hans de Goede
2024-05-13 12:12       ` Ilpo Järvinen
2024-05-13 12:14         ` Ilpo Järvinen
2024-05-13 13:07         ` Hans de Goede
2024-05-13 13:14           ` Ilpo Järvinen
2024-05-13 13:21             ` Hans de Goede
2024-05-13 13:34               ` Ilpo Järvinen
2024-05-13 14:23                 ` Hans de Goede
2024-05-13 14:36                   ` Ilpo Järvinen
2024-05-13 14:39                     ` Hans de Goede
2024-05-12 16:23 ` [PATCH 2/2] tools arch x86: Add dell-uart-backlight-emulator Hans de Goede
2024-05-12 19:32   ` Andy Shevchenko
2024-05-12 19:47     ` Hans de Goede
2024-05-13 11:03     ` Hans de Goede

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=796db4c0-e81f-4067-9deb-bef8b36979c9@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=acelan.kao@canonical.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=kai.heng.feng@canonical.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /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