public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@sous-sol.org>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: Justin Forbes <jmforbes@linuxtx.org>,
	Zwane Mwaikambo <zwane@arm.linux.org.uk>,
	"Theodore Ts'o" <tytso@mit.edu>,
	Randy Dunlap <rdunlap@xenotime.net>,
	Dave Jones <davej@redhat.com>,
	Chuck Wolber <chuckw@quantumlinux.com>,
	Chris Wedgwood <reviews@ml.cw.f00f.org>,
	Michael Krufky <mkrufky@linuxtv.org>,
	Chuck Ebbert <cebbert@redhat.com>,
	Domenico Andreoli <cavokz@gmail.com>,
	torvalds@linux-foundation.org, akpm@linux-foundation.org,
	alan@lxorguk.ukuu.org.uk, hartmut.hackmann@t-online.de,
	o.endriss@gmx.de, hermann-pitton@arcor.de,
	v4l-dvb-maintainer@linuxtv.org, mchehab@infradead.org,
	oendriss@gmx.de
Subject: DVB: tda10086: make the 22kHz tone for DISEQC a config option
Date: Wed, 16 Apr 2008 18:02:12 -0700	[thread overview]
Message-ID: <20080417010354.176575927@sous-sol.org> (raw)
In-Reply-To: 20080417010122.148289106@sous-sol.org

[-- Attachment #1: dvb-tda10086-make-the-22khz-tone-for-diseqc-a-config-option.patch --]
[-- Type: text/plain, Size: 5063 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
---------------------

From: Hartmut Hackmann <hartmut.hackmann@t-online.de>

(backported from commit ea75baf4b0f117564bd50827a49c4b14d61d24e9)

Some cards need the diseqc signal modulated, while some just need
the envelope to control the LNB supply.

This fixes Bug 9887

Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Acked-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Hermann Pitton <hermann-pitton@arcor.de>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
 drivers/media/dvb/dvb-usb/ttusb2.c        |    1 +
 drivers/media/dvb/frontends/tda10086.c    |   28 ++++++++++++++++++++++------
 drivers/media/dvb/frontends/tda10086.h    |    3 +++
 drivers/media/dvb/ttpci/budget.c          |    1 +
 drivers/media/video/saa7134/saa7134-dvb.c |    1 +
 5 files changed, 28 insertions(+), 6 deletions(-)

--- a/drivers/media/dvb/dvb-usb/ttusb2.c
+++ b/drivers/media/dvb/dvb-usb/ttusb2.c
@@ -144,6 +144,7 @@ static int ttusb2_power_ctrl(struct dvb_
 static struct tda10086_config tda10086_config = {
 	.demod_address = 0x0e,
 	.invert = 0,
+	.diseqc_tone = 1,
 };
 
 static int ttusb2_frontend_attach(struct dvb_usb_adapter *adap)
--- a/drivers/media/dvb/frontends/tda10086.c
+++ b/drivers/media/dvb/frontends/tda10086.c
@@ -106,9 +106,12 @@ static int tda10086_write_mask(struct td
 static int tda10086_init(struct dvb_frontend* fe)
 {
 	struct tda10086_state* state = fe->demodulator_priv;
+	u8 t22k_off = 0x80;
 
 	dprintk ("%s\n", __FUNCTION__);
 
+	if (state->config->diseqc_tone)
+		t22k_off = 0;
 	// reset
 	tda10086_write_byte(state, 0x00, 0x00);
 	msleep(10);
@@ -158,7 +161,7 @@ static int tda10086_init(struct dvb_fron
 	tda10086_write_byte(state, 0x3d, 0x80);
 
 	// setup SEC
-	tda10086_write_byte(state, 0x36, 0x80); // all SEC off, no 22k tone
+	tda10086_write_byte(state, 0x36, t22k_off); // all SEC off, 22k tone
 	tda10086_write_byte(state, 0x34, (((1<<19) * (22000/1000)) / (SACLK/1000)));      // } tone frequency
 	tda10086_write_byte(state, 0x35, (((1<<19) * (22000/1000)) / (SACLK/1000)) >> 8); // }
 
@@ -180,16 +183,20 @@ static void tda10086_diseqc_wait(struct 
 static int tda10086_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone)
 {
 	struct tda10086_state* state = fe->demodulator_priv;
+	u8 t22k_off = 0x80;
 
 	dprintk ("%s\n", __FUNCTION__);
 
+	if (state->config->diseqc_tone)
+		t22k_off = 0;
+
 	switch (tone) {
 	case SEC_TONE_OFF:
-		tda10086_write_byte(state, 0x36, 0x80);
+		tda10086_write_byte(state, 0x36, t22k_off);
 		break;
 
 	case SEC_TONE_ON:
-		tda10086_write_byte(state, 0x36, 0x81);
+		tda10086_write_byte(state, 0x36, 0x01 + t22k_off);
 		break;
 	}
 
@@ -202,9 +209,13 @@ static int tda10086_send_master_cmd (str
 	struct tda10086_state* state = fe->demodulator_priv;
 	int i;
 	u8 oldval;
+	u8 t22k_off = 0x80;
 
 	dprintk ("%s\n", __FUNCTION__);
 
+	if (state->config->diseqc_tone)
+		t22k_off = 0;
+
 	if (cmd->msg_len > 6)
 		return -EINVAL;
 	oldval = tda10086_read_byte(state, 0x36);
@@ -212,7 +223,8 @@ static int tda10086_send_master_cmd (str
 	for(i=0; i< cmd->msg_len; i++) {
 		tda10086_write_byte(state, 0x48+i, cmd->msg[i]);
 	}
-	tda10086_write_byte(state, 0x36, 0x88 | ((cmd->msg_len - 1) << 4));
+	tda10086_write_byte(state, 0x36, (0x08 + t22k_off)
+					| ((cmd->msg_len - 1) << 4));
 
 	tda10086_diseqc_wait(state);
 
@@ -225,16 +237,20 @@ static int tda10086_send_burst (struct d
 {
 	struct tda10086_state* state = fe->demodulator_priv;
 	u8 oldval = tda10086_read_byte(state, 0x36);
+	u8 t22k_off = 0x80;
 
 	dprintk ("%s\n", __FUNCTION__);
 
+	if (state->config->diseqc_tone)
+		t22k_off = 0;
+
 	switch(minicmd) {
 	case SEC_MINI_A:
-		tda10086_write_byte(state, 0x36, 0x84);
+		tda10086_write_byte(state, 0x36, 0x04 + t22k_off);
 		break;
 
 	case SEC_MINI_B:
-		tda10086_write_byte(state, 0x36, 0x86);
+		tda10086_write_byte(state, 0x36, 0x06 + t22k_off);
 		break;
 	}
 
--- a/drivers/media/dvb/frontends/tda10086.h
+++ b/drivers/media/dvb/frontends/tda10086.h
@@ -33,6 +33,9 @@ struct tda10086_config
 
 	/* does the "inversion" need inverted? */
 	u8 invert;
+
+	/* do we need the diseqc signal with carrier? */
+	u8 diseqc_tone;
 };
 
 #if defined(CONFIG_DVB_TDA10086) || (defined(CONFIG_DVB_TDA10086_MODULE) && defined(MODULE))
--- a/drivers/media/dvb/ttpci/budget.c
+++ b/drivers/media/dvb/ttpci/budget.c
@@ -351,6 +351,7 @@ static struct s5h1420_config s5h1420_con
 static struct tda10086_config tda10086_config = {
 	.demod_address = 0x0e,
 	.invert = 0,
+	.diseqc_tone = 1,
 };
 
 static u8 read_pwm(struct budget* budget)
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -826,6 +826,7 @@ static struct tda1004x_config ads_tech_d
 static struct tda10086_config flydvbs = {
 	.demod_address = 0x0e,
 	.invert = 0,
+	.diseqc_tone = 0,
 };
 
 /* ==================================================================

-- 

  parent reply	other threads:[~2008-04-17  1:20 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-17  1:01 [patch 00/66] 2.6.24-stable review Chris Wright
2008-04-17  1:01 ` time: prevent the loop in timespec_add_ns() from being optimised away Chris Wright
2008-04-17  1:01 ` kbuild: soften modpost checks when doing cross builds Chris Wright
2008-04-17  1:01 ` mtd: memory corruption in block2mtd.c Chris Wright
2008-04-17  1:01 ` md: remove the super sysfs attribute from devices in an md array Chris Wright
2008-04-17  1:01 ` V4L: ivtv: Add missing sg_init_table() Chris Wright
2008-04-17  1:01 ` UIO: add pgprot_noncached() to UIO mmap code Chris Wright
2008-04-17  1:01 ` USB: add support for Motorola ROKR Z6 cellphone in mass storage mode Chris Wright
2008-04-17  1:01 ` USB: new quirk flag to avoid Set-Interface Chris Wright
2008-04-17  1:01 ` inotify: fix race Chris Wright
2008-04-17  1:01 ` inotify: remove debug code Chris Wright
2008-04-17  1:01 ` NOHZ: reevaluate idle sleep length after add_timer_on() Chris Wright
2008-04-17  1:01 ` slab: fix cache_cache bootstrap in kmem_cache_init() Chris Wright
2008-04-17  1:01 ` xen: fix RMW when unmasking events Chris Wright
2008-04-17  1:01 ` xen: mask out SEP from CPUID Chris Wright
2008-04-17  1:01 ` xen: fix UP setup of shared_info Chris Wright
2008-04-17  1:01 ` PERCPU : __percpu_alloc_mask() can dynamically size percpu_data storage Chris Wright
2008-04-17  1:01 ` alloc_percpu() fails to allocate percpu data Chris Wright
2008-04-17  1:01 ` vfs: fix data leak in nobh_write_end() Chris Wright
2008-04-17  1:01 ` pci: revert SMBus unhide on HP Compaq nx6110 Chris Wright
2008-04-17  1:01 ` hwmon: (w83781d) Fix I/O resource conflict with PNP Chris Wright
2008-04-17  1:01 ` vmcoreinfo: add the symbol "phys_base" Chris Wright
2008-04-17  9:24   ` Eric W. Biederman
2008-04-17 17:16     ` Chris Wright
2008-04-17 17:29       ` Vivek Goyal
2008-04-18 10:17         ` Ken'ichi Ohmichi
2008-04-17 23:31       ` Eric W. Biederman
2008-04-17  1:01 ` USB: Allow initialization of broken keyspan serial adapters Chris Wright
2008-04-17  1:01 ` USB: serial: fix regression in Visor/Palm OS module for kernels >= 2.6.24 Chris Wright
2008-04-17  1:01 ` USB: serial: ti_usb_3410_5052: Correct TUSB3410 endpoint requirements Chris Wright
2008-04-17  8:01   ` Oliver Neukum
2008-04-17 17:02     ` Greg KH
2008-04-17  1:01 ` CRYPTO xcbc: Fix crash when ipsec uses xcbc-mac with big data chunk Chris Wright
2008-04-17 11:26   ` S.Çağlar Onur
2008-04-17 14:22     ` Herbert Xu
2008-04-17 23:33       ` Chris Wright
2008-04-17  1:01 ` mtd: fix broken state in CFI driver caused by FL_SHUTDOWN Chris Wright
2008-04-17  1:01 ` ipmi: change device node ordering to reflect probe order Chris Wright
2008-04-17  1:01 ` AX25 ax25_out: check skb for NULL in ax25_kick() Chris Wright
2008-04-17  1:01 ` NET: include <linux/types.h> into linux/ethtool.h for __u* typedef Chris Wright
2008-04-17  1:01 ` SUNGEM: Fix NAPI assertion failure Chris Wright
2008-04-17  1:01 ` INET: inet_frag_evictor() must run with BH disabled Chris Wright
2008-04-17  1:01 ` LLC: Restrict LLC sockets to root Chris Wright
2008-04-17  1:01 ` netpoll: zap_completion_queue: adjust skb->users counter Chris Wright
2008-04-17  1:01 ` PPPOL2TP: Make locking calls softirq-safe Chris Wright
2008-04-17  1:01 ` PPPOL2TP: Fix SMP issues in skb reorder queue handling Chris Wright
2008-04-17  1:01 ` NET: Add preemption point in qdisc_run Chris Wright
2008-04-17  1:01 ` sch_htb: fix "too many events" situation Chris Wright
2008-04-17  1:02 ` SCTP: Fix local_addr deletions during list traversals Chris Wright
2008-04-17  1:02 ` NET: Fix multicast device ioctl checks Chris Wright
2008-04-17  1:02 ` TCP: Fix shrinking windows with window scaling Chris Wright
2008-04-17  1:02 ` TCP: Let skbs grow over a page on fast peers Chris Wright
2008-04-17  1:02 ` VLAN: Dont copy ALLMULTI/PROMISC flags from underlying device Chris Wright
2008-04-17  1:02 ` SPARC64: Fix atomic backoff limit Chris Wright
2008-04-17  1:02 ` SPARC64: Fix __get_cpu_var in preemption-enabled area Chris Wright
2008-04-17  1:02 ` SPARC64: flush_ptrace_access() needs preemption disable Chris Wright
2008-04-17  1:02 ` libata: assume no device is attached if both IDENTIFYs are aborted Chris Wright
2008-04-17  1:02 ` sis190: read the mac address from the eeprom first Chris Wright
2008-04-17  1:02 ` bluetooth: hci_core: defer hci_unregister_sysfs() Chris Wright
2008-04-17  1:02 ` SPARC64: Fix FPU saving in 64-bit signal handling Chris Wright
2008-04-17  1:02 ` Chris Wright [this message]
2008-04-17  1:02 ` SUNRPC: Fix a memory leak in rpc_create() Chris Wright
2008-04-17 21:25   ` Stefan Lippers-Hollmann
2008-04-17 22:06     ` Trond Myklebust
2008-04-17 22:09       ` Chris Wright
2008-04-18 14:42       ` Chuck Lever
2008-04-17  1:02 ` HFS+: fix unlink of links Chris Wright
2008-04-17  1:02 ` acpi: fix "buggy BIOS check" when CPUs are hot removed Chris Wright
2008-04-17  1:02 ` plip: replace spin_lock_irq with spin_lock_irqsave in irq context Chris Wright
2008-04-17  1:02 ` signalfd: fix for incorrect SI_QUEUE user data reporting Chris Wright
2008-04-17  1:02 ` md: close a livelock window in handle_parity_checks5 Chris Wright
2008-04-17  1:02 ` POWERPC: Fix build of modular drivers/macintosh/apm_emu.c Chris Wright
2008-04-17  1:02 ` pnpacpi: reduce printk severity for "pnpacpi: exceeded the max number of ..." Chris Wright
2008-04-17 15:24   ` Nick Andrew
2008-04-17 17:09     ` Chris Wright
2008-04-18 21:48   ` Bjorn Helgaas
2008-04-23  4:09     ` [stable PATCH for 2.6.24.5 and 2.6.25] pnpacpi: fix potential corruption on "pnpacpi: exceeded the max number of IRQ resources 2" Len Brown
2008-04-17  1:02 ` PARISC futex: special case cmpxchg NULL in kernel space Chris Wright
2008-04-17  1:02 ` PARISC pdc_console: fix bizarre panic on boot Chris Wright
2008-04-17  1:02 ` PARISC fix signal trampoline cache flushing Chris Wright
2008-04-17  1:02 ` acpi: bus: check once more for an empty list after locking it Chris Wright
2008-04-17  1:02 ` fbdev: fix /proc/fb oops after module removal Chris Wright
2008-04-17  1:02 ` macb: Call phy_disconnect on removing Chris Wright
2008-04-17  1:02 ` file capabilities: remove cap_task_kill() Chris Wright
2008-04-17  1:02 ` locks: fix possible infinite loop in fcntl(F_SETLKW) over nfs Chris Wright
2008-04-18  7:50 ` [stable] [patch 00/66] 2.6.24-stable review Chris Wright

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=20080417010354.176575927@sous-sol.org \
    --to=chrisw@sous-sol.org \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=cavokz@gmail.com \
    --cc=cebbert@redhat.com \
    --cc=chuckw@quantumlinux.com \
    --cc=davej@redhat.com \
    --cc=hartmut.hackmann@t-online.de \
    --cc=hermann-pitton@arcor.de \
    --cc=jmforbes@linuxtx.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=mkrufky@linuxtv.org \
    --cc=o.endriss@gmx.de \
    --cc=oendriss@gmx.de \
    --cc=rdunlap@xenotime.net \
    --cc=reviews@ml.cw.f00f.org \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    --cc=v4l-dvb-maintainer@linuxtv.org \
    --cc=zwane@arm.linux.org.uk \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox