Linux Input/HID development
 help / color / mirror / Atom feed
From: Jiri Kosina <jkosina@suse.cz>
To: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	rtitmuss@logitech.com, ogay@logitech.com,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Nestor Lopez Casado <nlopezcasad@logitech.com>
Subject: Re: [PATCH v4] HID: Add full support for Logitech Unifying receivers
Date: Sun, 11 Sep 2011 10:48:12 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LNX.2.00.1109111040370.13109@pobox.suse.cz> (raw)
In-Reply-To: <1315638713-3731-1-git-send-email-benjamin.tissoires@gmail.com>

On Sat, 10 Sep 2011, Benjamin Tissoires wrote:

> From: Nestor Lopez Casado <nlopezcasad@logitech.com>
> 
> From: Nestor Lopez Casado <nlopezcasad@logitech.com>
> 
> With this driver, all the devices paired to a single Unifying
> receiver are exposed to user processes in separated /input/dev
> nodes.
> 
> Keyboards with different layouts can be treated differently,
> Multiplayer games on single PC (like home theater PC) can
> differentiate input coming from different kbds paired to the
> same receiver.
> 
> Up to now, when Logitech Unifying receivers are connected to a
> Linux based system, a single keyboard and a single mouse are
> presented to the HID Layer, even if the Unifying receiver can
> pair up to six compatible devices. The Unifying receiver by default
> multiplexes all incoming events (from multiple keyboards/mice)
> into these two.
> 
> Signed-off-by: Nestor Lopez Casado <nlopezcasad@logitech.com>
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
> ---
> 
>  Hi guys,
> 
>  this is the v4 of the bus enumerator patch.
>  Since the v3:
>  - it corrects a kernel oops when starting gnome-panel (due to
>  a hid_report not given as a pointer in logi_dj_ll_input_event).
>  - I also added the function logi_dj_reset_resume to re-enable dj mode after
>  coming from suspend to disk in case usb has been shut off.
> 
>  Cheers,
>  Benjamin
> 
>  drivers/hid/Kconfig           |    9 +
>  drivers/hid/Makefile          |    1 +
>  drivers/hid/hid-core.c        |    2 +
>  drivers/hid/hid-ids.h         |    2 +
>  drivers/hid/hid-logitech-dj.c |  913 +++++++++++++++++++++++++++++++++++++++++
>  drivers/hid/hid-logitech-dj.h |  123 ++++++
>  6 files changed, 1050 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/hid/hid-logitech-dj.c
>  create mode 100644 drivers/hid/hid-logitech-dj.h
> 
[ ... snip ... ]
> diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
> new file mode 100644
> index 0000000..3963a99
> --- /dev/null
> +++ b/drivers/hid/hid-logitech-dj.c
> @@ -0,0 +1,913 @@
> +/*
> + *  HID driver for Logitech Unifying receivers
> + *
> + *  Copyright (c) 2011 Logitech (c)

What is this double (c) about? (it is also in other files).

> +/*
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> +
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
> + *
> + * Should you need to contact me, the author, you can do so by e-mail send
> + * your message to Nestor Lopez Casado <xnlopez at gmail com>

As the file is not copyrighted by a single person, but a company instead, 
perhaps this paragraph should rather be removed?

[ ... snip ... ]
> +static void logi_dj_recv_add_djhid_device(struct dj_receiver_dev *djrcv_dev,
> +					  struct dj_report *dj_report)
> +{
> +	/* Called in delayed work context */
> +	struct hid_device *djrcv_hdev = djrcv_dev->hdev;
> +	struct usb_interface *intf = to_usb_interface(djrcv_hdev->dev.parent);
> +	struct usb_device *usbdev = interface_to_usbdev(intf);
> +	struct hid_device *dj_hiddev;
> +	struct dj_device *dj_dev;
> +	unsigned char tmpstr[20];
> +
> +	if (dj_report->report_params[DEVICE_PAIRED_PARAM_SPFUNCTION] &
> +	    SPFUNCTION_DEVICE_LIST_EMPTY) {
> +		dbg_hid("%s: device list is empty\n", __func__);
> +		return;
> +	}
> +
> +	dj_hiddev = hid_allocate_device();
> +	if (IS_ERR(dj_hiddev)) {
> +		dev_err(&djrcv_hdev->dev, "%s: hid_allocate_device failed\n",
> +			__func__);
> +		return;
> +	}
> +
> +	dj_hiddev->ll_driver = &logi_dj_ll_driver;
> +	dj_hiddev->hid_output_raw_report = logi_dj_output_hidraw_report;
> +
> +	dj_hiddev->dev.parent = &djrcv_hdev->dev;
> +	dj_hiddev->bus = BUS_USB;
> +	dj_hiddev->vendor = le16_to_cpu(usbdev->descriptor.idVendor);
> +	dj_hiddev->product = le16_to_cpu(usbdev->descriptor.idProduct);
> +	snprintf(dj_hiddev->name, sizeof(dj_hiddev->name),
> +		"Logitech Unifying Device. Wireless PID:%02x%02x",
> +		dj_report->report_params[DEVICE_PAIRED_PARAM_EQUAD_ID_MSB],
> +		dj_report->report_params[DEVICE_PAIRED_PARAM_EQUAD_ID_LSB]);
> +
> +	usb_make_path(usbdev, dj_hiddev->phys, sizeof(dj_hiddev->phys));
> +	snprintf(tmpstr, sizeof(tmpstr), ":%d", dj_report->device_index);
> +	strlcat(dj_hiddev->phys, tmpstr, sizeof(dj_hiddev->phys));

Where does the guarantee of 20 chars being enough here come from, please?

Other than these minor things, I think the driver is ready to be merged. 
Thanks everyone for your work on this,

-- 
Jiri Kosina
SUSE Labs

  parent reply	other threads:[~2011-09-11  8:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1315638713-3731-1-git-send-email-benjamin.tissoires@gmail.com>
2011-09-10  7:28 ` [PATCH v4] HID: Add full support for Logitech Unifying receivers Markus Trippelsdorf
2011-09-11  8:39   ` Benjamin Tissoires
2011-09-14 16:45     ` Benjamin Tissoires
2011-09-14 17:00       ` Markus Trippelsdorf
2013-06-27 13:16       ` Logitech M705: Thumb button (was Re: [PATCH v4] HID: Add full support for Logitech Unifying receivers) Jiri Kosina
2013-07-03 10:46         ` Nestor Lopez Casado
2013-07-09 13:40           ` Benjamin Tissoires
2013-07-09 20:41             ` Jiri Kosina
2013-07-11 10:29               ` Benjamin Tissoires
2011-09-11  8:48 ` Jiri Kosina [this message]
2011-09-11 11:08   ` [PATCH v4] HID: Add full support for Logitech Unifying receivers Valdis.Kletnieks
2011-09-10  7:11 Benjamin Tissoires

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=alpine.LNX.2.00.1109111040370.13109@pobox.suse.cz \
    --to=jkosina@suse.cz \
    --cc=benjamin.tissoires@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nlopezcasad@logitech.com \
    --cc=ogay@logitech.com \
    --cc=rtitmuss@logitech.com \
    /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