All of lore.kernel.org
 help / color / mirror / Atom feed
From: "João Paulo Rechi Vita" <jprvita@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "Darren Hart" <dvhart@infradead.org>,
	"Platform Driver" <platform-driver-x86@vger.kernel.org>,
	acpi4asus-user <acpi4asus-user@lists.sourceforge.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux@endlessm.com,
	"João Paulo Rechi Vita" <jprvita@endlessm.com>
Subject: Re: [PATCH 1/1] asus-wireless: Use the correct HSWC parameter for each HID
Date: Wed, 8 Feb 2017 12:04:25 -0500	[thread overview]
Message-ID: <CA+A7VXWyth2ooHw2R4bjaoSR5Q49wgUBOXm6MNni=yigdYD_Xw@mail.gmail.com> (raw)
In-Reply-To: <CAHp75VdbxEWj_2Qhfe5KPr95dcPLqipN5J68iedAWfa5Eind=A@mail.gmail.com>

On 7 February 2017 at 18:37, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> On Tue, Feb 7, 2017 at 11:44 PM, João Paulo Rechi Vita
> <jprvita@gmail.com> wrote:
>> On 4 February 2017 at 10:02, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
>>> On Wed, Feb 1, 2017 at 2:20 PM, João Paulo Rechi Vita <jprvita@gmail.com> wrote:
>>>> On 27 January 2017 at 10:26, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
>>>>> On Thu, Jan 26, 2017 at 5:00 PM, João Paulo Rechi Vita
>>>>> <jprvita@gmail.com> wrote:
>>>
>>>>>> +static const struct acpi_device_id device_ids[] = {
>>>>>> +       {"ATK4001", 0},
>>>>>> +       {"ATK4002", 0},
>>>>>
>>>>> ...and use it as a parameter here.
>>>>>
>>>>
>>>> I'm not exactly sure how to do that, as driver_data is a
>>>> kernel_ulong_t. Can you please elaborate a bit more?
>>>
>>> {"ATK4001", (kernel_ulong_t)atk4001_id_params},
>>>
>>
>> The code you suggested:
>>
>> static const struct hswc_params atk4001_id_params = {0x0, 0x1, 0x2};
>> static const struct acpi_device_id device_ids[] = {
>>        {"ATK4001", (kernel_ulong_t)atk4001_id_params},
>>        {"", 0},
>> };
>>
>> does not compile: "drivers/platform/x86/asus-wireless.c:44:2: error:
>> aggregate value used where an integer was expected", so I guess you
>> meant the address of that struct (&atk4001_id_params), right? I don't
>> see any way how we could have the actual data in .driver_data.
>
> Yes, you are right. I kept in mind array when was suggesting this.
>
>> Even after moving the parameters in the driver_data field of
>> device_ids[], I'm not able retrieve them with acpi_match_device(),
>> because the "struct device" from the "struct acpi_device" that comes
>> as an input parameter in asus_wireless_add() does not have a acpi
>> companion device associated with it, so acpi_match_device() returns
>> NULL. I still need to manually loop through device_ids[] in order to
>> retrieve the .driver_data associated with the HID, and I see the same
>> pattern in the i2c-scmi driver.
>
> And what prevents us to set companion device?
>

Assuming this in the scope of a platform driver (genuine question, as
I don't see anything under drivers/platform/ doing so), nothing
prevents us to set it. But when doing so, acpi_match_device() still
fails, because acpi_get_first_physical_node() returns a different
"struct dev *" in acpi_primary_dev_companion().

--
João Paulo Rechi Vita
http://about.me/jprvita

      reply	other threads:[~2017-02-08 17:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-26 15:00 [PATCH 0/1] asus-wireless: Use the correct HSWC parameter for each HID João Paulo Rechi Vita
2017-01-26 15:00 ` [PATCH 1/1] " João Paulo Rechi Vita
2017-01-27 15:26   ` Andy Shevchenko
2017-02-01 12:20     ` João Paulo Rechi Vita
2017-02-01 12:20       ` João Paulo Rechi Vita
2017-02-04 15:02       ` Andy Shevchenko
2017-02-07 21:44         ` João Paulo Rechi Vita
2017-02-07 21:44           ` João Paulo Rechi Vita
2017-02-07 21:45           ` [PATCHv2] platform/x86: asus-wireless: Use per-HID HSWC parameters João Paulo Rechi Vita
2017-02-13 22:09             ` Andy Shevchenko
2017-02-07 23:37           ` [PATCH 1/1] asus-wireless: Use the correct HSWC parameter for each HID Andy Shevchenko
2017-02-08 17:04             ` João Paulo Rechi Vita [this message]

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='CA+A7VXWyth2ooHw2R4bjaoSR5Q49wgUBOXm6MNni=yigdYD_Xw@mail.gmail.com' \
    --to=jprvita@gmail.com \
    --cc=acpi4asus-user@lists.sourceforge.net \
    --cc=andy.shevchenko@gmail.com \
    --cc=dvhart@infradead.org \
    --cc=jprvita@endlessm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@endlessm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.