From: Florian Fainelli <f.fainelli@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Platform Driver <platform-driver-x86@vger.kernel.org>,
Chris Healy <cphealy@gmail.com>,
Guenter Roeck <linux@roeck-us.net>,
Darren Hart <dvhart@infradead.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] platform/x86: Add IMS/ZII SCU driver
Date: Tue, 24 Jan 2017 12:07:50 -0800 [thread overview]
Message-ID: <b9f42c24-9a5f-5486-f097-2b65a3c809ab@gmail.com> (raw)
In-Reply-To: <CAHp75Veg_A+1a9-bHDBEAieXy+7wgLRakg1yGKO=PUO_HyVoOg@mail.gmail.com>
On 01/24/2017 11:39 AM, Andy Shevchenko wrote:
>> Are you concerned with storage, or what motivates the preference for
>> bitfields vs. bools?
>
> Just matter of style. Up to you.
>
>>>> + { /* bit 5 */
>>>> + .name = "SD6:a:error",
>>>> + .gpio = SCU_SD_ERROR_6_GPIO,
>>>> + .active_low = 1,
>>>> + .default_trigger = "none",
>>>> + .default_state = LEDS_GPIO_DEFSTATE_OFF,
>>>> + }
>>>> +};
>>>
>>> Hmm... Can you utilize device tree for that?
>>
>> Not really an option here
>
> Why not?
The platform is several years old, it is currently deployed with a boot
loader that does not support passing a Device Tree blob pointer in one
of the special e820 regions, I looked into that before, but I am not
proficient enough with grub's source code to make that happen nor do I
think this is going to be worth the trouble for these specific platforms.
Last I worked on x86 and Device Tree on CE4100 (2013 or so) there was
quite a lot of ad-hoc and not so generic code early FDT/OF
initialization code that had to be provided which AFAIR would hinder the
multiplatform capability of the kernel on x86 if there was a second DT
enabled platform that would show up. I did started that route, and it
did not look pretty, also, I would have to make *all* drivers used by
this platform (kempld and friends) to become DT aware, and make sure
that they do propagate of_node/child of_node correctly, major pain.
Finally, writing a complete Device Tree for this platform is a major
pain because a lot of the peripherals are being a PCI host bridge and
some of them are several levels deep (SPI over I2C expander over CPLD
over...).
>
>>> Or built-in device properties?
>>
>> Not clear what you mean by that, can you expand?
>
> include/linux/properties.h (platform data in a form of DT resource provider)
>
>>>> +static void pca_leds_register(struct device *parent,
>>>> + struct scu_data *data)
>>>> +{
>>>> + data->leds_pdev[0] =
>>>> + platform_device_register_data(parent, "leds-gpio", 1,
>>>> + &pca_gpio_led_info1,
>>>> + sizeof(pca_gpio_led_info1));
>>>> + data->leds_pdev[1] =
>>>> + platform_device_register_data(parent, "leds-gpio", 2,
>>>> + &pca_gpio_led_info2,
>>>> + sizeof(pca_gpio_led_info2));
>>>> + data->leds_pdev[2] =
>>>> + platform_device_register_data(parent, "leds-gpio", 3,
>>>> + &pca_gpio_led_info3,
>>>> + sizeof(pca_gpio_led_info3));
>>>> +}
>>>
>>> It really sounds like MFD to me.
>>
>> It's more of a board description of attached peripherals (all of them),
>> more than a multi-function device, the whole module is by nature, "multi
>> function" since it has a bunch of different I/Os and on-module peripherals.
>
> So, there is neither ACPI, nor DT provider for such resources?
Nope.
> We used to have a hell of a time to handle board files for Intel MID
> platforms under arch/x86/platform/intel-mid (formerly known as
> mrst.c), so, I don't like the idea of board files.
I understand the pain, but we also have to work with the tools we have,
and neither DT nor ACPI are such tools at the moment for this platform.
Thanks
--
Florian
next prev parent reply other threads:[~2017-01-24 20:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-11 21:26 Florian Fainelli
2017-01-13 10:15 ` kbuild test robot
2017-01-13 10:15 ` [PATCH] platform/x86: fix platform_no_drv_owner.cocci warnings kbuild test robot
2017-01-13 16:38 ` [PATCH] platform/x86: Add IMS/ZII SCU driver Andy Shevchenko
2017-01-13 18:22 ` Darren Hart
2017-01-13 23:11 ` Florian Fainelli
2017-01-13 23:15 ` Florian Fainelli
2017-01-14 5:49 ` Guenter Roeck
2017-01-24 19:39 ` Andy Shevchenko
2017-01-24 20:07 ` Florian Fainelli [this message]
2017-01-24 20:18 ` Andy Shevchenko
2017-01-24 18:45 ` Florian Fainelli
2017-01-24 21:08 ` Andy Shevchenko
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=b9f42c24-9a5f-5486-f097-2b65a3c809ab@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=cphealy@gmail.com \
--cc=dvhart@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--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
all inboxes | Powered by JetHome®