LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Anton Chikin <Anton.Chikin@dataart.com>
To: Henrik Rydberg <rydberg@euromail.se>, Anton Chikin <kverlin@gmail.com>
Cc: "jkosina@suse.cz" <jkosina@suse.cz>,
"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Gregory Burmistrov <grig@dataart.com>
Subject: RE: [PATCH] HID: added new driver for Panasonic Elite Panaboard UB-T780 and UB-T880
Date: Tue, 8 Feb 2011 16:54:59 +0300 [thread overview]
Message-ID: <3BF066A8BAB61C43B779966CEE6D7FA09B6CC9DB38@e6.universe.dart.spb> (raw)
In-Reply-To: <20110208103923.GA2009@polaris.bitmath.org>
Hi Henrik,
Few words about usbhid_submit_report() usage, which seems to be wrong:
> +static int ubt880_switch_mode(struct hid_device *hid, unsigned char
> +mode) {
> + int rc = 0;
> +
> + struct hid_report *report = NULL;
> + struct hid_report *report_cur = NULL;
> + __s32 *val = NULL;
> + /** Packet forming */
> +
> + UBT_DUMMY_DEBUG
> +
> + list_for_each_entry(report, &hid->report_enum[HID_FEATURE_REPORT].report_list, list)
> + {
> + if (hid->report_enum[HID_FEATURE_REPORT].numbered) {
> + report_cur = report;
> + }
> + }
> +
> + if (report_cur == NULL) {
> + if (ubt_debug)
> + printk(KERN_DEBUG "ubt880 : switch mode : report_cur = 0");
> + return rc;
> + }
> +
> + if (ubt_debug)
> + printk(KERN_DEBUG "ubt880: switch mode: reportid = %d", report_cur->id);
> + val = report_cur->field[0]->value;
> +
> + switch (mode) {
> + case MODE_MOUSE: {
> + mode = 0x0;
> + break;
> + }
> + case MODE_SINGLETOUCH: {
> + mode = 0x01;
> + break;
> + }
> + case MODE_DGTZR: {
> + mode = 0x02;
> + break;
> + }
> + default: {
> + rc = -EIO;
> + return rc;
> + }
> + }
> + val[0] = mode;
> + UBT_DUMMY_DEBUG
> + if (ubt_debug)
> + printk(KERN_DEBUG "ubt880 :switch_mode: usbhid_submit_report drv=%p p=%p mode=%d", hid, report_cur, mode);
> + /*Send report to device*/
> +
> + usbhid_submit_report(hid, report_cur, USB_DIR_OUT);
> + UBT_DUMMY_DEBUG
> + return rc;
> +}
> There ought to be a function in hid to help you achieve this.
I thought so, but I can't find anything suitable. There are functions in usbhid to work with leds and nothing else.
On the other hand - Linux Cross Referencer reports heavy usage of usbhid_submit_report() in hid drivers.
With best regards,
Anton
next prev parent reply other threads:[~2011-02-08 13:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-08 9:36 Anton Chikin
2011-02-08 10:39 ` Henrik Rydberg
2011-02-08 12:28 ` Anton Chikin
2011-02-08 13:54 ` Anton Chikin [this message]
2011-02-08 18:12 ` Dmitry Torokhov
2011-02-09 11:40 ` Anton Chikin
-- strict thread matches above, loose matches on Subject: below --
2011-02-07 16:28 Anton Chikin
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=3BF066A8BAB61C43B779966CEE6D7FA09B6CC9DB38@e6.universe.dart.spb \
--to=anton.chikin@dataart.com \
--cc=grig@dataart.com \
--cc=jkosina@suse.cz \
--cc=kverlin@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rydberg@euromail.se \
--subject='RE: [PATCH] HID: added new driver for Panasonic Elite Panaboard UB-T780 and UB-T880' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).