linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Vincent Pelletier <plr.vincent@gmail.com>
Cc: linux-leds@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: leds-gpio on x86
Date: Wed, 12 Aug 2015 15:53:14 +0300	[thread overview]
Message-ID: <20150812125314.GS1541@lahna.fi.intel.com> (raw)
In-Reply-To: <20150811194256.08816c63@x2>

On Tue, Aug 11, 2015 at 07:42:56PM +0200, Vincent Pelletier wrote:
> On Tue, 11 Aug 2015 15:00:38 +0300, Mika Westerberg
> <mika.westerberg@linux.intel.com> wrote:
> > One thing I noticed:
> > 
> > 	qnap_tsx51_leds_platform_device = platform_device_register_resndata(NULL, "led-gpio", -1, NULL, 0,
> > 		&qnap_tsx51_led_data, sizeof(qnap_tsx51_led_data));
> > 
> > The driver expects "leds-gpio" not "led-gpio".
> 
> And indeed, this is what was preventing proper detection.
> Very nice catch, thanks a lot.
> 
> Now, I see two more things I need to do and for which I have no idea:
> - Somehow depend on gpio-f7188x and cause leds-gpio to get loaded (is it
>   a dependence too ?).
>   Module writing documentation mention soft dependencies, but it feels
>   wrong here.

Once your module gets loaded, it creates the "leds-gpio" platform device
which in turn makes the leds-gpio driver to load.

For gpio-f7188x you need to load it manually because it does not have
any module strings modprobe can match with a device. You can create
platform device for this in your qnap board file as well and then add
MODULE_ALIAS() to the driver to get it loaded automatically.

> - Somehow detect that it is actually a qnap of expected model (and, by
>   extension, actually implement led count substraction).
>   I tried (and failed so far) to understand what the original firmware
>   does. dmidecode does not bring something relevant. I have no idea
>   what is typically done in this area.

Typically we get necessary information from ACPI or similar device
description ;-)

You may check DMI strings in _init() of your board file and only create
the platform devices if they match qnap. /sys/class/dmi/id/* should have
something to differentiate it from others.

  reply	other threads:[~2015-08-12 12:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-05 20:09 leds-gpio on x86 Vincent Pelletier
2015-08-06 16:59 ` Mika Westerberg
2015-08-06 17:17   ` Vincent Pelletier
2015-08-06 17:35     ` Mika Westerberg
2015-08-06 18:18       ` Vincent Pelletier
2015-08-07 10:57         ` Mika Westerberg
2015-08-08 12:06           ` Vincent Pelletier
2015-08-11 12:00             ` Mika Westerberg
2015-08-11 17:42               ` Vincent Pelletier
2015-08-12 12:53                 ` Mika Westerberg [this message]
2015-08-15 10:36                   ` Vincent Pelletier

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=20150812125314.GS1541@lahna.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=plr.vincent@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).