[media] Add support for TechniSat Skystar S2

This patch adds support for the Technisat Skystar S2 - this
has been tried before but the cx24120 driver was a bit out of shape
and it didn't got any further:

https://patchwork.linuxtv.org/patch/10575/

It is an old card, but currently being sold off for next to nothing,
so it's proving quite popular of late. Noticing it's quite similar
to the cx24116 and cx24117 I've rewritten the driver in a similar way.

There were a few registers and commands from those drivers
missing from this one I've tested out and found they do something so
they've been added in to speed up tuning and to make get_frontend
return something useful.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick.Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
Jemma Denson 2015-04-14 09:04:50 -03:00 committed by Mauro Carvalho Chehab
parent 9cae84b32d
commit 5afc9a25be
8 changed files with 1688 additions and 7 deletions

View file

@ -14,6 +14,7 @@ config DVB_B2C2_FLEXCOP
select DVB_S5H1420 if MEDIA_SUBDRV_AUTOSELECT
select DVB_TUNER_ITD1000 if MEDIA_SUBDRV_AUTOSELECT
select DVB_ISL6421 if MEDIA_SUBDRV_AUTOSELECT
select DVB_CX24120 if MEDIA_SUBDRV_AUTOSELECT
select DVB_CX24123 if MEDIA_SUBDRV_AUTOSELECT
select MEDIA_TUNER_SIMPLE if MEDIA_SUBDRV_AUTOSELECT
select DVB_TUNER_CX24113 if MEDIA_SUBDRV_AUTOSELECT

View file

@ -12,6 +12,7 @@
#include "cx24113.h"
#include "cx24123.h"
#include "isl6421.h"
#include "cx24120.h"
#include "mt352.h"
#include "bcm3510.h"
#include "nxt200x.h"
@ -26,6 +27,16 @@
#define FE_SUPPORTED(fe) (defined(CONFIG_DVB_##fe) || \
(defined(CONFIG_DVB_##fe##_MODULE) && defined(MODULE)))
#if FE_SUPPORTED(BCM3510) || FE_SUPPORTED(CX24120)
static int flexcop_fe_request_firmware(struct dvb_frontend *fe,
const struct firmware **fw, char *name)
{
struct flexcop_device *fc = fe->dvb->priv;
return request_firmware(fw, name, fc->dev);
}
#endif
/* lnb control */
#if FE_SUPPORTED(MT312) || FE_SUPPORTED(STV0299)
static int flexcop_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
@ -445,13 +456,6 @@ static int airstar_dvbt_attach(struct flexcop_device *fc,
/* AirStar ATSC 1st generation */
#if FE_SUPPORTED(BCM3510)
static int flexcop_fe_request_firmware(struct dvb_frontend *fe,
const struct firmware **fw, char* name)
{
struct flexcop_device *fc = fe->dvb->priv;
return request_firmware(fw, name, fc->dev);
}
static struct bcm3510_config air2pc_atsc_first_gen_config = {
.demod_address = 0x0f,
.request_firmware = flexcop_fe_request_firmware,
@ -619,6 +623,38 @@ static int cablestar2_attach(struct flexcop_device *fc,
#define cablestar2_attach NULL
#endif
/* SkyStar S2 PCI DVB-S/S2 card based on Conexant cx24120/cx24118 */
#if FE_SUPPORTED(CX24120) && FE_SUPPORTED(ISL6421)
static const struct cx24120_config skystar2_rev3_3_cx24120_config = {
.i2c_addr = 0x55,
.xtal_khz = 10111,
.initial_mpeg_config = { 0xa1, 0x76, 0x07 },
.request_firmware = flexcop_fe_request_firmware,
};
static int skystarS2_rev33_attach(struct flexcop_device *fc,
struct i2c_adapter *i2c)
{
fc->fe = dvb_attach(cx24120_attach,
&skystar2_rev3_3_cx24120_config, i2c);
if (fc->fe == NULL)
return 0;
fc->dev_type = FC_SKYS2_REV33;
fc->fc_i2c_adap[2].no_base_addr = 1;
if ((dvb_attach(isl6421_attach, fc->fe,
&fc->fc_i2c_adap[2].i2c_adap, 0x08, 0, 0, false) == NULL)) {
err("ISL6421 could NOT be attached!");
return 0;
}
info("ISL6421 successfully attached.");
return 1;
}
#else
#define skystarS2_rev33_attach NULL
#endif
static struct {
flexcop_device_type_t type;
int (*attach)(struct flexcop_device *, struct i2c_adapter *);
@ -632,6 +668,7 @@ static struct {
{ FC_AIR_ATSC1, airstar_atsc1_attach },
{ FC_CABLE, cablestar2_attach },
{ FC_SKY_REV23, skystar2_rev23_attach },
{ FC_SKYS2_REV33, skystarS2_rev33_attach },
};
/* try to figure out the frontend */

View file

@ -56,6 +56,7 @@ static const char *flexcop_device_names[] = {
[FC_SKY_REV26] = "Sky2PC/SkyStar 2 DVB-S rev 2.6",
[FC_SKY_REV27] = "Sky2PC/SkyStar 2 DVB-S rev 2.7a/u",
[FC_SKY_REV28] = "Sky2PC/SkyStar 2 DVB-S rev 2.8",
[FC_SKYS2_REV33] = "Sky2PC/SkyStar S2 DVB-S/S2 rev 3.3",
};
static const char *flexcop_bus_names[] = {

View file

@ -24,6 +24,7 @@ typedef enum {
FC_SKY_REV26,
FC_SKY_REV27,
FC_SKY_REV28,
FC_SKYS2_REV33,
} flexcop_device_type_t;
typedef enum {

View file

@ -223,6 +223,13 @@ config DVB_CX24117
help
A Dual DVB-S/S2 tuner module. Say Y when you want to support this frontend.
config DVB_CX24120
tristate "Conexant CX24120 based"
depends on DVB_CORE && I2C
default m if !MEDIA_SUBDRV_AUTOSELECT
help
A DVB-S/DVB-S2 tuner module. Say Y when you want to support this frontend.
config DVB_SI21XX
tristate "Silicon Labs SI21XX based"
depends on DVB_CORE && I2C

View file

@ -83,6 +83,7 @@ obj-$(CONFIG_DVB_DUMMY_FE) += dvb_dummy_fe.o
obj-$(CONFIG_DVB_AF9013) += af9013.o
obj-$(CONFIG_DVB_CX24116) += cx24116.o
obj-$(CONFIG_DVB_CX24117) += cx24117.o
obj-$(CONFIG_DVB_CX24120) += cx24120.o
obj-$(CONFIG_DVB_SI21XX) += si21xx.o
obj-$(CONFIG_DVB_SI2168) += si2168.o
obj-$(CONFIG_DVB_STV0288) += stv0288.o

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,56 @@
/*
* Conexant CX24120/CX24118 - DVB-S/S2 demod/tuner driver
*
* Copyright (C) 2008 Patrick Boettcher <pb@linuxtv.org>
* Copyright (C) 2009 Sergey Tyurin <forum.free-x.de>
* Updated 2012 by Jannis Achstetter <jannis_achstetter@web.de>
* Copyright (C) 2015 Jemma Denson <jdenson@gmail.com>
*
* 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.
*
* 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.
*/
#ifndef CX24120_H
#define CX24120_H
#include <linux/kconfig.h>
#include <linux/dvb/frontend.h>
#include <linux/firmware.h>
struct cx24120_initial_mpeg_config {
u8 x1;
u8 x2;
u8 x3;
};
struct cx24120_config {
u8 i2c_addr;
u32 xtal_khz;
struct cx24120_initial_mpeg_config initial_mpeg_config;
int (*request_firmware)(struct dvb_frontend *fe,
const struct firmware **fw, char *name);
};
#if IS_REACHABLE(CONFIG_DVB_CX24120)
extern struct dvb_frontend *cx24120_attach(
const struct cx24120_config *config,
struct i2c_adapter *i2c);
#else
static inline struct dvb_frontend *cx24120_attach(
const struct cx24120_config *config,
struct i2c_adapter *i2c)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return NULL;
}
#endif
#endif /* CX24120_H */