Skip to contentSkip to conversation

saa7134: Add support for SnaZio TvPVR PRO

PATCH In review POJAR GEORGE 4 participants 6 messages Feb 9, 2014 – Mar 11, 2014

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 saa7134: Add support for SnaZio TvPVR PRO

From: POJAR GEORGE <[email protected]>

---
 Documentation/video4linux/CARDLIST.saa7134     |   1 +
 drivers/media/pci/saa7134/saa7134-cards.c      |  51 ++++++++++-
 drivers/media/pci/saa7134/saa7134-input.c      |  62 +++++++++++++
 drivers/media/pci/saa7134/saa7134.h            |   1 +
 drivers/media/rc/keymaps/Makefile              |   1 +
 drivers/media/rc/keymaps/rc-snazio-tvpvr-pro.c | 116 +++++++++++++++++++++++++
 include/media/rc-map.h                         |   1 +
 7 files changed, 232 insertions(+), 1 deletion(-)
 create mode 100644 drivers/media/rc/keymaps/rc-snazio-tvpvr-pro.c
Documentation/video4linux/CARDLIST.saa7134 +1 -0
index 8df17d0..32e4353 100644
@@ -191,3 +191,4 @@
 190 -> Asus My Cinema PS3-100                   [1043:48cd]
 191 -> Hawell HW-9004V1
 192 -> AverMedia AverTV Satellite Hybrid+FM A706 [1461:2055]
+193 -> SnaZio TvPVR PRO                         [0x1779:0x13cf,0x1779:0x13d0,0x1779:0x13d1]
drivers/media/pci/saa7134/saa7134-cards.c +50 -1

69 lines not on this page · raw message

drivers/media/pci/saa7134/saa7134-input.c +62 -0

74 lines not on this page · raw message

drivers/media/pci/saa7134/saa7134.h +1 -0
index 2474e84..28b083f 100644
@@ -338,6 +338,7 @@ struct saa7134_card_ir {
 #define SAA7134_BOARD_ASUSTeK_PS3_100      190
 #define SAA7134_BOARD_HAWELL_HW_9004V1      191
 #define SAA7134_BOARD_AVERMEDIA_A706		192
+#define SAA7134_BOARD_SNAZIO_TVPVR_PRO      193
 
 #define SAA7134_MAXBOARDS 32
 #define SAA7134_INPUT_MAX 8
drivers/media/rc/keymaps/Makefile +1 -0
index 0b8c549..72b2e45 100644
@@ -81,6 +81,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \
 			rc-real-audio-220-32-keys.o \
 			rc-reddo.o \
 			rc-snapstream-firefly.o \
+			rc-snazio-tvpvr-pro.o \
 			rc-streamzap.o \
 			rc-tbs-nec.o \
 			rc-technisat-usb2.o \
drivers/media/rc/keymaps/rc-snazio-tvpvr-pro.c new file +116 -0

116 lines not on this page · raw message

include/media/rc-map.h +1 -0
index e5aa240..b802af4 100644
@@ -177,6 +177,7 @@ void rc_map_init(void);
 #define RC_MAP_REAL_AUDIO_220_32_KEYS    "rc-real-audio-220-32-keys"
 #define RC_MAP_REDDO                     "rc-reddo"
 #define RC_MAP_SNAPSTREAM_FIREFLY        "rc-snapstream-firefly"
+#define RC_MAP_SNAZIO_TVPVR_PRO          "rc-snazio-tvpvr-pro"
 #define RC_MAP_STREAMZAP                 "rc-streamzap"
 #define RC_MAP_TBS_NEC                   "rc-tbs-nec"
 #define RC_MAP_TECHNISAT_USB2            "rc-technisat-usb2"
Signature · 1 line
1.9.rc1
#1 lore raw

I will like some proof that you have the hardware working: dmesg, and printscreen.
like this: http://imgur.com/KNrfsmv

Quoted 344 lines · POJAR GEORGE

From: POJAR GEORGE <[email protected]>

---
 Documentation/video4linux/CARDLIST.saa7134     |   1 +
 drivers/media/pci/saa7134/saa7134-cards.c      |  51 ++++++++++-
 drivers/media/pci/saa7134/saa7134-input.c      |  62 +++++++++++++
 drivers/media/pci/saa7134/saa7134.h            |   1 +
 drivers/media/rc/keymaps/Makefile              |   1 +
 drivers/media/rc/keymaps/rc-snazio-tvpvr-pro.c | 116 +++++++++++++++++++++++++
 include/media/rc-map.h                         |   1 +
 7 files changed, 232 insertions(+), 1 deletion(-)
 create mode 100644 drivers/media/rc/keymaps/rc-snazio-tvpvr-pro.c
Documentation/video4linux/CARDLIST.saa7134 +1 -0
index 8df17d0..32e4353 100644
@@ -191,3 +191,4 @@
 190 -> Asus My Cinema PS3-100                   [1043:48cd]
 191 -> Hawell HW-9004V1
 192 -> AverMedia AverTV Satellite Hybrid+FM A706 [1461:2055]
+193 -> SnaZio TvPVR PRO                         [0x1779:0x13cf,0x1779:0x13d0,0x1779:0x13d1]
drivers/media/pci/saa7134/saa7134-cards.c +50 -1
index d45e7f6..3476785 100644
@@ -5827,7 +5827,37 @@ struct saa7134_board saa7134_boards[] = {
                        .gpio = 0x0000800,
                },
        },
-
+       [SAA7134_BOARD_SNAZIO_TVPVR_PRO] = {
+               .name           = "SnaZio TvPVR PRO",
+               .audio_clock    = 0x00187de7,
+               .tuner_type     = TUNER_PHILIPS_TDA8290,
+               .radio_type     = UNSET,
+               .tuner_addr     = ADDR_UNSET,
+               .radio_addr     = ADDR_UNSET,
+               .gpiomask       = 1 << 21,
+               .inputs         = {{
+                       .name = name_tv,
+                       .vmux = 1,
+                       .amux = TV,
+                       .gpio = 0x0000000,
+                       .tv   = 1,
+               }, {
+                       .name = name_comp1,     /* Composite input */
+                       .vmux = 3,
+                       .amux = LINE2,
+                       .gpio = 0x0000000,
+               }, {
+                       .name = name_svideo,    /* S-Video input */
+                       .vmux = 8,
+                       .amux = LINE2,
+                       .gpio = 0x0000000,
+               } },
+               .radio = {
+                       .name = name_radio,
+                       .amux = TV,
+                       .gpio = 0x0200000,
+               },
+       },
 };
 
 const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards);
@@ -7080,6 +7110,24 @@ struct pci_device_id saa7134_pci_tbl[] = {
                .subdevice    = 0x2055, /* AverTV Satellite Hybrid+FM A706 */
                .driver_data  = SAA7134_BOARD_AVERMEDIA_A706,
        }, {
+               .vendor       = PCI_VENDOR_ID_PHILIPS,
+               .device       = PCI_DEVICE_ID_PHILIPS_SAA7133,
+               .subvendor    = 0x1779,
+               .subdevice    = 0x13cf,
+               .driver_data  = SAA7134_BOARD_SNAZIO_TVPVR_PRO,
+       }, {
+               .vendor       = PCI_VENDOR_ID_PHILIPS,
+               .device       = PCI_DEVICE_ID_PHILIPS_SAA7133,
+               .subvendor    = 0x1779,
+               .subdevice    = 0x13d0,
+               .driver_data  = SAA7134_BOARD_SNAZIO_TVPVR_PRO,
+       }, {
+               .vendor       = PCI_VENDOR_ID_PHILIPS,
+               .device       = PCI_DEVICE_ID_PHILIPS_SAA7133,
+               .subvendor    = 0x1779,
+               .subdevice    = 0x13d1,
+               .driver_data  = SAA7134_BOARD_SNAZIO_TVPVR_PRO,
+       }, {
                /* --- boards without eeprom + subsystem ID --- */
                .vendor       = PCI_VENDOR_ID_PHILIPS,
                .device       = PCI_DEVICE_ID_PHILIPS_SAA7134,
@@ -7608,6 +7656,7 @@ int saa7134_board_init1(struct saa7134_dev *dev)
        case SAA7134_BOARD_BEHOLD_H7:
        case SAA7134_BOARD_BEHOLD_A7:
        case SAA7134_BOARD_KWORLD_PC150U:
+       case SAA7134_BOARD_SNAZIO_TVPVR_PRO:
                dev->has_remote = SAA7134_REMOTE_I2C;
                break;
        case SAA7134_BOARD_AVERMEDIA_A169_B:
drivers/media/pci/saa7134/saa7134-input.c +62 -0
index 6f43126..62ccc7d 100644
@@ -416,6 +416,53 @@ static int get_key_pinnacle_color(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
        return get_key_pinnacle(ir, ir_key, ir_raw, 2, 0x80, 0x88);
 }
 
+/* copied and modified from get_key_msi_tvanywhere_plus() */
+static int get_key_snazio_tvpvr_pro(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
+{
+       unsigned char b;
+       unsigned int gpio;
+
+       /* <dev> is needed to access GPIO. Used by the saa_readl macro. */
+       struct saa7134_dev *dev = ir->c->adapter->algo_data;
+       if (dev == NULL) {
+               i2cdprintk("get_key_snazio_tvpvr_pro: "
+                          "ir->c->adapter->algo_data is NULL!\n");
+               return -EIO;
+       }
+
+       /* rising SAA7134_GPIO_GPRESCAN reads the status */
+
+       saa_clearb(SAA7134_GPIO_GPMODE3, SAA7134_GPIO_GPRESCAN);
+       saa_setb(SAA7134_GPIO_GPMODE3, SAA7134_GPIO_GPRESCAN);
+
+       gpio = saa_readl(SAA7134_GPIO_GPSTATUS0 >> 2);
+
+       /* GPIO&0x100 is pulsed low when a button is pressed. Don't do
+          I2C receive if gpio&0x100 is not low. */
+
+       if (gpio & 0x100)
+               return 0;       /* No button press */
+
+       /* GPIO says there is a button press. Get it. */
+
+       if (1 != i2c_master_recv(ir->c, &b, 1)) {
+               i2cdprintk("read error\n");
+               return -EIO;
+       }
+
+       /* No button press */
+
+       if (b == 0xff)
+               return 0;
+
+       /* Button pressed */
+
+       dprintk("get_key_snazio_tvpvr_pro: Key = 0x%02X\n", b);
+       *ir_key = b;
+       *ir_raw = b;
+       return 1;
+}
+
 void saa7134_input_irq(struct saa7134_dev *dev)
 {
        struct saa7134_card_ir *ir;
@@ -1006,6 +1053,21 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
                dev->init_data.ir_codes = RC_MAP_FLYDVB;
                info.addr = 0x0b;
                break;
+       case SAA7134_BOARD_SNAZIO_TVPVR_PRO:
+               /* copied and modified from MSI TV@nywhere Plus */
+               dev->init_data.name = "SnaZio TvPVR PRO";
+               dev->init_data.get_key = get_key_snazio_tvpvr_pro;
+               dev->init_data.ir_codes = RC_MAP_SNAZIO_TVPVR_PRO;
+               info.addr = 0x30;
+               /* MSI TV@nywhere Plus controller doesn't seem to
+                  respond to probes unless we read something from
+                  an existing device. Weird...
+                  REVISIT: might no longer be needed */
+               rc = i2c_transfer(&dev->i2c_adap, &msg_msi, 1);
+               dprintk("probe 0x%02x @ %s: %s\n",
+                       msg_msi.addr, dev->i2c_adap.name,
+                       (1 == rc) ? "yes" : "no");
+               break;
        default:
                dprintk("No I2C IR support for board %x\n", dev->board);
                return;
drivers/media/pci/saa7134/saa7134.h +1 -0
index 2474e84..28b083f 100644
@@ -338,6 +338,7 @@ struct saa7134_card_ir {
 #define SAA7134_BOARD_ASUSTeK_PS3_100      190
 #define SAA7134_BOARD_HAWELL_HW_9004V1      191
 #define SAA7134_BOARD_AVERMEDIA_A706           192
+#define SAA7134_BOARD_SNAZIO_TVPVR_PRO      193
 
 #define SAA7134_MAXBOARDS 32
 #define SAA7134_INPUT_MAX 8
drivers/media/rc/keymaps/Makefile +1 -0
index 0b8c549..72b2e45 100644
@@ -81,6 +81,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \
                        rc-real-audio-220-32-keys.o \
                        rc-reddo.o \
                        rc-snapstream-firefly.o \
+                       rc-snazio-tvpvr-pro.o \
                        rc-streamzap.o \
                        rc-tbs-nec.o \
                        rc-technisat-usb2.o \
drivers/media/rc/keymaps/rc-snazio-tvpvr-pro.c new file +116 -0
new file mode 100644
index 0000000..127350e
@@ -0,0 +1,116 @@
+/* rc-snazio-tvpvr-pro.h - Keytable for snazio_tvpvr_pro Remote Controller
+ *
+ * keymap imported from ir-keymaps.c
+ *
+ * Copyright (c) 2010 by Mauro Carvalho Chehab
+ * Copyright (c) 2010 by POJAR GEORGE <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <media/rc-map.h>
+#include <linux/module.h>
+
+/*
+  Keycodes for remote on the SnaZio TvPVR PRO.
+  POJAR GEORGE <[email protected]>
+*/
+
+static struct rc_map_table snazio_tvpvr_pro[] = {
+
+/*  ---- Remote Button Layout ----
+
+    POWER   SOURCE  SCAN    MUTE
+    TV/FM   1       2       3
+    |>      4       5       6
+    <|      7       8       9
+    ^^UP    0       +       RECALL
+    vvDN    RECORD  STOP    PLAY
+
+       MINIMIZE          ZOOM
+
+                 CH+
+      VOL-                   VOL+
+                 CH-
+
+       SNAPSHOT           MTS
+
+     <<      FUNC    >>     RESET
+*/
+
+       { 0x01, KEY_1 },                /* 1 */
+       { 0x0b, KEY_2 },                /* 2 */
+       { 0x1b, KEY_3 },                /* 3 */
+       { 0x05, KEY_4 },                /* 4 */
+       { 0x09, KEY_5 },                /* 5 */
+       { 0x15, KEY_6 },                /* 6 */
+       { 0x06, KEY_7 },                /* 7 */
+       { 0x0a, KEY_8 },                /* 8 */
+       { 0x12, KEY_9 },                /* 9 */
+       { 0x02, KEY_0 },                /* 0 */
+       { 0x10, KEY_KPPLUS },           /* + */
+       { 0x13, KEY_AGAIN },            /* Recall */
+
+       { 0x1e, KEY_POWER },            /* Power */
+       { 0x07, KEY_VIDEO },            /* Source */
+       { 0x1c, KEY_SEARCH },           /* Scan */
+       { 0x18, KEY_MUTE },             /* Mute */
+
+       { 0x03, KEY_RADIO },            /* TV/FM */
+       /* The next four keys are duplicates that appear to send the
+          same IR code as Ch+, Ch-, >>, and << .  The raw code assigned
+          to them is the actual code + 0x20 - they will never be
+          detected as such unless some way is discovered to distinguish
+          these buttons from those that have the same code. */
+       { 0x3f, KEY_RIGHT },            /* |> and Ch+ */
+       { 0x37, KEY_LEFT },             /* <| and Ch- */
+       { 0x2c, KEY_UP },               /* ^^Up and >> */
+       { 0x24, KEY_DOWN },             /* vvDn and << */
+
+       { 0x00, KEY_RECORD },           /* Record */
+       { 0x08, KEY_STOP },             /* Stop */
+       { 0x11, KEY_PLAY },             /* Play */
+
+       { 0x0f, KEY_CLOSE },            /* Minimize */
+       { 0x19, KEY_ZOOM },             /* Zoom */
+       { 0x1a, KEY_CAMERA },           /* Snapshot */
+       { 0x0d, KEY_LANGUAGE },         /* MTS */
+
+       { 0x14, KEY_VOLUMEDOWN },       /* Vol- */
+       { 0x16, KEY_VOLUMEUP },         /* Vol+ */
+       { 0x17, KEY_CHANNELDOWN },      /* Ch- */
+       { 0x1f, KEY_CHANNELUP },        /* Ch+ */
+
+       { 0x04, KEY_REWIND },           /* << */
+       { 0x0e, KEY_MENU },             /* Function */
+       { 0x0c, KEY_FASTFORWARD },      /* >> */
+       { 0x1d, KEY_RESTART },          /* Reset */
+};
+
+static struct rc_map_list snazio_tvpvr_pro_map = {
+       .map = {
+               .scan    = snazio_tvpvr_pro,
+               .size    = ARRAY_SIZE(snazio_tvpvr_pro),
+               .rc_type = RC_TYPE_UNKNOWN,     /* Legacy IR type */
+               .name    = RC_MAP_SNAZIO_TVPVR_PRO,
+       }
+};
+
+static int int __init init_rc_map_snazio_tvpvr_pro(void)
+{
+       return rc_map_register(&snazio_tvpvr_pro_map);
+}
+
+static void __exit exit_rc_map_snazio_tvpvr_pro(void)
+{
+       rc_map_unregister(&snazio_tvpvr_pro_map);
+}
+
+module_init(init_rc_map_snazio_tvpvr_pro)
+module_exit(exit_rc_map_snazio_tvpvr_pro)
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("POJAR GEORGE <[email protected]>");
include/media/rc-map.h +1 -1
index e5aa240..b802af4 100644
@@ -177,6 +177,7 @@ void rc_map_init(void);
 #define RC_MAP_REAL_AUDIO_220_32_KEYS    "rc-real-audio-220-32-keys"
 #define RC_MAP_REDDO                     "rc-reddo"
 #define RC_MAP_SNAPSTREAM_FIREFLY        "rc-snapstream-firefly"
+#define RC_MAP_SNAZIO_TVPVR_PRO          "rc-snazio-tvpvr-pro"
 #define RC_MAP_STREAMZAP                 "rc-streamzap"
 #define RC_MAP_TBS_NEC                   "rc-tbs-nec"
 #define RC_MAP_TECHNISAT_USB2            "rc-technisat-usb2"
--

1.9.rc1

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#2 lore raw

git clone git://linuxtv.org/media_build.git
cd media_build
make -C linux/ download
make -C linux/ untar

git send-email --to "[email protected]" 0001-Adding-debugging-level-for-printk.patch

V One Multimedia Pte Ltd

The hardware working:

Tested:
TV: http://imgur.com/Kz37m9e
RADIO: http://imgur.com/Y8p7caM
REMOTE: http://imgur.com/FpC3u1c
ALSA: http://imgur.com/1co2JF1

I do not know how to add PCI vendor id for this card:
"V One Multimedia Limited" to be printed in "lspci -vnn" command"

Subsystem: V One Multimedia Limited [1779:13cf]

now show up:

Subsystem: Device [1779:13cf]

I changed the first patch, reason: there is an error in the line (double "int" typed):

"static int int __init init_rc_map_snazio_tvpvr_pro(void)":

From 90db67edcae832d68006a8bae7c9856bf87de071 Mon Sep 17 00:00:00 2001
From: POJAR GEORGE <[email protected]>
Date: Sun, 9 Feb 2014 21:25:55 +0200
Subject: [PATCH] saa7134: Add support for SnaZio TvPVR PRO

---
 Documentation/video4linux/CARDLIST.saa7134     |   1 +
 drivers/media/pci/saa7134/saa7134-cards.c      |  51 ++++++++++-
 drivers/media/pci/saa7134/saa7134-input.c      |  62 +++++++++++++
 drivers/media/pci/saa7134/saa7134.h            |   1 +
 drivers/media/rc/keymaps/Makefile              |   1 +
 drivers/media/rc/keymaps/rc-snazio-tvpvr-pro.c | 116 
+++++++++++++++++++++++++
 include/media/rc-map.h                         |   1 +
 7 files changed, 232 insertions(+), 1 deletion(-)
 create mode 100644 drivers/media/rc/keymaps/rc-snazio-tvpvr-pro.c
Documentation/video4linux/CARDLIST.saa7134 +1 -0
index 8df17d0..32e4353 100644
@@ -191,3 +191,4 @@
 190 -> Asus My Cinema PS3-100                   [1043:48cd]
 191 -> Hawell HW-9004V1
 192 -> AverMedia AverTV Satellite Hybrid+FM A706 [1461:2055]
+193 -> SnaZio TvPVR PRO [0x1779:0x13cf,0x1779:0x13d0,0x1779:0x13d1]
drivers/media/pci/saa7134/saa7134-cards.c +50 -1

69 lines not on this page · raw message

drivers/media/pci/saa7134/saa7134-input.c +62 -0

74 lines not on this page · raw message

drivers/media/pci/saa7134/saa7134.h +1 -0
index 2474e84..28b083f 100644
@@ -338,6 +338,7 @@ struct saa7134_card_ir {
 #define SAA7134_BOARD_ASUSTeK_PS3_100      190
 #define SAA7134_BOARD_HAWELL_HW_9004V1      191
 #define SAA7134_BOARD_AVERMEDIA_A706        192
+#define SAA7134_BOARD_SNAZIO_TVPVR_PRO      193
 
 #define SAA7134_MAXBOARDS 32
 #define SAA7134_INPUT_MAX 8
drivers/media/rc/keymaps/Makefile +1 -0
index 0b8c549..72b2e45 100644
@@ -81,6 +81,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \
             rc-real-audio-220-32-keys.o \
             rc-reddo.o \
             rc-snapstream-firefly.o \
+            rc-snazio-tvpvr-pro.o \
             rc-streamzap.o \
             rc-tbs-nec.o \
             rc-technisat-usb2.o \
drivers/media/rc/keymaps/rc-snazio-tvpvr-pro.c new file +116 -0

116 lines not on this page · raw message

include/media/rc-map.h +1 -0
index e5aa240..b802af4 100644
@@ -177,6 +177,7 @@ void rc_map_init(void);
 #define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys"
 #define RC_MAP_REDDO                     "rc-reddo"
 #define RC_MAP_SNAPSTREAM_FIREFLY        "rc-snapstream-firefly"
+#define RC_MAP_SNAZIO_TVPVR_PRO          "rc-snazio-tvpvr-pro"
 #define RC_MAP_STREAMZAP                 "rc-streamzap"
 #define RC_MAP_TBS_NEC                   "rc-tbs-nec"
 #define RC_MAP_TECHNISAT_USB2            "rc-technisat-usb2"
Signature · 1 line
1.9.rc1
Quoted 1 line · Anca Emanuel

the hardware working:

author
#3 lore raw

Screenshot with lspci -vnn output:
http://imgur.com/RnKkQCj

Quoted 376 lines · GEORGE

git clone git://linuxtv.org/media_build.git
cd media_build
make -C linux/ download
make -C linux/ untar

git send-email --to "[email protected]" 0001-Adding-debugging-level-for-printk.patch

V One Multimedia Pte Ltd

The hardware working:

Tested:
TV: http://imgur.com/Kz37m9e
RADIO: http://imgur.com/Y8p7caM
REMOTE: http://imgur.com/FpC3u1c
ALSA: http://imgur.com/1co2JF1

I do not know how to add PCI vendor id for this card:
"V One Multimedia Limited" to be printed in "lspci -vnn" command"

Subsystem: V One Multimedia Limited [1779:13cf]

now show up:

Subsystem: Device [1779:13cf]

I changed the first patch, reason: there is an error in the line (double "int" typed):

"static int int __init init_rc_map_snazio_tvpvr_pro(void)":

From 90db67edcae832d68006a8bae7c9856bf87de071 Mon Sep 17 00:00:00 2001
From: POJAR GEORGE <[email protected]>
Date: Sun, 9 Feb 2014 21:25:55 +0200
Subject: [PATCH] saa7134: Add support for SnaZio TvPVR PRO

---
 Documentation/video4linux/CARDLIST.saa7134     |   1 +
 drivers/media/pci/saa7134/saa7134-cards.c      |  51 ++++++++++-
 drivers/media/pci/saa7134/saa7134-input.c      |  62 +++++++++++++
 drivers/media/pci/saa7134/saa7134.h            |   1 +
 drivers/media/rc/keymaps/Makefile              |   1 +
 drivers/media/rc/keymaps/rc-snazio-tvpvr-pro.c | 116 
+++++++++++++++++++++++++
 include/media/rc-map.h                         |   1 +
 7 files changed, 232 insertions(+), 1 deletion(-)
 create mode 100644 drivers/media/rc/keymaps/rc-snazio-tvpvr-pro.c
Documentation/video4linux/CARDLIST.saa7134 +1 -0
index 8df17d0..32e4353 100644
@@ -191,3 +191,4 @@
 190 -> Asus My Cinema PS3-100                   [1043:48cd]
 191 -> Hawell HW-9004V1
 192 -> AverMedia AverTV Satellite Hybrid+FM A706 [1461:2055]
+193 -> SnaZio TvPVR PRO [0x1779:0x13cf,0x1779:0x13d0,0x1779:0x13d1]
drivers/media/pci/saa7134/saa7134-cards.c +50 -1
index d45e7f6..3476785 100644
@@ -5827,7 +5827,37 @@ struct saa7134_board saa7134_boards[] = {
             .gpio = 0x0000800,
         },
     },
-
+    [SAA7134_BOARD_SNAZIO_TVPVR_PRO] = {
+        .name           = "SnaZio TvPVR PRO",
+        .audio_clock    = 0x00187de7,
+        .tuner_type     = TUNER_PHILIPS_TDA8290,
+        .radio_type     = UNSET,
+        .tuner_addr     = ADDR_UNSET,
+        .radio_addr     = ADDR_UNSET,
+        .gpiomask       = 1 << 21,
+        .inputs         = {{
+            .name = name_tv,
+            .vmux = 1,
+            .amux = TV,
+            .gpio = 0x0000000,
+            .tv   = 1,
+        }, {
+            .name = name_comp1,     /* Composite input */
+            .vmux = 3,
+            .amux = LINE2,
+            .gpio = 0x0000000,
+        }, {
+            .name = name_svideo,    /* S-Video input */
+            .vmux = 8,
+            .amux = LINE2,
+            .gpio = 0x0000000,
+        } },
+        .radio = {
+            .name = name_radio,
+            .amux = TV,
+            .gpio = 0x0200000,
+        },
+    },
 };
 
 const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards);
@@ -7080,6 +7110,24 @@ struct pci_device_id saa7134_pci_tbl[] = {
         .subdevice    = 0x2055, /* AverTV Satellite Hybrid+FM A706 */
         .driver_data  = SAA7134_BOARD_AVERMEDIA_A706,
     }, {
+        .vendor       = PCI_VENDOR_ID_PHILIPS,
+        .device       = PCI_DEVICE_ID_PHILIPS_SAA7133,
+        .subvendor    = 0x1779,
+        .subdevice    = 0x13cf,
+        .driver_data  = SAA7134_BOARD_SNAZIO_TVPVR_PRO,
+    }, {
+        .vendor       = PCI_VENDOR_ID_PHILIPS,
+        .device       = PCI_DEVICE_ID_PHILIPS_SAA7133,
+        .subvendor    = 0x1779,
+        .subdevice    = 0x13d0,
+        .driver_data  = SAA7134_BOARD_SNAZIO_TVPVR_PRO,
+    }, {
+        .vendor       = PCI_VENDOR_ID_PHILIPS,
+        .device       = PCI_DEVICE_ID_PHILIPS_SAA7133,
+        .subvendor    = 0x1779,
+        .subdevice    = 0x13d1,
+        .driver_data  = SAA7134_BOARD_SNAZIO_TVPVR_PRO,
+    }, {
         /* --- boards without eeprom + subsystem ID --- */
         .vendor       = PCI_VENDOR_ID_PHILIPS,
         .device       = PCI_DEVICE_ID_PHILIPS_SAA7134,
@@ -7608,6 +7656,7 @@ int saa7134_board_init1(struct saa7134_dev *dev)
     case SAA7134_BOARD_BEHOLD_H7:
     case SAA7134_BOARD_BEHOLD_A7:
     case SAA7134_BOARD_KWORLD_PC150U:
+    case SAA7134_BOARD_SNAZIO_TVPVR_PRO:
         dev->has_remote = SAA7134_REMOTE_I2C;
         break;
     case SAA7134_BOARD_AVERMEDIA_A169_B:
drivers/media/pci/saa7134/saa7134-input.c +47 -0
index 6f43126..62ccc7d 100644
@@ -416,6 +416,53 @@ static int get_key_pinnacle_color(struct IR_i2c 
 *ir, u32 *ir_key, u32 *ir_raw)
     return get_key_pinnacle(ir, ir_key, ir_raw, 2, 0x80, 0x88);
 }
 
+/* copied and modified from get_key_msi_tvanywhere_plus() */
+static int get_key_snazio_tvpvr_pro(struct IR_i2c *ir, u32 *ir_key, 
 u32 *ir_raw)
+{
+    unsigned char b;
+    unsigned int gpio;
+
+    /* <dev> is needed to access GPIO. Used by the saa_readl macro. */
+    struct saa7134_dev *dev = ir->c->adapter->algo_data;
+    if (dev == NULL) {
+        i2cdprintk("get_key_snazio_tvpvr_pro: "
+               "ir->c->adapter->algo_data is NULL!\n");
+        return -EIO;
+    }
+
+    /* rising SAA7134_GPIO_GPRESCAN reads the status */
+
+    saa_clearb(SAA7134_GPIO_GPMODE3, SAA7134_GPIO_GPRESCAN);
+    saa_setb(SAA7134_GPIO_GPMODE3, SAA7134_GPIO_GPRESCAN);
+
+    gpio = saa_readl(SAA7134_GPIO_GPSTATUS0 >> 2);
+
+    /* GPIO&0x100 is pulsed low when a button is pressed. Don't do
+       I2C receive if gpio&0x100 is not low. */
+
+    if (gpio & 0x100)
+        return 0;       /* No button press */
+
+    /* GPIO says there is a button press. Get it. */
+
+    if (1 != i2c_master_recv(ir->c, &b, 1)) {
+        i2cdprintk("read error\n");
+        return -EIO;
+    }
+
+    /* No button press */
+
+    if (b == 0xff)
+        return 0;
+
+    /* Button pressed */
+
+    dprintk("get_key_snazio_tvpvr_pro: Key = 0x%02X\n", b);
+    *ir_key = b;
+    *ir_raw = b;
+    return 1;
+}
+
 void saa7134_input_irq(struct saa7134_dev *dev)
 {
     struct saa7134_card_ir *ir;
drivers/media/pci/saa7134/saa7134-input.c +15 -0
@@ -1006,6 +1053,21 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
         dev->init_data.ir_codes = RC_MAP_FLYDVB;
         info.addr = 0x0b;
         break;
+    case SAA7134_BOARD_SNAZIO_TVPVR_PRO:
+        /* copied and modified from MSI TV@nywhere Plus */
+        dev->init_data.name = "SnaZio TvPVR PRO";
+        dev->init_data.get_key = get_key_snazio_tvpvr_pro;
+        dev->init_data.ir_codes = RC_MAP_SNAZIO_TVPVR_PRO;
+        info.addr = 0x30;
+        /* MSI TV@nywhere Plus controller doesn't seem to
+           respond to probes unless we read something from
+           an existing device. Weird...
+           REVISIT: might no longer be needed */
+        rc = i2c_transfer(&dev->i2c_adap, &msg_msi, 1);
+        dprintk("probe 0x%02x @ %s: %s\n",
+            msg_msi.addr, dev->i2c_adap.name,
+            (1 == rc) ? "yes" : "no");
+        break;
     default:
         dprintk("No I2C IR support for board %x\n", dev->board);
         return;
drivers/media/pci/saa7134/saa7134.h +1 -0
index 2474e84..28b083f 100644
@@ -338,6 +338,7 @@ struct saa7134_card_ir {
 #define SAA7134_BOARD_ASUSTeK_PS3_100      190
 #define SAA7134_BOARD_HAWELL_HW_9004V1      191
 #define SAA7134_BOARD_AVERMEDIA_A706        192
+#define SAA7134_BOARD_SNAZIO_TVPVR_PRO      193
 
 #define SAA7134_MAXBOARDS 32
 #define SAA7134_INPUT_MAX 8
drivers/media/rc/keymaps/Makefile +1 -0
index 0b8c549..72b2e45 100644
@@ -81,6 +81,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \
             rc-real-audio-220-32-keys.o \
             rc-reddo.o \
             rc-snapstream-firefly.o \
+            rc-snazio-tvpvr-pro.o \
             rc-streamzap.o \
             rc-tbs-nec.o \
             rc-technisat-usb2.o \
drivers/media/rc/keymaps/rc-snazio-tvpvr-pro.c new file +1 -0
new file mode 100644
index 0000000..44f0c81
@@ -0,0 +1,116 @@
+/* rc-snazio-tvpvr-pro.h - Keytable for snazio_tvpvr_pro Remote 

Controller
+ *
+ * keymap imported from ir-keymaps.c
+ *
+ * Copyright (c) 2010 by Mauro Carvalho Chehab
+ * Copyright (c) 2014 by POJAR GEORGE <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */

drivers/media/rc/keymaps/rc-snazio-tvpvr-pro.c new file +104 -0
+
+#include <media/rc-map.h>
+#include <linux/module.h>
+
+/*
+  Keycodes for remote on the SnaZio TvPVR PRO.
+  POJAR GEORGE <[email protected]>
+*/
+
+static struct rc_map_table snazio_tvpvr_pro[] = {
+
+/*  ---- Remote Button Layout ----
+
+    POWER   SOURCE  SCAN    MUTE
+    TV/FM   1       2       3
+    |>      4       5       6
+    <|      7       8       9
+    ^^UP    0       +       RECALL
+    vvDN    RECORD  STOP    PLAY
+
+    MINIMIZE          ZOOM
+
+          CH+
+      VOL-                   VOL+
+          CH-
+
+    SNAPSHOT           MTS
+
+     <<      FUNC    >>     RESET
+*/
+
+    { 0x01, KEY_1 },        /* 1 */
+    { 0x0b, KEY_2 },        /* 2 */
+    { 0x1b, KEY_3 },        /* 3 */
+    { 0x05, KEY_4 },        /* 4 */
+    { 0x09, KEY_5 },        /* 5 */
+    { 0x15, KEY_6 },        /* 6 */
+    { 0x06, KEY_7 },        /* 7 */
+    { 0x0a, KEY_8 },        /* 8 */
+    { 0x12, KEY_9 },        /* 9 */
+    { 0x02, KEY_0 },        /* 0 */
+    { 0x10, KEY_KPPLUS },        /* + */
+    { 0x13, KEY_AGAIN },        /* Recall */
+
+    { 0x1e, KEY_POWER },        /* Power */
+    { 0x07, KEY_VIDEO },        /* Source */
+    { 0x1c, KEY_SEARCH },        /* Scan */
+    { 0x18, KEY_MUTE },        /* Mute */
+
+    { 0x03, KEY_RADIO },        /* TV/FM */
+    /* The next four keys are duplicates that appear to send the
+       same IR code as Ch+, Ch-, >>, and << .  The raw code assigned
+       to them is the actual code + 0x20 - they will never be
+       detected as such unless some way is discovered to distinguish
+       these buttons from those that have the same code. */
+    { 0x3f, KEY_RIGHT },        /* |> and Ch+ */
+    { 0x37, KEY_LEFT },        /* <| and Ch- */
+    { 0x2c, KEY_UP },        /* ^^Up and >> */
+    { 0x24, KEY_DOWN },        /* vvDn and << */
+
+    { 0x00, KEY_RECORD },        /* Record */
+    { 0x08, KEY_STOP },        /* Stop */
+    { 0x11, KEY_PLAY },        /* Play */
+
+    { 0x0f, KEY_CLOSE },        /* Minimize */
+    { 0x19, KEY_ZOOM },        /* Zoom */
+    { 0x1a, KEY_CAMERA },        /* Snapshot */
+    { 0x0d, KEY_LANGUAGE },        /* MTS */
+
+    { 0x14, KEY_VOLUMEDOWN },    /* Vol- */
+    { 0x16, KEY_VOLUMEUP },        /* Vol+ */
+    { 0x17, KEY_CHANNELDOWN },    /* Ch- */
+    { 0x1f, KEY_CHANNELUP },    /* Ch+ */
+
+    { 0x04, KEY_REWIND },        /* << */
+    { 0x0e, KEY_MENU },        /* Function */
+    { 0x0c, KEY_FASTFORWARD },    /* >> */
+    { 0x1d, KEY_RESTART },        /* Reset */
+};
+
+static struct rc_map_list snazio_tvpvr_pro_map = {
+    .map = {
+        .scan    = snazio_tvpvr_pro,
+        .size    = ARRAY_SIZE(snazio_tvpvr_pro),
+        .rc_type = RC_TYPE_UNKNOWN,    /* Legacy IR type */
+        .name    = RC_MAP_SNAZIO_TVPVR_PRO,
+    }
+};
+
+static int __init init_rc_map_snazio_tvpvr_pro(void)
+{
+    return rc_map_register(&snazio_tvpvr_pro_map);
+}
+
+static void __exit exit_rc_map_snazio_tvpvr_pro(void)
+{
+    rc_map_unregister(&snazio_tvpvr_pro_map);
+}
+
+module_init(init_rc_map_snazio_tvpvr_pro)
+module_exit(exit_rc_map_snazio_tvpvr_pro)
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("POJAR GEORGE <[email protected]>");
include/media/rc-map.h +1 -0
index e5aa240..b802af4 100644
@@ -177,6 +177,7 @@ void rc_map_init(void);
 #define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys"
 #define RC_MAP_REDDO                     "rc-reddo"
 #define RC_MAP_SNAPSTREAM_FIREFLY        "rc-snapstream-firefly"
+#define RC_MAP_SNAZIO_TVPVR_PRO          "rc-snazio-tvpvr-pro"
 #define RC_MAP_STREAMZAP                 "rc-streamzap"
 #define RC_MAP_TBS_NEC                   "rc-tbs-nec"
 #define RC_MAP_TECHNISAT_USB2            "rc-technisat-usb2"
#4 lore raw
In reply to GEORGE

Moikka!

Quoted 127 lines · GEORGE

b/drivers/media/rc/keymaps/rc-snazio-tvpvr-pro.c
new file mode 100644
index 0000000..44f0c81

drivers/media/rc/keymaps/rc-snazio-tvpvr-pro.c new file +116 -0
@@ -0,0 +1,116 @@
+/* rc-snazio-tvpvr-pro.h - Keytable for snazio_tvpvr_pro Remote Controller
+ *
+ * keymap imported from ir-keymaps.c
+ *
+ * Copyright (c) 2010 by Mauro Carvalho Chehab
+ * Copyright (c) 2014 by POJAR GEORGE <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <media/rc-map.h>
+#include <linux/module.h>
+
+/*
+  Keycodes for remote on the SnaZio TvPVR PRO.
+  POJAR GEORGE <[email protected]>
+*/
+
+static struct rc_map_table snazio_tvpvr_pro[] = {
+
+/*  ---- Remote Button Layout ----
+
+    POWER   SOURCE  SCAN    MUTE
+    TV/FM   1       2       3
+    |>      4       5       6
+    <|      7       8       9
+    ^^UP    0       +       RECALL
+    vvDN    RECORD  STOP    PLAY
+
+    MINIMIZE          ZOOM
+
+          CH+
+      VOL-                   VOL+
+          CH-
+
+    SNAPSHOT           MTS
+
+     <<      FUNC    >>     RESET
+*/
+
+    { 0x01, KEY_1 },        /* 1 */
+    { 0x0b, KEY_2 },        /* 2 */
+    { 0x1b, KEY_3 },        /* 3 */
+    { 0x05, KEY_4 },        /* 4 */
+    { 0x09, KEY_5 },        /* 5 */
+    { 0x15, KEY_6 },        /* 6 */
+    { 0x06, KEY_7 },        /* 7 */
+    { 0x0a, KEY_8 },        /* 8 */
+    { 0x12, KEY_9 },        /* 9 */
+    { 0x02, KEY_0 },        /* 0 */
+    { 0x10, KEY_KPPLUS },        /* + */
+    { 0x13, KEY_AGAIN },        /* Recall */
+
+    { 0x1e, KEY_POWER },        /* Power */
+    { 0x07, KEY_VIDEO },        /* Source */
+    { 0x1c, KEY_SEARCH },        /* Scan */
+    { 0x18, KEY_MUTE },        /* Mute */
+
+    { 0x03, KEY_RADIO },        /* TV/FM */
+    /* The next four keys are duplicates that appear to send the
+       same IR code as Ch+, Ch-, >>, and << .  The raw code assigned
+       to them is the actual code + 0x20 - they will never be
+       detected as such unless some way is discovered to distinguish
+       these buttons from those that have the same code. */
+    { 0x3f, KEY_RIGHT },        /* |> and Ch+ */
+    { 0x37, KEY_LEFT },        /* <| and Ch- */
+    { 0x2c, KEY_UP },        /* ^^Up and >> */
+    { 0x24, KEY_DOWN },        /* vvDn and << */
+
+    { 0x00, KEY_RECORD },        /* Record */
+    { 0x08, KEY_STOP },        /* Stop */
+    { 0x11, KEY_PLAY },        /* Play */
+
+    { 0x0f, KEY_CLOSE },        /* Minimize */
+    { 0x19, KEY_ZOOM },        /* Zoom */
+    { 0x1a, KEY_CAMERA },        /* Snapshot */
+    { 0x0d, KEY_LANGUAGE },        /* MTS */
+
+    { 0x14, KEY_VOLUMEDOWN },    /* Vol- */
+    { 0x16, KEY_VOLUMEUP },        /* Vol+ */
+    { 0x17, KEY_CHANNELDOWN },    /* Ch- */
+    { 0x1f, KEY_CHANNELUP },    /* Ch+ */
+
+    { 0x04, KEY_REWIND },        /* << */
+    { 0x0e, KEY_MENU },        /* Function */
+    { 0x0c, KEY_FASTFORWARD },    /* >> */
+    { 0x1d, KEY_RESTART },        /* Reset */
+};
+
+static struct rc_map_list snazio_tvpvr_pro_map = {
+    .map = {
+        .scan    = snazio_tvpvr_pro,
+        .size    = ARRAY_SIZE(snazio_tvpvr_pro),
+        .rc_type = RC_TYPE_UNKNOWN,    /* Legacy IR type */
+        .name    = RC_MAP_SNAZIO_TVPVR_PRO,
+    }
+};
+
+static int __init init_rc_map_snazio_tvpvr_pro(void)
+{
+    return rc_map_register(&snazio_tvpvr_pro_map);
+}
+
+static void __exit exit_rc_map_snazio_tvpvr_pro(void)
+{
+    rc_map_unregister(&snazio_tvpvr_pro_map);
+}
+
+module_init(init_rc_map_snazio_tvpvr_pro)
+module_exit(exit_rc_map_snazio_tvpvr_pro)
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("POJAR GEORGE <[email protected]>");
include/media/rc-map.h +0 -0
index e5aa240..b802af4 100644

include/media/rc-map.h void rc_map_init(void); · line 183

Quoted 7 lines
include/media/rc-map.h +1 -0
@@ -177,6 +177,7 @@ void rc_map_init(void);
  #define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys"
  #define RC_MAP_REDDO                     "rc-reddo"
  #define RC_MAP_SNAPSTREAM_FIREFLY        "rc-snapstream-firefly"
+#define RC_MAP_SNAZIO_TVPVR_PRO          "rc-snazio-tvpvr-pro"
  #define RC_MAP_STREAMZAP                 "rc-streamzap"
  #define RC_MAP_TBS_NEC                   "rc-tbs-nec"
  #define RC_MAP_TECHNISAT_USB2            "rc-technisat-usb2"

That remote controller is same than rc-msi-tvanywhere-plus.c. If there is still some reason you need to duplicate it (like one keycode mapped differently), please add comment to file "this is almost similar than that keymap X, but for the reason Y we need to define new table".

rc-pixelview.c seems to be also rather similar.

Do you have some other receiver which returns full scan code? That keytable should be converted to some standard rc type (NEC?)

regards
Antti

Signature · 1 line
http://palosaari.fi/
#5 lore raw

Em Mon, 10 Feb 2014 07:28:31 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 57 lines

Moikka!

Quoted 53 lines · GEORGE

b/drivers/media/rc/keymaps/rc-snazio-tvpvr-pro.c
new file mode 100644
index 0000000..44f0c81

drivers/media/rc/keymaps/rc-snazio-tvpvr-pro.c new file +47 -0
@@ -0,0 +1,116 @@
+/* rc-snazio-tvpvr-pro.h - Keytable for snazio_tvpvr_pro Remote Controller
+ *
+ * keymap imported from ir-keymaps.c
+ *
+ * Copyright (c) 2010 by Mauro Carvalho Chehab
+ * Copyright (c) 2014 by POJAR GEORGE <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <media/rc-map.h>
+#include <linux/module.h>
+
+/*
+  Keycodes for remote on the SnaZio TvPVR PRO.
+  POJAR GEORGE <[email protected]>
+*/
+
+static struct rc_map_table snazio_tvpvr_pro[] = {
+
+/*  ---- Remote Button Layout ----
+
+    POWER   SOURCE  SCAN    MUTE
+    TV/FM   1       2       3
+    |>      4       5       6
+    <|      7       8       9
+    ^^UP    0       +       RECALL
+    vvDN    RECORD  STOP    PLAY
+
+    MINIMIZE          ZOOM
+
+          CH+
+      VOL-                   VOL+
+          CH-
+
+    SNAPSHOT           MTS
+
+     <<      FUNC    >>     RESET
+*/
+
+    { 0x01, KEY_1 },        /* 1 */
+    { 0x0b, KEY_2 },        /* 2 */
+    { 0x1b, KEY_3 },        /* 3 */
+    { 0x05, KEY_4 },        /* 4 */
Quoted 8 lines

drivers/media/rc/keymaps/rc-snazio-tvpvr-pro.c line 55

Quoted 8 lines
drivers/media/rc/keymaps/rc-snazio-tvpvr-pro.c new file +8 -0
+    { 0x09, KEY_5 },        /* 5 */
+    { 0x15, KEY_6 },        /* 6 */
+    { 0x06, KEY_7 },        /* 7 */
+    { 0x0a, KEY_8 },        /* 8 */
+    { 0x12, KEY_9 },        /* 9 */
+    { 0x02, KEY_0 },        /* 0 */
+    { 0x10, KEY_KPPLUS },        /* + */
+    { 0x13, KEY_AGAIN },        /* Recall */

Clearly, your emailer is doing something wrong here, replacing tabs by white spaces.

That prevents us to be apply to apply it.

Also, please see the Antti comments below.

Quoted 87 lines
Quoted 66 lines
drivers/media/rc/keymaps/rc-snazio-tvpvr-pro.c new file +61 -0
+
+    { 0x1e, KEY_POWER },        /* Power */
+    { 0x07, KEY_VIDEO },        /* Source */
+    { 0x1c, KEY_SEARCH },        /* Scan */
+    { 0x18, KEY_MUTE },        /* Mute */
+
+    { 0x03, KEY_RADIO },        /* TV/FM */
+    /* The next four keys are duplicates that appear to send the
+       same IR code as Ch+, Ch-, >>, and << .  The raw code assigned
+       to them is the actual code + 0x20 - they will never be
+       detected as such unless some way is discovered to distinguish
+       these buttons from those that have the same code. */
+    { 0x3f, KEY_RIGHT },        /* |> and Ch+ */
+    { 0x37, KEY_LEFT },        /* <| and Ch- */
+    { 0x2c, KEY_UP },        /* ^^Up and >> */
+    { 0x24, KEY_DOWN },        /* vvDn and << */
+
+    { 0x00, KEY_RECORD },        /* Record */
+    { 0x08, KEY_STOP },        /* Stop */
+    { 0x11, KEY_PLAY },        /* Play */
+
+    { 0x0f, KEY_CLOSE },        /* Minimize */
+    { 0x19, KEY_ZOOM },        /* Zoom */
+    { 0x1a, KEY_CAMERA },        /* Snapshot */
+    { 0x0d, KEY_LANGUAGE },        /* MTS */
+
+    { 0x14, KEY_VOLUMEDOWN },    /* Vol- */
+    { 0x16, KEY_VOLUMEUP },        /* Vol+ */
+    { 0x17, KEY_CHANNELDOWN },    /* Ch- */
+    { 0x1f, KEY_CHANNELUP },    /* Ch+ */
+
+    { 0x04, KEY_REWIND },        /* << */
+    { 0x0e, KEY_MENU },        /* Function */
+    { 0x0c, KEY_FASTFORWARD },    /* >> */
+    { 0x1d, KEY_RESTART },        /* Reset */
+};
+
+static struct rc_map_list snazio_tvpvr_pro_map = {
+    .map = {
+        .scan    = snazio_tvpvr_pro,
+        .size    = ARRAY_SIZE(snazio_tvpvr_pro),
+        .rc_type = RC_TYPE_UNKNOWN,    /* Legacy IR type */
+        .name    = RC_MAP_SNAZIO_TVPVR_PRO,
+    }
+};
+
+static int __init init_rc_map_snazio_tvpvr_pro(void)
+{
+    return rc_map_register(&snazio_tvpvr_pro_map);
+}
+
+static void __exit exit_rc_map_snazio_tvpvr_pro(void)
+{
+    rc_map_unregister(&snazio_tvpvr_pro_map);
+}
+
+module_init(init_rc_map_snazio_tvpvr_pro)
+module_exit(exit_rc_map_snazio_tvpvr_pro)
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("POJAR GEORGE <[email protected]>");
include/media/rc-map.h +0 -0
index e5aa240..b802af4 100644

include/media/rc-map.h void rc_map_init(void); · line 183

Quoted 7 lines
include/media/rc-map.h +1 -0
@@ -177,6 +177,7 @@ void rc_map_init(void);
  #define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys"
  #define RC_MAP_REDDO                     "rc-reddo"
  #define RC_MAP_SNAPSTREAM_FIREFLY        "rc-snapstream-firefly"
+#define RC_MAP_SNAZIO_TVPVR_PRO          "rc-snazio-tvpvr-pro"
  #define RC_MAP_STREAMZAP                 "rc-streamzap"
  #define RC_MAP_TBS_NEC                   "rc-tbs-nec"
  #define RC_MAP_TECHNISAT_USB2            "rc-technisat-usb2"

That remote controller is same than rc-msi-tvanywhere-plus.c. If there is still some reason you need to duplicate it (like one keycode mapped differently), please add comment to file "this is almost similar than that keymap X, but for the reason Y we need to define new table".

rc-pixelview.c seems to be also rather similar.

Do you have some other receiver which returns full scan code? That keytable should be converted to some standard rc type (NEC?)

regards
Antti

Signature · 2 lines
Regards,
Mauro