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
--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" 
in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to