All of lore.kernel.org
 help / color / mirror / Atom feed
From: Darren Hart <dvhart@infradead.org>
To: "João Paulo Rechi Vita" <jprvita@gmail.com>,
	"Mousou Yuu" <guogaishiwo@gmail.com>
Cc: "Corentin Chary" <corentin.chary@gmail.com>,
	platform-driver-x86@vger.kernel.org,
	acpi4asus-user@lists.sourceforge.net,
	"João Paulo Rechi Vita" <jprvita@endlessm.com>
Subject: Re: [PATCH 1/4] platform/x86: Add Asus Wireless Radio Control driver
Date: Fri, 18 Dec 2015 23:23:24 -0800	[thread overview]
Message-ID: <20151219072324.GF7244@malice.jf.intel.com> (raw)
In-Reply-To: <1450193442-7930-2-git-send-email-jprvita@endlessm.com>

On Tue, Dec 15, 2015 at 10:30:39AM -0500, João Paulo Rechi Vita wrote:

...

> +static void asus_wrc_notify(struct acpi_device *device, u32 event)
> +{
> +	struct asus_wrc_data *data = acpi_driver_data(device);
> +
> +	pr_debug("event=0x%X\n", event);
> +
> +	if (!sparse_keymap_report_event(data->inputdev, event, 1, true))
> +		pr_info("Unknown ASHS event: 0x%X\n", event);
> +}
> +
> +static int asus_wrc_add(struct acpi_device *device)
> +{
> +	struct asus_wrc_data *data;
> +	int err = -ENOMEM;
> +
> +	pr_info(ASUS_WRC_MODULE_NAME"\n");
> +
> +	data = kzalloc(sizeof(struct asus_wrc_data), GFP_KERNEL);
> +	if (!data)
> +		return -ENOMEM;
> +
> +	data->inputdev = input_allocate_device();
> +	if (!data->inputdev)
> +		goto fail;
> +
> +	data->inputdev->name = "Asus Wireless Radio Control";
> +	data->inputdev->phys = "asus-wrc/input0";
> +	data->inputdev->id.bustype = BUS_HOST;
> +	data->inputdev->dev.parent = &device->dev;
> +	set_bit(EV_REP, data->inputdev->evbit);

The version Mousou includes some minor differences:

+	switch_dev->id.vendor = PCI_VENDOR_ID_ASUSTEK;

The vendor addition seems appropriate.

The rest appears to be a slightly more directly approach to a sparse keymap
which seems like overkill for a driver with a single key.

+	set_bit(EV_KEY, switch_dev->evbit);
+	set_bit(KEY_RFKILL, switch_dev->keybit);

Mousou's driver results in about 30 less lines as well. Please compare and see
if we might be able to merge the best of each version.

-- 
Darren Hart
Intel Open Source Technology Center

  parent reply	other threads:[~2015-12-19  7:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-15 15:30 [RFC 0/4] Asus Wireless Radio Control driver João Paulo Rechi Vita
2015-12-15 15:30 ` [PATCH 1/4] platform/x86: Add " João Paulo Rechi Vita
2015-12-19  6:39   ` Darren Hart
     [not found]     ` <CA+A7VXWGTAsen2V29ifJ9nGCuHRnQnZi=Q_oEi1fkmeo=t1gxQ@mail.gmail.com>
2015-12-20 16:58       ` João Paulo Rechi Vita
2015-12-19  7:23   ` Darren Hart [this message]
     [not found]     ` <CA+A7VXU9MepWmWL6BS+XyjbLs2s_ONR5Yy3tqT--cbYS7p1P1Q@mail.gmail.com>
2015-12-20 17:00       ` João Paulo Rechi Vita
2015-12-15 15:30 ` [PATCH 2/4] asus-wrc: Add ACPI HID ATK4001 João Paulo Rechi Vita
2015-12-19  6:40   ` Darren Hart
2015-12-20 18:57     ` João Paulo Rechi Vita
2015-12-15 15:30 ` [PATCH 3/4] net/rfkill: Create "airplane mode" LED trigger João Paulo Rechi Vita
2015-12-19  0:22   ` Darren Hart
2015-12-19  0:36     ` João Paulo Rechi Vita
2015-12-19  2:25     ` David Miller
2015-12-15 15:30 ` [PATCH 4/4] asus-wrc: Toggle airplane mode LED João Paulo Rechi Vita
2015-12-19  8:00 ` [RFC 0/4] Asus Wireless Radio Control driver Darren Hart
2015-12-20 19:01   ` João Paulo Rechi Vita
2015-12-26 14:56 [RFCv2 " João Paulo Rechi Vita
2015-12-26 14:56 ` [PATCH 1/4] platform/x86: Add " João Paulo Rechi Vita
2015-12-27 13:21   ` Andy Shevchenko
2016-01-05 13:25     ` João Paulo Rechi Vita

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=20151219072324.GF7244@malice.jf.intel.com \
    --to=dvhart@infradead.org \
    --cc=acpi4asus-user@lists.sourceforge.net \
    --cc=corentin.chary@gmail.com \
    --cc=guogaishiwo@gmail.com \
    --cc=jprvita@endlessm.com \
    --cc=jprvita@gmail.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.