mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: "yuechao.zhao(赵越超)" <yuechao.zhao@advantech.com.cn>,
	"Andy Shevchenko" <andy.shevchenko@gmail.com>
Cc: "345351830@qq.com" <345351830@qq.com>,
	"Rainbow.Zhang(張玉)" <Rainbow.Zhang@advantech.com.cn>,
	"yunxia.li(李云霞)" <yunxia.li@advantech.com.cn>,
	"pavel@ucw.cz" <pavel@ucw.cz>, "dmurphy@ti.com" <dmurphy@ti.com>,
	"Jia.Sui(贾睢)" <Jia.Sui@advantech.com.cn>,
	"Mark Gross" <mgross@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"platform-driver-x86@vger.kernel.org"
	<platform-driver-x86@vger.kernel.org>
Subject: Re: [v3,1/1] adv_mix955x is a scheme that multiplexes PCA9554/PCA9555 into LED and GPIO
Date: Wed, 5 May 2021 15:23:58 +0200	[thread overview]
Message-ID: <ec4da512-76c7-acec-f41d-179fd469b615@redhat.com> (raw)
In-Reply-To: <DFBFA86F-1A66-4351-9987-C63CCB40D82A@advantech.com.cn>

Hi,

On 5/3/21 3:16 PM, yuechao.zhao(赵越超) wrote:
> Hi Andy
> Sorry for the late reply
> 
> The reason for writing this driver is that our customers hope that the LED and GPIO can be used out of the box
> When they using our X86-Platform
> 
> About the document and ACPI expert, I will provide them after I improve them. Please wait for a few days.

So my initial assessment of this code matches Andy's I don't like the idea
of duplicating the GPIO chip functionality from drivers/gpio/gpio-pca953x.c here.

I understand that you want to have things working out of the box and I believe
that we all agree that that is what we want.

But you can get there without duplicating the code.

We already have cases where there is an I2C device with an existing driver
where we need some "glue" code to translate the ACPI provided info to
what the i2c drivers expect, some examples of these are:

drivers/platform/x86/i2c-multi-instantiate.c
drivers/platform/x86/intel_cht_int33fe_typec.c

So what you need to do is basically start writing a completely new driver
which:

1. Instantiates an i2c-client for the drivers/gpio/gpio-pca953x.c driver
to bind to.

2. Creates and attaches software-fwnodes which provide info for the 
drivers/leds/leds-gpio.c code to parse and have that code instantiate
LED class devices which drive the leds through the GPIO interface
offered by the drivers/gpio/gpio-pca953x.c driver.

Regards,

Hans


> 在 2021/5/2 下午6:50,“Andy Shevchenko”<andy.shevchenko@gmail.com> 写入:
> 
>     On Fri, Apr 30, 2021 at 8:27 AM yuechao.zhao(赵越超)
>     <yuechao.zhao@advantech.com.cn> wrote:
>     >
>     > From: Yuechao Zhao <yuechao.zhao@advantech.com.cn>
>     >
>     > With this driver, we can multiplex PCA9554/PCA9555 into LED and GPIO
>     > based on the ACPI data of BIOS.
> 
>     NAK as per v2.
> 
>     Please, add a proper documentation and show ACPI excerpt, and last but
>     not least is missing justification.
> 
> 
>     -- 
>     With Best Regards,
>     Andy Shevchenko
> 


  reply	other threads:[~2021-05-05 13:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <tencent_F8EEB847E2CD8A6813D0BF4863964CDF3508@qq.com>
2021-04-30  5:26 ` yuechao.zhao(赵越超)
2021-05-02 10:50   ` Andy Shevchenko
2021-05-03 13:16     ` yuechao.zhao(赵越超)
2021-05-05 13:23       ` Hans de Goede [this message]
2021-05-06  8:47         ` 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=ec4da512-76c7-acec-f41d-179fd469b615@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=345351830@qq.com \
    --cc=Jia.Sui@advantech.com.cn \
    --cc=Rainbow.Zhang@advantech.com.cn \
    --cc=andy.shevchenko@gmail.com \
    --cc=dmurphy@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgross@linux.intel.com \
    --cc=pavel@ucw.cz \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=yuechao.zhao@advantech.com.cn \
    --cc=yunxia.li@advantech.com.cn \
    /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

all inboxes | Powered by JetHome®