Re: [PATCH 02/12] [media] dvb-pll: Add support for THOMSON DTT7546X tuner.
Hi Michael, On Thu, 30 Jul 2015, Michael Ira Krufky wrote: > On Thu, Jul 30, 2015 at 7:14 AM, Michael Ira Krufky > wrote: > > On Thu, Jul 30, 2015 at 6:08 AM, Joe Perches wrote: > >> On Thu, 2015-07-30 at 10:47 +0100, Peter Griffin wrote: > >>> Hi Mauro / Joe, > >>> > >>> On Wed, 22 Jul 2015, Mauro Carvalho Chehab wrote: > >>> > >>> > Em Wed, 24 Jun 2015 18:17:37 -0700 > >>> > Joe Perches escreveu: > >>> > > >>> > > On Wed, 2015-06-24 at 16:11 +0100, Peter Griffin wrote: > >>> > > > This is used in conjunction with the STV0367 demodulator on > >>> > > > the STV0367-NIM-V1.0 NIM card which can be used with the STi > >>> > > > STB SoC's. > >>> > > > >>> > > Barely associated to this specific patch, but for > >>> > > dvb-pll.c, another thing that seems possible is to > >>> > > convert the struct dvb_pll_desc uses to const and > >>> > > change the "entries" fixed array size from 12 to [] > >>> > > > >>> > > It'd save a couple KB overall and remove ~5KB of data. > >>> > > > >>> > > $ size drivers/media/dvb-frontends/dvb-pll.o* > >>> > >text data bss dec hex filename > >>> > >8520 15522120 121922fa0 > >>> > > drivers/media/dvb-frontends/dvb-pll.o.new > >>> > >5624 63632120 14107371b > >>> > > drivers/media/dvb-frontends/dvb-pll.o.old > >>> > > >>> > Peter, > >>> > > >>> > Please add this patch on the next patch series you submit. > >>> > >>> Ok will do, I've added this patch with a slightly updated commit message > >>> to my series. > >>> > >>> Joe - Can I add your signed-off-by? > >> > >> Signed-off-by: Joe Perches > > > > Reviewed-by: Michael Ira Krufky > > > > Joe, nice optimization - thanks for that. > > > > With regards to Peter's patch, is this a digital-only tuner, or is it > > a hybrid tuner? > > > > The 5th byte that you send to the THOMSON DTT7546X seems to resemble > > the 'auxiliary byte' that gets set in tuner-simple.c > > > > I'm not sure that dvb-pll is the right place for this tuner > > definition, if this is the case. Maybe this definition belongs in > > tuner-simple instead, if the pattern matches better there. > > > > Mauro, can we hold off on merging Peter's patch until we resolve this? > > This code block, specifically, I would rather not see added into dvb-pll: > > +static int dvb_pll_get_num_regs(struct dvb_pll_priv *priv) > +{ > + int num_regs = 4; > + > + if (strncmp(priv->pll_desc->name, "Thomson dtt7546x", 16) == 0) > + num_regs = 5; > + > + return num_regs; > +} > + > > tuner-simple provides an infrastructure that allows this tuner to be > added in a more elegant way without the need to add special cases to > otherwise generic code, as done in the above. > > I'm sorry, Peter. Can you take a look at tuner-simple and consider > sending a new patch? Yes sure. I wasn't actually aware that tuner-simple existed. From what I can see briefly looking at it, it does look a more suitable way of adding support for this tuner. The dtt7546x is a dual tuner in that it supports dvb-t and dvb-c, however I have only tested it with DVB-T as that is the only feed I have to my home office. As I have a V2 incorporating all of Mauro's changes ready to send, and I'm on holiday for 3 weeks from Friday, I will temporarily drop support for this tuner and NIM card in V2, and migrate over to the new driver when I return end of August. regards, Peter. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 02/12] [media] dvb-pll: Add support for THOMSON DTT7546X tuner.
Hi Michael, On Thu, 30 Jul 2015, Michael Ira Krufky wrote: > On Thu, Jul 30, 2015 at 7:14 AM, Michael Ira Krufky > wrote: > > On Thu, Jul 30, 2015 at 6:08 AM, Joe Perches wrote: > >> On Thu, 2015-07-30 at 10:47 +0100, Peter Griffin wrote: > >>> Hi Mauro / Joe, > >>> > >>> On Wed, 22 Jul 2015, Mauro Carvalho Chehab wrote: > >>> > >>> > Em Wed, 24 Jun 2015 18:17:37 -0700 > >>> > Joe Perches escreveu: > >>> > > >>> > > On Wed, 2015-06-24 at 16:11 +0100, Peter Griffin wrote: > >>> > > > This is used in conjunction with the STV0367 demodulator on > >>> > > > the STV0367-NIM-V1.0 NIM card which can be used with the STi > >>> > > > STB SoC's. > >>> > > > >>> > > Barely associated to this specific patch, but for > >>> > > dvb-pll.c, another thing that seems possible is to > >>> > > convert the struct dvb_pll_desc uses to const and > >>> > > change the "entries" fixed array size from 12 to [] > >>> > > > >>> > > It'd save a couple KB overall and remove ~5KB of data. > >>> > > > >>> > > $ size drivers/media/dvb-frontends/dvb-pll.o* > >>> > >text data bss dec hex filename > >>> > >8520 15522120 121922fa0 > >>> > > drivers/media/dvb-frontends/dvb-pll.o.new > >>> > >5624 63632120 14107371b > >>> > > drivers/media/dvb-frontends/dvb-pll.o.old > >>> > > >>> > Peter, > >>> > > >>> > Please add this patch on the next patch series you submit. > >>> > >>> Ok will do, I've added this patch with a slightly updated commit message > >>> to my series. > >>> > >>> Joe - Can I add your signed-off-by? > >> > >> Signed-off-by: Joe Perches > > > > Reviewed-by: Michael Ira Krufky > > > > Joe, nice optimization - thanks for that. > > > > With regards to Peter's patch, is this a digital-only tuner, or is it > > a hybrid tuner? > > > > The 5th byte that you send to the THOMSON DTT7546X seems to resemble > > the 'auxiliary byte' that gets set in tuner-simple.c > > > > I'm not sure that dvb-pll is the right place for this tuner > > definition, if this is the case. Maybe this definition belongs in > > tuner-simple instead, if the pattern matches better there. > > > > Mauro, can we hold off on merging Peter's patch until we resolve this? > > > > -Michael Ira Krufky > > eek! I mispelled my own email address. > > > With regards to Joe's patch - I'd like to see that merged. ...and > here is my correctly spelled email address: > > > Reviewed-by: Michael Ira Krufky Ok I will add your reviewed-by and include it in my v2. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 02/12] [media] dvb-pll: Add support for THOMSON DTT7546X tuner.
On Thu, Jul 30, 2015 at 7:14 AM, Michael Ira Krufky wrote: > On Thu, Jul 30, 2015 at 6:08 AM, Joe Perches wrote: >> On Thu, 2015-07-30 at 10:47 +0100, Peter Griffin wrote: >>> Hi Mauro / Joe, >>> >>> On Wed, 22 Jul 2015, Mauro Carvalho Chehab wrote: >>> >>> > Em Wed, 24 Jun 2015 18:17:37 -0700 >>> > Joe Perches escreveu: >>> > >>> > > On Wed, 2015-06-24 at 16:11 +0100, Peter Griffin wrote: >>> > > > This is used in conjunction with the STV0367 demodulator on >>> > > > the STV0367-NIM-V1.0 NIM card which can be used with the STi >>> > > > STB SoC's. >>> > > >>> > > Barely associated to this specific patch, but for >>> > > dvb-pll.c, another thing that seems possible is to >>> > > convert the struct dvb_pll_desc uses to const and >>> > > change the "entries" fixed array size from 12 to [] >>> > > >>> > > It'd save a couple KB overall and remove ~5KB of data. >>> > > >>> > > $ size drivers/media/dvb-frontends/dvb-pll.o* >>> > >text data bss dec hex filename >>> > >8520 15522120 121922fa0 >>> > > drivers/media/dvb-frontends/dvb-pll.o.new >>> > >5624 63632120 14107371b >>> > > drivers/media/dvb-frontends/dvb-pll.o.old >>> > >>> > Peter, >>> > >>> > Please add this patch on the next patch series you submit. >>> >>> Ok will do, I've added this patch with a slightly updated commit message >>> to my series. >>> >>> Joe - Can I add your signed-off-by? >> >> Signed-off-by: Joe Perches > > Reviewed-by: Michael Ira Krufky > > Joe, nice optimization - thanks for that. > > With regards to Peter's patch, is this a digital-only tuner, or is it > a hybrid tuner? > > The 5th byte that you send to the THOMSON DTT7546X seems to resemble > the 'auxiliary byte' that gets set in tuner-simple.c > > I'm not sure that dvb-pll is the right place for this tuner > definition, if this is the case. Maybe this definition belongs in > tuner-simple instead, if the pattern matches better there. > > Mauro, can we hold off on merging Peter's patch until we resolve this? This code block, specifically, I would rather not see added into dvb-pll: +static int dvb_pll_get_num_regs(struct dvb_pll_priv *priv) +{ + int num_regs = 4; + + if (strncmp(priv->pll_desc->name, "Thomson dtt7546x", 16) == 0) + num_regs = 5; + + return num_regs; +} + tuner-simple provides an infrastructure that allows this tuner to be added in a more elegant way without the need to add special cases to otherwise generic code, as done in the above. I'm sorry, Peter. Can you take a look at tuner-simple and consider sending a new patch? -Michael Ira Krufky -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 02/12] [media] dvb-pll: Add support for THOMSON DTT7546X tuner.
On Thu, Jul 30, 2015 at 7:14 AM, Michael Ira Krufky wrote: > On Thu, Jul 30, 2015 at 6:08 AM, Joe Perches wrote: >> On Thu, 2015-07-30 at 10:47 +0100, Peter Griffin wrote: >>> Hi Mauro / Joe, >>> >>> On Wed, 22 Jul 2015, Mauro Carvalho Chehab wrote: >>> >>> > Em Wed, 24 Jun 2015 18:17:37 -0700 >>> > Joe Perches escreveu: >>> > >>> > > On Wed, 2015-06-24 at 16:11 +0100, Peter Griffin wrote: >>> > > > This is used in conjunction with the STV0367 demodulator on >>> > > > the STV0367-NIM-V1.0 NIM card which can be used with the STi >>> > > > STB SoC's. >>> > > >>> > > Barely associated to this specific patch, but for >>> > > dvb-pll.c, another thing that seems possible is to >>> > > convert the struct dvb_pll_desc uses to const and >>> > > change the "entries" fixed array size from 12 to [] >>> > > >>> > > It'd save a couple KB overall and remove ~5KB of data. >>> > > >>> > > $ size drivers/media/dvb-frontends/dvb-pll.o* >>> > >text data bss dec hex filename >>> > >8520 15522120 121922fa0 >>> > > drivers/media/dvb-frontends/dvb-pll.o.new >>> > >5624 63632120 14107371b >>> > > drivers/media/dvb-frontends/dvb-pll.o.old >>> > >>> > Peter, >>> > >>> > Please add this patch on the next patch series you submit. >>> >>> Ok will do, I've added this patch with a slightly updated commit message >>> to my series. >>> >>> Joe - Can I add your signed-off-by? >> >> Signed-off-by: Joe Perches > > Reviewed-by: Michael Ira Krufky > > Joe, nice optimization - thanks for that. > > With regards to Peter's patch, is this a digital-only tuner, or is it > a hybrid tuner? > > The 5th byte that you send to the THOMSON DTT7546X seems to resemble > the 'auxiliary byte' that gets set in tuner-simple.c > > I'm not sure that dvb-pll is the right place for this tuner > definition, if this is the case. Maybe this definition belongs in > tuner-simple instead, if the pattern matches better there. > > Mauro, can we hold off on merging Peter's patch until we resolve this? > > -Michael Ira Krufky eek! I mispelled my own email address. With regards to Joe's patch - I'd like to see that merged. ...and here is my correctly spelled email address: Reviewed-by: Michael Ira Krufky -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 02/12] [media] dvb-pll: Add support for THOMSON DTT7546X tuner.
On Thu, Jul 30, 2015 at 6:08 AM, Joe Perches wrote: > On Thu, 2015-07-30 at 10:47 +0100, Peter Griffin wrote: >> Hi Mauro / Joe, >> >> On Wed, 22 Jul 2015, Mauro Carvalho Chehab wrote: >> >> > Em Wed, 24 Jun 2015 18:17:37 -0700 >> > Joe Perches escreveu: >> > >> > > On Wed, 2015-06-24 at 16:11 +0100, Peter Griffin wrote: >> > > > This is used in conjunction with the STV0367 demodulator on >> > > > the STV0367-NIM-V1.0 NIM card which can be used with the STi >> > > > STB SoC's. >> > > >> > > Barely associated to this specific patch, but for >> > > dvb-pll.c, another thing that seems possible is to >> > > convert the struct dvb_pll_desc uses to const and >> > > change the "entries" fixed array size from 12 to [] >> > > >> > > It'd save a couple KB overall and remove ~5KB of data. >> > > >> > > $ size drivers/media/dvb-frontends/dvb-pll.o* >> > >text data bss dec hex filename >> > >8520 15522120 121922fa0 >> > > drivers/media/dvb-frontends/dvb-pll.o.new >> > >5624 63632120 14107371b >> > > drivers/media/dvb-frontends/dvb-pll.o.old >> > >> > Peter, >> > >> > Please add this patch on the next patch series you submit. >> >> Ok will do, I've added this patch with a slightly updated commit message >> to my series. >> >> Joe - Can I add your signed-off-by? > > Signed-off-by: Joe Perches Reviewed-by: Michael Ira Krufky Joe, nice optimization - thanks for that. With regards to Peter's patch, is this a digital-only tuner, or is it a hybrid tuner? The 5th byte that you send to the THOMSON DTT7546X seems to resemble the 'auxiliary byte' that gets set in tuner-simple.c I'm not sure that dvb-pll is the right place for this tuner definition, if this is the case. Maybe this definition belongs in tuner-simple instead, if the pattern matches better there. Mauro, can we hold off on merging Peter's patch until we resolve this? -Michael Ira Krufky -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 02/12] [media] dvb-pll: Add support for THOMSON DTT7546X tuner.
On Thu, 2015-07-30 at 10:47 +0100, Peter Griffin wrote: > Hi Mauro / Joe, > > On Wed, 22 Jul 2015, Mauro Carvalho Chehab wrote: > > > Em Wed, 24 Jun 2015 18:17:37 -0700 > > Joe Perches escreveu: > > > > > On Wed, 2015-06-24 at 16:11 +0100, Peter Griffin wrote: > > > > This is used in conjunction with the STV0367 demodulator on > > > > the STV0367-NIM-V1.0 NIM card which can be used with the STi > > > > STB SoC's. > > > > > > Barely associated to this specific patch, but for > > > dvb-pll.c, another thing that seems possible is to > > > convert the struct dvb_pll_desc uses to const and > > > change the "entries" fixed array size from 12 to [] > > > > > > It'd save a couple KB overall and remove ~5KB of data. > > > > > > $ size drivers/media/dvb-frontends/dvb-pll.o* > > >text data bss dec hex filename > > >8520 15522120 121922fa0 > > > drivers/media/dvb-frontends/dvb-pll.o.new > > >5624 63632120 14107371b > > > drivers/media/dvb-frontends/dvb-pll.o.old > > > > Peter, > > > > Please add this patch on the next patch series you submit. > > Ok will do, I've added this patch with a slightly updated commit message > to my series. > > Joe - Can I add your signed-off-by? Signed-off-by: Joe Perches -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 02/12] [media] dvb-pll: Add support for THOMSON DTT7546X tuner.
Hi Mauro / Joe, On Wed, 22 Jul 2015, Mauro Carvalho Chehab wrote: > Em Wed, 24 Jun 2015 18:17:37 -0700 > Joe Perches escreveu: > > > On Wed, 2015-06-24 at 16:11 +0100, Peter Griffin wrote: > > > This is used in conjunction with the STV0367 demodulator on > > > the STV0367-NIM-V1.0 NIM card which can be used with the STi > > > STB SoC's. > > > > Barely associated to this specific patch, but for > > dvb-pll.c, another thing that seems possible is to > > convert the struct dvb_pll_desc uses to const and > > change the "entries" fixed array size from 12 to [] > > > > It'd save a couple KB overall and remove ~5KB of data. > > > > $ size drivers/media/dvb-frontends/dvb-pll.o* > >textdata bss dec hex filename > >852015522120 121922fa0 > > drivers/media/dvb-frontends/dvb-pll.o.new > >562463632120 14107371b > > drivers/media/dvb-frontends/dvb-pll.o.old > > Peter, > > Please add this patch on the next patch series you submit. Ok will do, I've added this patch with a slightly updated commit message to my series. Joe - Can I add your signed-off-by? regards, Peter. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 02/12] [media] dvb-pll: Add support for THOMSON DTT7546X tuner.
Hi Mauro, On Wed, 22 Jul 2015, Mauro Carvalho Chehab wrote: > Em Wed, 24 Jun 2015 16:11:00 +0100 > Peter Griffin escreveu: > > > This is used in conjunction with the STV0367 demodulator on > > the STV0367-NIM-V1.0 NIM card which can be used with the STi > > STB SoC's. > > > > This tuner has a fifth register, so some changes have been made > > to accommodate this. > > > > Signed-off-by: Peter Griffin > > --- > > drivers/media/dvb-frontends/dvb-pll.c | 74 > > +-- > > drivers/media/dvb-frontends/dvb-pll.h | 1 + > > 2 files changed, 64 insertions(+), 11 deletions(-) > > > > diff --git a/drivers/media/dvb-frontends/dvb-pll.c > > b/drivers/media/dvb-frontends/dvb-pll.c > > index 6d8fe88..f7381c7 100644 > > --- a/drivers/media/dvb-frontends/dvb-pll.c > > +++ b/drivers/media/dvb-frontends/dvb-pll.c > > @@ -141,6 +141,35 @@ static struct dvb_pll_desc dvb_pll_thomson_dtt7520x = { > > }, > > }; > > > > +static void thomson_dtt7546x_bw(struct dvb_frontend *fe, u8 *buf) > > +{ > > + /* set CB2 reg - set ATC, XTO */ > > + buf[4] = 0xc3; > > +} > > + > > +static struct dvb_pll_desc dvb_pll_thomson_dtt7546x = { > > + .name = "Thomson dtt7546x", > > + .min = 4425, > > + .max = 86325, > > + .set = thomson_dtt7546x_bw, > > + .iffreq= 3617, > > Whitespace is missing. Please check the patchs with scripts/checkpatch.pl. Will fix in V2. regards, Peter. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 02/12] [media] dvb-pll: Add support for THOMSON DTT7546X tuner.
Em Wed, 24 Jun 2015 18:17:37 -0700 Joe Perches escreveu: > On Wed, 2015-06-24 at 16:11 +0100, Peter Griffin wrote: > > This is used in conjunction with the STV0367 demodulator on > > the STV0367-NIM-V1.0 NIM card which can be used with the STi > > STB SoC's. > > Barely associated to this specific patch, but for > dvb-pll.c, another thing that seems possible is to > convert the struct dvb_pll_desc uses to const and > change the "entries" fixed array size from 12 to [] > > It'd save a couple KB overall and remove ~5KB of data. > > $ size drivers/media/dvb-frontends/dvb-pll.o* >text data bss dec hex filename >8520 15522120 121922fa0 > drivers/media/dvb-frontends/dvb-pll.o.new >5624 63632120 14107371b > drivers/media/dvb-frontends/dvb-pll.o.old Peter, Please add this patch on the next patch series you submit. Regards, Mauro > --- > drivers/media/dvb-frontends/dvb-pll.c | 50 > +-- > 1 file changed, 25 insertions(+), 25 deletions(-) > > diff --git a/drivers/media/dvb-frontends/dvb-pll.c > b/drivers/media/dvb-frontends/dvb-pll.c > index 6d8fe88..53089e1 100644 > --- a/drivers/media/dvb-frontends/dvb-pll.c > +++ b/drivers/media/dvb-frontends/dvb-pll.c > @@ -34,7 +34,7 @@ struct dvb_pll_priv { > struct i2c_adapter *i2c; > > /* the PLL descriptor */ > - struct dvb_pll_desc *pll_desc; > + const struct dvb_pll_desc *pll_desc; > > /* cached frequency/bandwidth */ > u32 frequency; > @@ -57,7 +57,7 @@ MODULE_PARM_DESC(id, "force pll id to use (DEBUG ONLY)"); > /* --- */ > > struct dvb_pll_desc { > - char *name; > + const char *name; > u32 min; > u32 max; > u32 iffreq; > @@ -71,13 +71,13 @@ struct dvb_pll_desc { > u32 stepsize; > u8 config; > u8 cb; > - } entries[12]; > + } entries[]; > }; > > /* --- */ > /* descriptions*/ > > -static struct dvb_pll_desc dvb_pll_thomson_dtt7579 = { > +static const struct dvb_pll_desc dvb_pll_thomson_dtt7579 = { > .name = "Thomson dtt7579", > .min = 17700, > .max = 85800, > @@ -99,7 +99,7 @@ static void thomson_dtt759x_bw(struct dvb_frontend *fe, u8 > *buf) > buf[3] |= 0x10; > } > > -static struct dvb_pll_desc dvb_pll_thomson_dtt759x = { > +static const struct dvb_pll_desc dvb_pll_thomson_dtt759x = { > .name = "Thomson dtt759x", > .min = 17700, > .max = 89600, > @@ -123,7 +123,7 @@ static void thomson_dtt7520x_bw(struct dvb_frontend *fe, > u8 *buf) > buf[3] ^= 0x10; > } > > -static struct dvb_pll_desc dvb_pll_thomson_dtt7520x = { > +static const struct dvb_pll_desc dvb_pll_thomson_dtt7520x = { > .name = "Thomson dtt7520x", > .min = 18500, > .max = 9, > @@ -141,7 +141,7 @@ static struct dvb_pll_desc dvb_pll_thomson_dtt7520x = { > }, > }; > > -static struct dvb_pll_desc dvb_pll_lg_z201 = { > +static const struct dvb_pll_desc dvb_pll_lg_z201 = { > .name = "LG z201", > .min = 17400, > .max = 86200, > @@ -157,7 +157,7 @@ static struct dvb_pll_desc dvb_pll_lg_z201 = { > }, > }; > > -static struct dvb_pll_desc dvb_pll_unknown_1 = { > +static const struct dvb_pll_desc dvb_pll_unknown_1 = { > .name = "unknown 1", /* used by dntv live dvb-t */ > .min = 17400, > .max = 86200, > @@ -179,7 +179,7 @@ static struct dvb_pll_desc dvb_pll_unknown_1 = { > /* Infineon TUA6010XS > * used in Thomson Cable Tuner > */ > -static struct dvb_pll_desc dvb_pll_tua6010xs = { > +static const struct dvb_pll_desc dvb_pll_tua6010xs = { > .name = "Infineon TUA6010XS", > .min = 4425, > .max = 85800, > @@ -193,7 +193,7 @@ static struct dvb_pll_desc dvb_pll_tua6010xs = { > }; > > /* Panasonic env57h1xd5 (some Philips PLL ?) */ > -static struct dvb_pll_desc dvb_pll_env57h1xd5 = { > +static const struct dvb_pll_desc dvb_pll_env57h1xd5 = { > .name = "Panasonic ENV57H1XD5", > .min = 4425, > .max = 85800, > @@ -217,7 +217,7 @@ static void tda665x_bw(struct dvb_frontend *fe, u8 *buf) > buf[3] |= 0x08; > } > > -static struct dvb_pll_desc dvb_pll_tda665x = { > +static const struct dvb_pll_desc dvb_pll_tda665x = { > .name = "Philips TDA6650/TDA6651", > .min = 4425, > .max = 85800, > @@ -251,7 +251,7 @@ static void tua6034_bw(struct dvb_frontend *fe, u8 *buf) > buf[3] |= 0x08; > } > > -static struct dvb_pll_desc dvb_pll_tua6034 = { > +static const struct dvb_pll_desc dvb_pll_tua6034 = { > .name = "Infineon TUA6034", > .min = 4425, > .max = 85800, > @@ -275,7 +2
Re: [PATCH 02/12] [media] dvb-pll: Add support for THOMSON DTT7546X tuner.
Em Wed, 24 Jun 2015 16:11:00 +0100 Peter Griffin escreveu: > This is used in conjunction with the STV0367 demodulator on > the STV0367-NIM-V1.0 NIM card which can be used with the STi > STB SoC's. > > This tuner has a fifth register, so some changes have been made > to accommodate this. > > Signed-off-by: Peter Griffin > --- > drivers/media/dvb-frontends/dvb-pll.c | 74 > +-- > drivers/media/dvb-frontends/dvb-pll.h | 1 + > 2 files changed, 64 insertions(+), 11 deletions(-) > > diff --git a/drivers/media/dvb-frontends/dvb-pll.c > b/drivers/media/dvb-frontends/dvb-pll.c > index 6d8fe88..f7381c7 100644 > --- a/drivers/media/dvb-frontends/dvb-pll.c > +++ b/drivers/media/dvb-frontends/dvb-pll.c > @@ -141,6 +141,35 @@ static struct dvb_pll_desc dvb_pll_thomson_dtt7520x = { > }, > }; > > +static void thomson_dtt7546x_bw(struct dvb_frontend *fe, u8 *buf) > +{ > + /* set CB2 reg - set ATC, XTO */ > + buf[4] = 0xc3; > +} > + > +static struct dvb_pll_desc dvb_pll_thomson_dtt7546x = { > + .name = "Thomson dtt7546x", > + .min = 4425, > + .max = 86325, > + .set = thomson_dtt7546x_bw, > + .iffreq= 3617, Whitespace is missing. Please check the patchs with scripts/checkpatch.pl. > + .count = 12, > + .entries = { > + { 12100, 17, 0x88, 0x01 }, > + { 14100, 17, 0x88, 0x41 }, > + { 16600, 17, 0x88, 0x81 }, > + { 18200, 17, 0x88, 0xc1 }, > + { 28600, 17, 0x88, 0x02 }, > + { 38600, 17, 0x88, 0x42 }, > + { 44600, 17, 0x88, 0x82 }, > + { 46600, 17, 0x88, 0xc2 }, > + { 50600, 17, 0x88, 0x08 }, > + { 76100, 17, 0x88, 0x48 }, > + { 84600, 17, 0x88, 0x88 }, > + { 90500, 17, 0x88, 0xc8 }, > + }, > +}; > + > static struct dvb_pll_desc dvb_pll_lg_z201 = { > .name = "LG z201", > .min = 17400, > @@ -537,6 +566,7 @@ static struct dvb_pll_desc dvb_pll_alps_tdee4 = { > static struct dvb_pll_desc *pll_list[] = { > [DVB_PLL_UNDEFINED] = NULL, > [DVB_PLL_THOMSON_DTT7579]= &dvb_pll_thomson_dtt7579, > + [DVB_PLL_THOMSON_DTT7546X] = &dvb_pll_thomson_dtt7546x, > [DVB_PLL_THOMSON_DTT759X]= &dvb_pll_thomson_dtt759x, > [DVB_PLL_THOMSON_DTT7520X] = &dvb_pll_thomson_dtt7520x, > [DVB_PLL_LG_Z201]= &dvb_pll_lg_z201, > @@ -561,7 +591,7 @@ static struct dvb_pll_desc *pll_list[] = { > /* code*/ > > static int dvb_pll_configure(struct dvb_frontend *fe, u8 *buf, > - const u32 frequency) > + const u32 frequency, const u32 len) > { > struct dvb_pll_priv *priv = fe->tuner_priv; > struct dvb_pll_desc *desc = priv->pll_desc; > @@ -593,11 +623,15 @@ static int dvb_pll_configure(struct dvb_frontend *fe, > u8 *buf, > if (desc->set) > desc->set(fe, buf); > > - if (debug) > - printk("pll: %s: div=%d | buf=0x%02x,0x%02x,0x%02x,0x%02x\n", > -desc->name, div, buf[0], buf[1], buf[2], buf[3]); > + if (debug) { > + printk(KERN_DEBUG "pll: %s: div=%d | buf=", desc->name, div); > + for (i = 0; i < len; i++) > + printk(KERN_DEBUG "0x%02x,", buf[i]); > > - // calculate the frequency we set it to > + printk(KERN_DEBUG "\n"); > + } Please use, instead, the Documentation/printk-formats.txt macros to print an hex buffer: "Raw buffer as a hex string: %*ph00 01 02 ... 3f %*phC 00:01:02: ... :3f %*phD 00-01-02- ... -3f %*phN 000102 ... 3f" > + > + /* calculate the frequency we set it to */ > return (div * desc->entries[i].stepsize) - desc->iffreq; > } > > @@ -634,21 +668,39 @@ static int dvb_pll_sleep(struct dvb_frontend *fe) > return -EINVAL; > } > > +static int dvb_pll_get_num_regs(struct dvb_pll_priv *priv) > +{ > + int num_regs = 4; > + > + if (strncmp(priv->pll_desc->name, "Thomson dtt7546x", 16) == 0) > + num_regs = 5; > + > + return num_regs; > +} > + > static int dvb_pll_set_params(struct dvb_frontend *fe) > { > struct dtv_frontend_properties *c = &fe->dtv_property_cache; > struct dvb_pll_priv *priv = fe->tuner_priv; > - u8 buf[4]; > - struct i2c_msg msg = > - { .addr = priv->pll_i2c_address, .flags = 0, > - .buf = buf, .len = sizeof(buf) }; > + struct i2c_msg msg; > + u8 *bufp; > int result; > u32 frequency = 0; > > + bufp = kzalloc(dvb_pll_get_num_regs(priv), GFP_KERNEL); > + > + if (!bufp) > + return -ENOMEM; > + > + msg.addr = priv->pll_i2c_
Re: [PATCH 02/12] [media] dvb-pll: Add support for THOMSON DTT7546X tuner.
On Wed, 2015-06-24 at 16:11 +0100, Peter Griffin wrote: > This is used in conjunction with the STV0367 demodulator on > the STV0367-NIM-V1.0 NIM card which can be used with the STi > STB SoC's. Barely associated to this specific patch, but for dvb-pll.c, another thing that seems possible is to convert the struct dvb_pll_desc uses to const and change the "entries" fixed array size from 12 to [] It'd save a couple KB overall and remove ~5KB of data. $ size drivers/media/dvb-frontends/dvb-pll.o* textdata bss dec hex filename 852015522120 121922fa0 drivers/media/dvb-frontends/dvb-pll.o.new 562463632120 14107371b drivers/media/dvb-frontends/dvb-pll.o.old --- drivers/media/dvb-frontends/dvb-pll.c | 50 +-- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/drivers/media/dvb-frontends/dvb-pll.c b/drivers/media/dvb-frontends/dvb-pll.c index 6d8fe88..53089e1 100644 --- a/drivers/media/dvb-frontends/dvb-pll.c +++ b/drivers/media/dvb-frontends/dvb-pll.c @@ -34,7 +34,7 @@ struct dvb_pll_priv { struct i2c_adapter *i2c; /* the PLL descriptor */ - struct dvb_pll_desc *pll_desc; + const struct dvb_pll_desc *pll_desc; /* cached frequency/bandwidth */ u32 frequency; @@ -57,7 +57,7 @@ MODULE_PARM_DESC(id, "force pll id to use (DEBUG ONLY)"); /* --- */ struct dvb_pll_desc { - char *name; + const char *name; u32 min; u32 max; u32 iffreq; @@ -71,13 +71,13 @@ struct dvb_pll_desc { u32 stepsize; u8 config; u8 cb; - } entries[12]; + } entries[]; }; /* --- */ /* descriptions*/ -static struct dvb_pll_desc dvb_pll_thomson_dtt7579 = { +static const struct dvb_pll_desc dvb_pll_thomson_dtt7579 = { .name = "Thomson dtt7579", .min = 17700, .max = 85800, @@ -99,7 +99,7 @@ static void thomson_dtt759x_bw(struct dvb_frontend *fe, u8 *buf) buf[3] |= 0x10; } -static struct dvb_pll_desc dvb_pll_thomson_dtt759x = { +static const struct dvb_pll_desc dvb_pll_thomson_dtt759x = { .name = "Thomson dtt759x", .min = 17700, .max = 89600, @@ -123,7 +123,7 @@ static void thomson_dtt7520x_bw(struct dvb_frontend *fe, u8 *buf) buf[3] ^= 0x10; } -static struct dvb_pll_desc dvb_pll_thomson_dtt7520x = { +static const struct dvb_pll_desc dvb_pll_thomson_dtt7520x = { .name = "Thomson dtt7520x", .min = 18500, .max = 9, @@ -141,7 +141,7 @@ static struct dvb_pll_desc dvb_pll_thomson_dtt7520x = { }, }; -static struct dvb_pll_desc dvb_pll_lg_z201 = { +static const struct dvb_pll_desc dvb_pll_lg_z201 = { .name = "LG z201", .min = 17400, .max = 86200, @@ -157,7 +157,7 @@ static struct dvb_pll_desc dvb_pll_lg_z201 = { }, }; -static struct dvb_pll_desc dvb_pll_unknown_1 = { +static const struct dvb_pll_desc dvb_pll_unknown_1 = { .name = "unknown 1", /* used by dntv live dvb-t */ .min = 17400, .max = 86200, @@ -179,7 +179,7 @@ static struct dvb_pll_desc dvb_pll_unknown_1 = { /* Infineon TUA6010XS * used in Thomson Cable Tuner */ -static struct dvb_pll_desc dvb_pll_tua6010xs = { +static const struct dvb_pll_desc dvb_pll_tua6010xs = { .name = "Infineon TUA6010XS", .min = 4425, .max = 85800, @@ -193,7 +193,7 @@ static struct dvb_pll_desc dvb_pll_tua6010xs = { }; /* Panasonic env57h1xd5 (some Philips PLL ?) */ -static struct dvb_pll_desc dvb_pll_env57h1xd5 = { +static const struct dvb_pll_desc dvb_pll_env57h1xd5 = { .name = "Panasonic ENV57H1XD5", .min = 4425, .max = 85800, @@ -217,7 +217,7 @@ static void tda665x_bw(struct dvb_frontend *fe, u8 *buf) buf[3] |= 0x08; } -static struct dvb_pll_desc dvb_pll_tda665x = { +static const struct dvb_pll_desc dvb_pll_tda665x = { .name = "Philips TDA6650/TDA6651", .min = 4425, .max = 85800, @@ -251,7 +251,7 @@ static void tua6034_bw(struct dvb_frontend *fe, u8 *buf) buf[3] |= 0x08; } -static struct dvb_pll_desc dvb_pll_tua6034 = { +static const struct dvb_pll_desc dvb_pll_tua6034 = { .name = "Infineon TUA6034", .min = 4425, .max = 85800, @@ -275,7 +275,7 @@ static void tded4_bw(struct dvb_frontend *fe, u8 *buf) buf[3] |= 0x04; } -static struct dvb_pll_desc dvb_pll_tded4 = { +static const struct dvb_pll_desc dvb_pll_tded4 = { .name = "ALPS TDED4", .min = 4700, .max = 86300, @@ -293,7 +293,7 @@ static struct dvb_pll_desc dvb_pll_tded4
[PATCH 02/12] [media] dvb-pll: Add support for THOMSON DTT7546X tuner.
This is used in conjunction with the STV0367 demodulator on the STV0367-NIM-V1.0 NIM card which can be used with the STi STB SoC's. This tuner has a fifth register, so some changes have been made to accommodate this. Signed-off-by: Peter Griffin --- drivers/media/dvb-frontends/dvb-pll.c | 74 +-- drivers/media/dvb-frontends/dvb-pll.h | 1 + 2 files changed, 64 insertions(+), 11 deletions(-) diff --git a/drivers/media/dvb-frontends/dvb-pll.c b/drivers/media/dvb-frontends/dvb-pll.c index 6d8fe88..f7381c7 100644 --- a/drivers/media/dvb-frontends/dvb-pll.c +++ b/drivers/media/dvb-frontends/dvb-pll.c @@ -141,6 +141,35 @@ static struct dvb_pll_desc dvb_pll_thomson_dtt7520x = { }, }; +static void thomson_dtt7546x_bw(struct dvb_frontend *fe, u8 *buf) +{ + /* set CB2 reg - set ATC, XTO */ + buf[4] = 0xc3; +} + +static struct dvb_pll_desc dvb_pll_thomson_dtt7546x = { + .name = "Thomson dtt7546x", + .min = 4425, + .max = 86325, + .set = thomson_dtt7546x_bw, + .iffreq= 3617, + .count = 12, + .entries = { + { 12100, 17, 0x88, 0x01 }, + { 14100, 17, 0x88, 0x41 }, + { 16600, 17, 0x88, 0x81 }, + { 18200, 17, 0x88, 0xc1 }, + { 28600, 17, 0x88, 0x02 }, + { 38600, 17, 0x88, 0x42 }, + { 44600, 17, 0x88, 0x82 }, + { 46600, 17, 0x88, 0xc2 }, + { 50600, 17, 0x88, 0x08 }, + { 76100, 17, 0x88, 0x48 }, + { 84600, 17, 0x88, 0x88 }, + { 90500, 17, 0x88, 0xc8 }, + }, +}; + static struct dvb_pll_desc dvb_pll_lg_z201 = { .name = "LG z201", .min = 17400, @@ -537,6 +566,7 @@ static struct dvb_pll_desc dvb_pll_alps_tdee4 = { static struct dvb_pll_desc *pll_list[] = { [DVB_PLL_UNDEFINED] = NULL, [DVB_PLL_THOMSON_DTT7579]= &dvb_pll_thomson_dtt7579, + [DVB_PLL_THOMSON_DTT7546X] = &dvb_pll_thomson_dtt7546x, [DVB_PLL_THOMSON_DTT759X]= &dvb_pll_thomson_dtt759x, [DVB_PLL_THOMSON_DTT7520X] = &dvb_pll_thomson_dtt7520x, [DVB_PLL_LG_Z201]= &dvb_pll_lg_z201, @@ -561,7 +591,7 @@ static struct dvb_pll_desc *pll_list[] = { /* code*/ static int dvb_pll_configure(struct dvb_frontend *fe, u8 *buf, -const u32 frequency) + const u32 frequency, const u32 len) { struct dvb_pll_priv *priv = fe->tuner_priv; struct dvb_pll_desc *desc = priv->pll_desc; @@ -593,11 +623,15 @@ static int dvb_pll_configure(struct dvb_frontend *fe, u8 *buf, if (desc->set) desc->set(fe, buf); - if (debug) - printk("pll: %s: div=%d | buf=0x%02x,0x%02x,0x%02x,0x%02x\n", - desc->name, div, buf[0], buf[1], buf[2], buf[3]); + if (debug) { + printk(KERN_DEBUG "pll: %s: div=%d | buf=", desc->name, div); + for (i = 0; i < len; i++) + printk(KERN_DEBUG "0x%02x,", buf[i]); - // calculate the frequency we set it to + printk(KERN_DEBUG "\n"); + } + + /* calculate the frequency we set it to */ return (div * desc->entries[i].stepsize) - desc->iffreq; } @@ -634,21 +668,39 @@ static int dvb_pll_sleep(struct dvb_frontend *fe) return -EINVAL; } +static int dvb_pll_get_num_regs(struct dvb_pll_priv *priv) +{ + int num_regs = 4; + + if (strncmp(priv->pll_desc->name, "Thomson dtt7546x", 16) == 0) + num_regs = 5; + + return num_regs; +} + static int dvb_pll_set_params(struct dvb_frontend *fe) { struct dtv_frontend_properties *c = &fe->dtv_property_cache; struct dvb_pll_priv *priv = fe->tuner_priv; - u8 buf[4]; - struct i2c_msg msg = - { .addr = priv->pll_i2c_address, .flags = 0, - .buf = buf, .len = sizeof(buf) }; + struct i2c_msg msg; + u8 *bufp; int result; u32 frequency = 0; + bufp = kzalloc(dvb_pll_get_num_regs(priv), GFP_KERNEL); + + if (!bufp) + return -ENOMEM; + + msg.addr = priv->pll_i2c_address; + msg.flags = 0; + msg.buf = bufp; + msg.len = dvb_pll_get_num_regs(priv); + if (priv->i2c == NULL) return -EINVAL; - result = dvb_pll_configure(fe, buf, c->frequency); + result = dvb_pll_configure(fe, bufp, c->frequency, msg.len); if (result < 0) return result; else @@ -677,7 +729,7 @@ static int dvb_pll_calc_regs(struct dvb_frontend *fe, if (buf_len < 5) return -EINVAL; - result = dvb_pll_configure(fe, buf + 1, c->f