···258258 Say Y here to support the default remote control decoding for the259259 Afatech AF9005 based receiver.260260261261+config DVB_USB_PCTV452E262262+ tristate "Pinnacle PCTV HDTV Pro USB device/TT Connect S2-3600"263263+ depends on DVB_USB264264+ select TTPCI_EEPROM265265+ select DVB_LNBP22 if !DVB_FE_CUSTOMISE266266+ select DVB_STB0899 if !DVB_FE_CUSTOMISE267267+ select DVB_STB6100 if !DVB_FE_CUSTOMISE268268+ help269269+ Support for external USB adapter designed by Pinnacle,270270+ shipped under the brand name 'PCTV HDTV Pro USB'.271271+ Also supports TT Connect S2-3600/3650 cards.272272+ Say Y if you own such a device and want to use it.273273+261274config DVB_USB_DW2102262275 tristate "DvbWorld & TeVii DVB-S/S2 USB2.0 support"263276 depends on DVB_USB
···607607 help608608 An SEC control chips.609609610610+config DVB_LNBP22611611+ tristate "LNBP22 SEC controllers"612612+ depends on DVB_CORE && I2C613613+ default m if DVB_FE_CUSTOMISE614614+ help615615+ LNB power supply and control voltage616616+ regulator chip with step-up converter617617+ and I2C interface.618618+ Say Y when you want to support this chip.619619+610620config DVB_ISL6405611621 tristate "ISL6405 SEC controller"612622 depends on DVB_CORE && I2C
···11+/*22+ * lnbp22.h - driver for lnb supply and control ic lnbp2233+ *44+ * Copyright (C) 2006 Dominik Kuhlen55+ * Based on lnbp21 driver66+ *77+ * This program is free software; you can redistribute it and/or88+ * modify it under the terms of the GNU General Public License99+ * as published by the Free Software Foundation; either version 21010+ * of the License, or (at your option) any later version.1111+ *1212+ *1313+ * This program is distributed in the hope that it will be useful,1414+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1515+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1616+ * GNU General Public License for more details.1717+ *1818+ *1919+ * You should have received a copy of the GNU General Public License2020+ * along with this program; if not, write to the Free Software2121+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.2222+ * Or, point your browser to http://www.gnu.org/copyleft/gpl.html2323+ *2424+ *2525+ * the project's page is at http://www.linuxtv.org2626+ */2727+#include <linux/delay.h>2828+#include <linux/errno.h>2929+#include <linux/init.h>3030+#include <linux/kernel.h>3131+#include <linux/module.h>3232+#include <linux/moduleparam.h>3333+#include <linux/string.h>3434+#include <linux/slab.h>3535+3636+#include "dvb_frontend.h"3737+#include "lnbp22.h"3838+3939+static int debug;4040+module_param(debug, int, 0644);4141+MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");4242+4343+4444+#define dprintk(lvl, arg...) if (debug >= (lvl)) printk(arg)4545+4646+struct lnbp22 {4747+ u8 config[4];4848+ struct i2c_adapter *i2c;4949+};5050+5151+static int lnbp22_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)5252+{5353+ struct lnbp22 *lnbp22 = (struct lnbp22 *)fe->sec_priv;5454+ struct i2c_msg msg = {5555+ .addr = 0x08,5656+ .flags = 0,5757+ .buf = (char *)&lnbp22->config,5858+ .len = sizeof(lnbp22->config),5959+ };6060+6161+ dprintk(1, "%s: %d (18V=%d 13V=%d)\n", __func__, voltage,6262+ SEC_VOLTAGE_18, SEC_VOLTAGE_13);6363+6464+ lnbp22->config[3] = 0x60; /* Power down */6565+ switch (voltage) {6666+ case SEC_VOLTAGE_OFF:6767+ break;6868+ case SEC_VOLTAGE_13:6969+ lnbp22->config[3] |= LNBP22_EN;7070+ break;7171+ case SEC_VOLTAGE_18:7272+ lnbp22->config[3] |= (LNBP22_EN | LNBP22_VSEL);7373+ break;7474+ default:7575+ return -EINVAL;7676+ };7777+7878+ dprintk(1, "%s: 0x%02x)\n", __func__, lnbp22->config[3]);7979+ return (i2c_transfer(lnbp22->i2c, &msg, 1) == 1) ? 0 : -EIO;8080+}8181+8282+static int lnbp22_enable_high_lnb_voltage(struct dvb_frontend *fe, long arg)8383+{8484+ struct lnbp22 *lnbp22 = (struct lnbp22 *) fe->sec_priv;8585+ struct i2c_msg msg = {8686+ .addr = 0x08,8787+ .flags = 0,8888+ .buf = (char *)&lnbp22->config,8989+ .len = sizeof(lnbp22->config),9090+ };9191+9292+ dprintk(1, "%s: %d\n", __func__, (int)arg);9393+ if (arg)9494+ lnbp22->config[3] |= LNBP22_LLC;9595+ else9696+ lnbp22->config[3] &= ~LNBP22_LLC;9797+9898+ return (i2c_transfer(lnbp22->i2c, &msg, 1) == 1) ? 0 : -EIO;9999+}100100+101101+static void lnbp22_release(struct dvb_frontend *fe)102102+{103103+ dprintk(1, "%s\n", __func__);104104+ /* LNBP power off */105105+ lnbp22_set_voltage(fe, SEC_VOLTAGE_OFF);106106+107107+ /* free data */108108+ kfree(fe->sec_priv);109109+ fe->sec_priv = NULL;110110+}111111+112112+struct dvb_frontend *lnbp22_attach(struct dvb_frontend *fe,113113+ struct i2c_adapter *i2c)114114+{115115+ struct lnbp22 *lnbp22 = kmalloc(sizeof(struct lnbp22), GFP_KERNEL);116116+ if (!lnbp22)117117+ return NULL;118118+119119+ /* default configuration */120120+ lnbp22->config[0] = 0x00; /* ? */121121+ lnbp22->config[1] = 0x28; /* ? */122122+ lnbp22->config[2] = 0x48; /* ? */123123+ lnbp22->config[3] = 0x60; /* Power down */124124+ lnbp22->i2c = i2c;125125+ fe->sec_priv = lnbp22;126126+127127+ /* detect if it is present or not */128128+ if (lnbp22_set_voltage(fe, SEC_VOLTAGE_OFF)) {129129+ dprintk(0, "%s LNBP22 not found\n", __func__);130130+ kfree(lnbp22);131131+ fe->sec_priv = NULL;132132+ return NULL;133133+ }134134+135135+ /* install release callback */136136+ fe->ops.release_sec = lnbp22_release;137137+138138+ /* override frontend ops */139139+ fe->ops.set_voltage = lnbp22_set_voltage;140140+ fe->ops.enable_high_lnb_voltage = lnbp22_enable_high_lnb_voltage;141141+142142+ return fe;143143+}144144+EXPORT_SYMBOL(lnbp22_attach);145145+146146+MODULE_DESCRIPTION("Driver for lnb supply and control ic lnbp22");147147+MODULE_AUTHOR("Dominik Kuhlen");148148+MODULE_LICENSE("GPL");
+57
drivers/media/dvb/frontends/lnbp22.h
···11+/*22+ * lnbp22.h - driver for lnb supply and control ic lnbp2233+ *44+ * Copyright (C) 2006 Dominik Kuhlen55+ * Based on lnbp21.h66+ *77+ * This program is free software; you can redistribute it and/or88+ * modify it under the terms of the GNU General Public License99+ * as published by the Free Software Foundation; either version 21010+ * of the License, or (at your option) any later version.1111+ *1212+ *1313+ * This program is distributed in the hope that it will be useful,1414+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1515+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1616+ * GNU General Public License for more details.1717+ *1818+ *1919+ * You should have received a copy of the GNU General Public License2020+ * along with this program; if not, write to the Free Software2121+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.2222+ * Or, point your browser to http://www.gnu.org/copyleft/gpl.html2323+ *2424+ *2525+ * the project's page is at http://www.linuxtv.org2626+ */2727+2828+#ifndef _LNBP22_H2929+#define _LNBP22_H3030+3131+/* Enable */3232+#define LNBP22_EN 0x103333+/* Voltage selection */3434+#define LNBP22_VSEL 0x023535+/* Plus 1 Volt Bit */3636+#define LNBP22_LLC 0x013737+3838+#include <linux/dvb/frontend.h>3939+4040+#if defined(CONFIG_DVB_LNBP22) || \4141+ (defined(CONFIG_DVB_LNBP22_MODULE) && defined(MODULE))4242+/*4343+ * override_set and override_clear control which system register bits (above)4444+ * to always set & clear4545+ */4646+extern struct dvb_frontend *lnbp22_attach(struct dvb_frontend *fe,4747+ struct i2c_adapter *i2c);4848+#else4949+static inline struct dvb_frontend *lnbp22_attach(struct dvb_frontend *fe,5050+ struct i2c_adapter *i2c)5151+{5252+ printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);5353+ return NULL;5454+}5555+#endif /* CONFIG_DVB_LNBP22 */5656+5757+#endif /* _LNBP22_H */
+29
drivers/media/dvb/ttpci/ttpci-eeprom.c
···8585 return 0;8686}87878888+int ttpci_eeprom_decode_mac(u8 *decodedMAC, u8 *encodedMAC)8989+{9090+ u8 xor[20] = { 0x72, 0x23, 0x68, 0x19, 0x5c, 0xa8, 0x71, 0x2c,9191+ 0x54, 0xd3, 0x7b, 0xf1, 0x9E, 0x23, 0x16, 0xf6,9292+ 0x1d, 0x36, 0x64, 0x78};9393+ u8 data[20];9494+ int i;9595+9696+ memcpy(data, encodedMAC, 20);9797+9898+ for (i = 0; i < 20; i++)9999+ data[i] ^= xor[i];100100+ for (i = 0; i < 10; i++)101101+ data[i] = ((data[2 * i + 1] << 8) | data[2 * i])102102+ >> ((data[2 * i + 1] >> 6) & 3);103103+104104+ if (check_mac_tt(data))105105+ return -ENODEV;106106+107107+ decodedMAC[0] = data[2];108108+ decodedMAC[1] = data[1];109109+ decodedMAC[2] = data[0];110110+ decodedMAC[3] = data[6];111111+ decodedMAC[4] = data[5];112112+ decodedMAC[5] = data[4];113113+ return 0;114114+}115115+EXPORT_SYMBOL(ttpci_eeprom_decode_mac);116116+88117static int ttpci_eeprom_read_encodedMAC(struct i2c_adapter *adapter, u8 * encodedMAC)89118{90119 int ret;
+1
drivers/media/dvb/ttpci/ttpci-eeprom.h
···2828#include <linux/types.h>2929#include <linux/i2c.h>30303131+extern int ttpci_eeprom_decode_mac(u8 *decodedMAC, u8 *encodedMAC);3132extern int ttpci_eeprom_parse_mac(struct i2c_adapter *adapter, u8 *propsed_mac);32333334#endif