Re: [PATCH] dvb-usb-af9035: load HID table
Hello Jaroslav Škarvada kirjoitti 2017-06-09 20:46: Automatically load sniffed HID table from Windows driver if USB_VID_ITETECH:USB_PID_ITETECH_IT9135_9006 device is present (e.g. Evolveo Mars) or if module parameter force_hid_tab_load is set. There is few issues I don't like this approach. Mostly that module parameter to select HID table. There is existing solution to select remote controller, it is ir-keytable and it should be used rather than defining device specific module parameter. If you look that HID table you could see there is 4 bytes NEC code and 3 bytes HID code. Remote controller seems to have 34 keys. Remote controller address bytes are 0x02bd, grepping existing remote controller keytables it could be Total Media In Hand remote controller (rc-total-media-in-hand.c). If not, then defining new keytable is needed. I did some research about issue and found 2 better solutions. 1) Configure HID table dynamically. Remote controller keytable has some needed information, but those KEY_* events needed to be translated to HID codes somehow. 2) Kill HID and then use CMD_IR_GET to get remote controller scancodes by polling. Solution 1 sounds most correct. No need to poll and decode by sw as hw does all the job. But it is most hardest to implement, I am not aware if anyone has done it yet. regards Antti -- http://palosaari.fi/
Re: [PATCH] dvb-usb-af9035: load HID table
Hi Jaroslav, [auto build test WARNING on linuxtv-media/master] [also build test WARNING on v4.12-rc4 next-20170609] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Jaroslav-karvada/dvb-usb-af9035-load-HID-table/20170611-142004 base: git://linuxtv.org/media_tree.git master config: xtensa-allmodconfig (attached as .config) compiler: xtensa-linux-gcc (GCC) 4.9.0 reproduce: wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree make.cross ARCH=xtensa All warnings (new ones prefixed by >>): drivers/media/usb/dvb-usb-v2/af9035.c: In function 'ite9135_load_hid_tab': >> drivers/media/usb/dvb-usb-v2/af9035.c:1955:1: warning: the frame size of >> 1936 bytes is larger than 1024 bytes [-Wframe-larger-than=] } ^ vim +1955 drivers/media/usb/dvb-usb-v2/af9035.c 1939 { 0x4b81, 0xeb }, 1940 { 0x4b82, 0x45 }, 1941 { 0x4b83, 0x03 }, 1942 { 0x4b84, 0x00 }, 1943 }; 1944 1945 for (i = 0; i < ARRAY_SIZE(hid_tab); i++) { 1946 ret = af9035_wr_reg(d, hid_tab[i].reg, hid_tab[i].val); 1947 if (ret < 0) 1948 goto err; 1949 } 1950 dev_info(&intf->dev, "HID table successfully loaded\n"); 1951 return 0; 1952 err: 1953 dev_info(&intf->dev, "loading HID table failed, item=%d, ret=%d\n", i, ret); 1954 return ret; > 1955 } 1956 1957 static int af9035_init(struct dvb_usb_device *d) 1958 { 1959 struct state *state = d_to_priv(d); 1960 struct usb_interface *intf = d->intf; 1961 int ret, i; 1962 u16 frame_size = (d->udev->speed == USB_SPEED_FULL ? 5 : 87) * 188 / 4; 1963 u8 packet_size = (d->udev->speed == USB_SPEED_FULL ? 64 : 512) / 4; --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
Re: [PATCH] dvb-usb-af9035: load HID table
- Original Message - > Hello > > Jaroslav Škarvada kirjoitti 2017-06-09 20:46: > > Automatically load sniffed HID table from Windows driver if > > USB_VID_ITETECH:USB_PID_ITETECH_IT9135_9006 device is present (e.g. > > Evolveo > > Mars) or if module parameter force_hid_tab_load is set. > > There is few issues I don't like this approach. Mostly that module > parameter to select HID table. There is existing solution to select > remote controller, it is ir-keytable and it should be used rather than > defining device specific module parameter. > > If you look that HID table you could see there is 4 bytes NEC code and 3 > bytes HID code. Remote controller seems to have 34 keys. Remote > controller address bytes are 0x02bd, grepping existing remote controller > keytables it could be Total Media In Hand remote controller > (rc-total-media-in-hand.c). If not, then defining new keytable is > needed. > > I did some research about issue and found 2 better solutions. > 1) Configure HID table dynamically. Remote controller keytable has some > needed information, but those KEY_* events needed to be translated to > HID codes somehow. > 2) Kill HID and then use CMD_IR_GET to get remote controller scancodes > by polling. > > Solution 1 sounds most correct. No need to poll and decode by sw as hw > does all the job. But it is most hardest to implement, I am not aware if > anyone has done it yet. > > regards > Antti > > > -- > http://palosaari.fi/ > Hi, thanks for info. General approach is usually better than device specific hacks, but it looks like longer run. Unfortunately I returned the device to the original owner, so I will be probably unable to help with it more. But the problem needs to be addressed, the state when the remote isn't working isn't good thanks & regards Jaroslav