From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755641AbdBGXqu (ORCPT ); Tue, 7 Feb 2017 18:46:50 -0500 Received: from mail-qt0-f194.google.com ([209.85.216.194]:32886 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754735AbdBGXqp (ORCPT ); Tue, 7 Feb 2017 18:46:45 -0500 MIME-Version: 1.0 In-Reply-To: References: <20170126150031.11840-1-jprvita@endlessm.com> <20170126150031.11840-2-jprvita@endlessm.com> From: Andy Shevchenko Date: Wed, 8 Feb 2017 01:37:27 +0200 Message-ID: Subject: Re: [PATCH 1/1] asus-wireless: Use the correct HSWC parameter for each HID To: =?UTF-8?Q?Jo=C3=A3o_Paulo_Rechi_Vita?= Cc: Darren Hart , Platform Driver , acpi4asus-user , "linux-kernel@vger.kernel.org" , linux@endlessm.com, =?UTF-8?Q?Jo=C3=A3o_Paulo_Rechi_Vita?= Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v17Nl6m2000720 On Tue, Feb 7, 2017 at 11:44 PM, João Paulo Rechi Vita wrote: > On 4 February 2017 at 10:02, Andy Shevchenko wrote: >> On Wed, Feb 1, 2017 at 2:20 PM, João Paulo Rechi Vita wrote: >>> On 27 January 2017 at 10:26, Andy Shevchenko wrote: >>>> On Thu, Jan 26, 2017 at 5:00 PM, João Paulo Rechi Vita >>>> 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? > > I'm sending the next revision for feedback, please advise if I'm > missing any detail, or if you want this implemented differently. -- With Best Regards, Andy Shevchenko