diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2006-04-18 21:47:08 +0100 |
---|---|---|
committer | Michael Krufky <mkrufky@linuxtv.org> | 2006-04-18 21:47:08 +0100 |
commit | a9ccefdfb8e688f194b7c5aa82f7526c65555215 (patch) | |
tree | 3c0e4066fae5cfaf0a06150db23c08e7e49e02e4 /linux | |
parent | 6ff9606bf157734998241b66ac10bb11b913401e (diff) | |
download | mediapointer-dvb-s2-a9ccefdfb8e688f194b7c5aa82f7526c65555215.tar.gz mediapointer-dvb-s2-a9ccefdfb8e688f194b7c5aa82f7526c65555215.tar.bz2 |
create standalone fe_lgh064f header
From: Michael Krufky <mkrufky@linuxtv.org>
move all pll_set functions for lg-tdvs-h06xf atsc tuners to a standalone header
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/dvb/frontends/fe_lgh06xf.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/frontends/fe_lgh06xf.h b/linux/drivers/media/dvb/frontends/fe_lgh06xf.h new file mode 100644 index 000000000..c5e8b5ff1 --- /dev/null +++ b/linux/drivers/media/dvb/frontends/fe_lgh06xf.h @@ -0,0 +1,66 @@ +/* + * fe_lgh06xf.h - ATSC Tuner support for LG TDVS H06xF + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef FE_LGH06XF_H +#define FE_LGH06XF_H +#include "dvb-pll.h" + +static int lg_h06xf_pll_set(struct dvb_frontend* fe, struct i2c_adapter* i2c_adap, + struct dvb_frontend_parameters* params) +{ + u8 buf[4]; + struct i2c_msg msg = { .addr = 0x61, .flags = 0, + .buf = buf, .len = sizeof(buf) }; + int err; + + dvb_pll_configure(&dvb_pll_tdvs_tua6034, buf, params->frequency, 0); + if ((err = i2c_transfer(i2c_adap, &msg, 1)) != 1) { + printk(KERN_WARNING "lg_h06xf: %s error " + "(addr %02x <- %02x, err = %i)\n", + __FUNCTION__, buf[0], buf[1], err); + if (err < 0) + return err; + else + return -EREMOTEIO; + } + + /* Set the Auxiliary Byte. */ +#if 0 + buf[2] &= ~0x20; + buf[2] |= 0x18; + buf[3] = 0x50; +#else + buf[0] = buf[2]; + buf[0] &= ~0x20; + buf[0] |= 0x18; + buf[1] = 0x50; + msg.len = 2; +#endif + if ((err = i2c_transfer(i2c_adap, &msg, 1)) != 1) { + printk(KERN_WARNING "lg_h06xf: %s error " + "(addr %02x <- %02x, err = %i)\n", + __FUNCTION__, buf[0], buf[1], err); + if (err < 0) + return err; + else + return -EREMOTEIO; + } + + return 0; +} +#endif |