Re: [PATCH v4 1/5] rtl2832 ver. 0.4: removed signal statistics
On 18.05.2012 20:46, Thomas Mair wrote: On 18.05.2012 15:26, poma wrote: On 05/18/2012 02:38 PM, Antti Palosaari wrote: On 18.05.2012 13:38, poma wrote: […] printk(KERN_ERR LOG_PREFIX": " f "\n" , ## arg) pr_err(LOG_PREFIX": " f "\n" , ## arg) printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg) pr_info(LOG_PREFIX": " f "\n" , ## arg) printk(KERN_WARNING LOG_PREFIX": " f "\n" , ## arg) pr_warn(LOG_PREFIX": " f "\n" , ## arg) Besides what 'checkpatch' suggest/output - Antti, is it a correct conversions? I haven't looked those pr_err/pr_info/pr_warn, but what I did for af9035/af9033 was I used pr_debug as a debug writings since it seems to be choice of today. I still suspect those pr_* functions should be used instead own macros. Currently documentation mentions only pr_debug and pr_info. regards Antit OK, thanks Antti! Thomas, dropping 'rtl2832_priv.h.diff'& 'rtl2832_priv.h-v2.diff' Please leave 'rtl2832_priv.h' as it is. And there you go… cheers, poma Alright. One last question though. I seem incapable of removing the checkpatch error with the parentheses. How should that be done properly? Should do something like do { ... } while(0) or is there a more elegant solution? I have seen that do { ... } while(0) many times in Kernel sources so it is likely the proper solution. regards Antti -- http://palosaari.fi/ -- 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 v4 1/5] rtl2832 ver. 0.4: removed signal statistics
On 18.05.2012 15:26, poma wrote: > On 05/18/2012 02:38 PM, Antti Palosaari wrote: >> On 18.05.2012 13:38, poma wrote: >>> […] >>> >>> printk(KERN_ERR LOG_PREFIX": " f "\n" , ## arg) >>> pr_err(LOG_PREFIX": " f "\n" , ## arg) >>> >>> printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg) >>> pr_info(LOG_PREFIX": " f "\n" , ## arg) >>> >>> printk(KERN_WARNING LOG_PREFIX": " f "\n" , ## arg) >>> pr_warn(LOG_PREFIX": " f "\n" , ## arg) >>> >>> Besides what 'checkpatch' suggest/output - Antti, is it a correct >>> conversions? >> >> >> I haven't looked those pr_err/pr_info/pr_warn, but what I did for >> af9035/af9033 was I used pr_debug as a debug writings since it seems to >> be choice of today. >> >> I still suspect those pr_* functions should be used instead own macros. >> Currently documentation mentions only pr_debug and pr_info. >> >> regards >> Antit > > OK, thanks Antti! > Thomas, dropping 'rtl2832_priv.h.diff' & 'rtl2832_priv.h-v2.diff' > Please leave 'rtl2832_priv.h' as it is. > And there you go… > > cheers, > poma Alright. One last question though. I seem incapable of removing the checkpatch error with the parentheses. How should that be done properly? Should do something like do { ... } while(0) or is there a more elegant solution? Regrads Thomas -- 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 v4 1/5] rtl2832 ver. 0.4: removed signal statistics
On 05/18/2012 02:38 PM, Antti Palosaari wrote: > On 18.05.2012 13:38, poma wrote: >> […] >> >> printk(KERN_ERR LOG_PREFIX": " f "\n" , ## arg) >> pr_err(LOG_PREFIX": " f "\n" , ## arg) >> >> printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg) >> pr_info(LOG_PREFIX": " f "\n" , ## arg) >> >> printk(KERN_WARNING LOG_PREFIX": " f "\n" , ## arg) >> pr_warn(LOG_PREFIX": " f "\n" , ## arg) >> >> Besides what 'checkpatch' suggest/output - Antti, is it a correct >> conversions? > > > I haven't looked those pr_err/pr_info/pr_warn, but what I did for > af9035/af9033 was I used pr_debug as a debug writings since it seems to > be choice of today. > > I still suspect those pr_* functions should be used instead own macros. > Currently documentation mentions only pr_debug and pr_info. > > regards > Antit OK, thanks Antti! Thomas, dropping 'rtl2832_priv.h.diff' & 'rtl2832_priv.h-v2.diff' Please leave 'rtl2832_priv.h' as it is. And there you go… cheers, poma -- 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 v4 1/5] rtl2832 ver. 0.4: removed signal statistics
On 18.05.2012 13:38, poma wrote: […] printk(KERN_ERR LOG_PREFIX": " f "\n" , ## arg) pr_err(LOG_PREFIX": " f "\n" , ## arg) printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg) pr_info(LOG_PREFIX": " f "\n" , ## arg) printk(KERN_WARNING LOG_PREFIX": " f "\n" , ## arg) pr_warn(LOG_PREFIX": " f "\n" , ## arg) Besides what 'checkpatch' suggest/output - Antti, is it a correct conversions? I haven't looked those pr_err/pr_info/pr_warn, but what I did for af9035/af9033 was I used pr_debug as a debug writings since it seems to be choice of today. I still suspect those pr_* functions should be used instead own macros. Currently documentation mentions only pr_debug and pr_info. regards Antit -- http://palosaari.fi/ -- 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 v4 1/5] rtl2832 ver. 0.4: removed signal statistics
[…] printk(KERN_ERR LOG_PREFIX": " f "\n" , ## arg) pr_err(LOG_PREFIX": " f "\n" , ## arg) printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg) pr_info(LOG_PREFIX": " f "\n" , ## arg) printk(KERN_WARNING LOG_PREFIX": " f "\n" , ## arg) pr_warn(LOG_PREFIX": " f "\n" , ## arg) Besides what 'checkpatch' suggest/output - Antti, is it a correct conversions? cheers, poma --- rtl2832_priv.h.orig 2012-05-18 02:02:48.561114101 +0200 +++ rtl2832_priv.h 2012-05-18 12:20:45.0 +0200 @@ -29,13 +29,13 @@ #undef dbg #define dbg(f, arg...) \ if (rtl2832_debug) \ - printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg) + pr_info(LOG_PREFIX": " f "\n" , ## arg) #undef err -#define err(f, arg...) printk(KERN_ERR LOG_PREFIX": " f "\n" , ## arg) +#define err(f, arg...) pr_err(LOG_PREFIX": " f "\n" , ## arg) #undef info -#define info(f, arg...) printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg) +#define info(f, arg...) pr_info(LOG_PREFIX": " f "\n" , ## arg) #undef warn -#define warn(f, arg...) printk(KERN_WARNING LOG_PREFIX": " f "\n" , ## arg) +#define warn(f, arg...) pr_warn(LOG_PREFIX": " f "\n" , ## arg) struct rtl2832_priv { struct i2c_adapter *i2c;
Re: [PATCH v4 1/5] rtl2832 ver. 0.4: removed signal statistics
On 05/17/2012 04:19 PM, Antti Palosaari wrote: > Moikka Thomas, > > Here is the review. See comments below. > > And conclusion is that it is ready for the Kernel merge. I did not see > any big functiuonality problems - only some small issues that are likely > considered as a coding style etc. Feel free to fix those and sent new > patc serie or just new patch top of that. > > Reviewed-by: Antti Palosaari > > > On 17.05.2012 01:13, Thomas Mair wrote: >> Changelog for ver. 0.3: >> - removed statistics as their calculation was wrong >> - fixed bug in Makefile >> - indentation and code style improvements >> >> Signed-off-by: Thomas Mair >> --- >> drivers/media/dvb/frontends/Kconfig|7 + >> drivers/media/dvb/frontends/Makefile |1 + >> drivers/media/dvb/frontends/rtl2832.c | 825 >> >> drivers/media/dvb/frontends/rtl2832.h | 74 +++ >> drivers/media/dvb/frontends/rtl2832_priv.h | 258 + >> 5 files changed, 1165 insertions(+), 0 deletions(-) >> create mode 100644 drivers/media/dvb/frontends/rtl2832.c >> create mode 100644 drivers/media/dvb/frontends/rtl2832.h >> create mode 100644 drivers/media/dvb/frontends/rtl2832_priv.h >> >> diff --git a/drivers/media/dvb/frontends/Kconfig >> b/drivers/media/dvb/frontends/Kconfig >> index f479834..f7d67d7 100644 >> --- a/drivers/media/dvb/frontends/Kconfig >> +++ b/drivers/media/dvb/frontends/Kconfig >> @@ -432,6 +432,13 @@ config DVB_RTL2830 >> help >> Say Y when you want to support this frontend. >> >> +config DVB_RTL2832 >> +tristate "Realtek RTL2832 DVB-T" >> +depends on DVB_CORE&& I2C >> +default m if DVB_FE_CUSTOMISE >> +help >> + Say Y when you want to support this frontend. >> + > > It is correct. > > Just for the comment as you said in cover letter that you are unsure > about that. > >> comment "DVB-C (cable) frontends" >> depends on DVB_CORE >> >> diff --git a/drivers/media/dvb/frontends/Makefile >> b/drivers/media/dvb/frontends/Makefile >> index b0381dc..bbf2955 100644 >> --- a/drivers/media/dvb/frontends/Makefile >> +++ b/drivers/media/dvb/frontends/Makefile >> @@ -98,6 +98,7 @@ obj-$(CONFIG_DVB_IT913X_FE) += it913x-fe.o >> obj-$(CONFIG_DVB_A8293) += a8293.o >> obj-$(CONFIG_DVB_TDA10071) += tda10071.o >> obj-$(CONFIG_DVB_RTL2830) += rtl2830.o >> +obj-$(CONFIG_DVB_RTL2830) += rtl2832.o >> obj-$(CONFIG_DVB_M88RS2000) += m88rs2000.o >> obj-$(CONFIG_DVB_AF9033) += af9033.o >> >> diff --git a/drivers/media/dvb/frontends/rtl2832.c >> b/drivers/media/dvb/frontends/rtl2832.c >> new file mode 100644 >> index 000..51c7927 >> --- /dev/null >> +++ b/drivers/media/dvb/frontends/rtl2832.c >> @@ -0,0 +1,825 @@ >> +/* >> + * Realtek RTL2832 DVB-T demodulator driver >> + * >> + * Copyright (C) 2012 Thomas Mair >> + * >> + *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., >> + *51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >> + */ >> + >> +#include "rtl2832_priv.h" >> + >> + >> +int rtl2832_debug; >> +module_param_named(debug, rtl2832_debug, int, 0644); >> +MODULE_PARM_DESC(debug, "Turn on/off frontend debugging >> (default:off)."); >> + >> + >> +static int reg_mask[32] = { > > This should be static const. > >> +0x0001, >> +0x0003, >> +0x0007, >> +0x000f, >> +0x001f, >> +0x003f, >> +0x007f, >> +0x00ff, >> +0x01ff, >> +0x03ff, >> +0x07ff, >> +0x0fff, >> +0x1fff, >> +0x3fff, >> +0x7fff, >> +0x, >> +0x0001, >> +0x0003, >> +0x0007, >> +0x000f, >> +0x001f, >> +0x003f, >> +0x007f, >> +0x00ff, >> +0x01ff, >> +0x03ff, >> +0x07ff, >> +0x0fff, >> +0x1fff, >> +0x3fff, >> +0x7fff, >> +0x >> +}; >> + >> +struct rtl2832_reg_entry registers[] = { > > static const struct > >> +[DVBT_SOFT_RST]= {0x1, 0x1, 2, 2}, >> +[DVBT_IIC_REPEAT]= {0x1, 0x1, 3, 3}, >> +[DVBT_TR_WAIT_MIN_8K]= {0x1, 0x88, 11, 2}, >> +[DVBT_RSD_BER_FAIL_VAL]= {0x1, 0x8f, 15, 0}, >> +[DVBT_EN_BK_TRK]= {0x1, 0xa6, 7, 7}, >> +[DVBT_AD_EN_REG]= {0x0, 0x8, 7, 7}, >> +
Re: [PATCH v4 1/5] rtl2832 ver. 0.4: removed signal statistics
On 05/17/2012 11:19 PM, Thomas Mair wrote: > On 17.05.2012 23:08, poma wrote: >> On 05/17/2012 10:45 PM, Thomas Mair wrote: >>> On 17.05.2012 22:41, Antti Palosaari wrote: On 17.05.2012 23:27, poma wrote: > On 05/17/2012 04:19 PM, Antti Palosaari wrote: >> Moikka Thomas, >> >> Here is the review. See comments below. >> >> And conclusion is that it is ready for the Kernel merge. I did not see >> any big functiuonality problems - only some small issues that are likely >> considered as a coding style etc. Feel free to fix those and sent new >> patc serie or just new patch top of that. >> >> Reviewed-by: Antti Palosaari [...] > rtl2832.c.diff: > - static int -> static const > - struct -> static const struct > - newline between function call and error check -> […] > - 5 indications apropos 'spaces' regarding 'CodingStyle'- line 206 > (/usr/share/doc/kernel-doc-3.3.5/Documentation/CodingStyle) > […] > Use one space around (on each side of) most binary and ternary operators, > such as any of these: > > = + -< > * / % |& ^<=>= == != ? : > > […] > > grep '>>\|<<' v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig > +len = (msb>> 3) + 1; > +reading_tmp |= reading[i]<< ((len-1-i)*8); > +*val = (reading_tmp>> lsb)& mask; > +len = (msb>> 3) + 1; > +reading_tmp |= reading[i]<< ((len-1-i)*8); > +writing_tmp = reading_tmp& ~(mask<< lsb); > +writing_tmp |= ((val& mask)<< lsb); > +writing[i] = (writing_tmp>> ((len-1-i)*8))& 0xff; > +num = bw_mode<< 20; > > Bitshift operators seems to be OK. > Something else? (len-1-i)*8 >>> I almost have a new corrected version of the patch series ready, fixing >>> this issues and the >>> other ones you mentioned. > - 1 indication apropos 'media/dvb/frontends/rtl2832_priv.h:30' > Compared to 'rtl2830_priv.h' seems to be OK. > > ./checkpatch.pl --no-tree > v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig > ERROR: Missing Signed-off-by: line(s) > > total: 1 errors, 0 warnings, 1177 lines checked > > v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig has style > problems, please review. If any of these errors > are false positives report them to the maintainer, see > CHECKPATCH in MAINTAINERS. > > How do you produce this error: > "ERROR: Macros with complex values should be enclosed in parenthesis…"? Just running checkpatch.pl --file foo >>> >>> For me checkpath.pl also does not report the error you reported. It does >>> seem >>> strange to me, as the makros are the same as in rtl2830_priv.h >>> >>> Regards >>> Thomas >> >> Yeah, 'rtl2830_priv.h' is the same. >> Fu… me, now I don't know too! >> :) >> >> cheers, >> poma > > Ok. I will then check the patches with the new checkpatch version tomorrow as > I need some > rest now ;) It should not be too difficult to remove the errors. > > Regards > Thomas Have a pleasant beauty sleep ;) cheers, poma ps. /usr/src/kernels/`uname -r`/scripts -- 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 v4 1/5] rtl2832 ver. 0.4: removed signal statistics
On 17.05.2012 23:08, poma wrote: > On 05/17/2012 10:45 PM, Thomas Mair wrote: >> On 17.05.2012 22:41, Antti Palosaari wrote: >>> On 17.05.2012 23:27, poma wrote: On 05/17/2012 04:19 PM, Antti Palosaari wrote: > Moikka Thomas, > > Here is the review. See comments below. > > And conclusion is that it is ready for the Kernel merge. I did not see > any big functiuonality problems - only some small issues that are likely > considered as a coding style etc. Feel free to fix those and sent new > patc serie or just new patch top of that. > > Reviewed-by: Antti Palosaari >>> >>> [...] >>> rtl2832.c.diff: - static int -> static const - struct -> static const struct - newline between function call and error check -> […] - 5 indications apropos 'spaces' regarding 'CodingStyle'- line 206 (/usr/share/doc/kernel-doc-3.3.5/Documentation/CodingStyle) […] Use one space around (on each side of) most binary and ternary operators, such as any of these: = + -< > * / % |& ^<=>= == != ? : […] grep '>>\|<<' v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig +len = (msb>> 3) + 1; +reading_tmp |= reading[i]<< ((len-1-i)*8); +*val = (reading_tmp>> lsb)& mask; +len = (msb>> 3) + 1; +reading_tmp |= reading[i]<< ((len-1-i)*8); +writing_tmp = reading_tmp& ~(mask<< lsb); +writing_tmp |= ((val& mask)<< lsb); +writing[i] = (writing_tmp>> ((len-1-i)*8))& 0xff; +num = bw_mode<< 20; Bitshift operators seems to be OK. Something else? >>> >>> (len-1-i)*8 >> I almost have a new corrected version of the patch series ready, fixing this >> issues and the >> other ones you mentioned. >>> - 1 indication apropos 'media/dvb/frontends/rtl2832_priv.h:30' Compared to 'rtl2830_priv.h' seems to be OK. ./checkpatch.pl --no-tree v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig ERROR: Missing Signed-off-by: line(s) total: 1 errors, 0 warnings, 1177 lines checked v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS. How do you produce this error: "ERROR: Macros with complex values should be enclosed in parenthesis…"? >>> >>> Just running checkpatch.pl --file foo >>> >> >> For me checkpath.pl also does not report the error you reported. It does seem >> strange to me, as the makros are the same as in rtl2830_priv.h >> >> Regards >> Thomas > > Yeah, 'rtl2830_priv.h' is the same. > Fu… me, now I don't know too! > :) > > cheers, > poma Ok. I will then check the patches with the new checkpatch version tomorrow as I need some rest now ;) It should not be too difficult to remove the errors. Regards Thomas -- 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 v4 1/5] rtl2832 ver. 0.4: removed signal statistics
On 05/17/2012 10:45 PM, Thomas Mair wrote: > On 17.05.2012 22:41, Antti Palosaari wrote: >> On 17.05.2012 23:27, poma wrote: >>> On 05/17/2012 04:19 PM, Antti Palosaari wrote: Moikka Thomas, Here is the review. See comments below. And conclusion is that it is ready for the Kernel merge. I did not see any big functiuonality problems - only some small issues that are likely considered as a coding style etc. Feel free to fix those and sent new patc serie or just new patch top of that. Reviewed-by: Antti Palosaari >> >> [...] >> >>> rtl2832.c.diff: >>> - static int -> static const >>> - struct -> static const struct >>> - newline between function call and error check -> […] >>> - 5 indications apropos 'spaces' regarding 'CodingStyle'- line 206 >>> (/usr/share/doc/kernel-doc-3.3.5/Documentation/CodingStyle) >>> […] >>> Use one space around (on each side of) most binary and ternary operators, >>> such as any of these: >>> >>> = + -< > * / % |& ^<=>= == != ? : >>> >>> […] >>> >>> grep '>>\|<<' v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig >>> +len = (msb>> 3) + 1; >>> +reading_tmp |= reading[i]<< ((len-1-i)*8); >>> +*val = (reading_tmp>> lsb)& mask; >>> +len = (msb>> 3) + 1; >>> +reading_tmp |= reading[i]<< ((len-1-i)*8); >>> +writing_tmp = reading_tmp& ~(mask<< lsb); >>> +writing_tmp |= ((val& mask)<< lsb); >>> +writing[i] = (writing_tmp>> ((len-1-i)*8))& 0xff; >>> +num = bw_mode<< 20; >>> >>> Bitshift operators seems to be OK. >>> Something else? >> >> (len-1-i)*8 > I almost have a new corrected version of the patch series ready, fixing this > issues and the > other ones you mentioned. >> >>> - 1 indication apropos 'media/dvb/frontends/rtl2832_priv.h:30' >>> Compared to 'rtl2830_priv.h' seems to be OK. >>> >>> ./checkpatch.pl --no-tree >>> v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig >>> ERROR: Missing Signed-off-by: line(s) >>> >>> total: 1 errors, 0 warnings, 1177 lines checked >>> >>> v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig has style >>> problems, please review. If any of these errors >>> are false positives report them to the maintainer, see >>> CHECKPATCH in MAINTAINERS. >>> >>> How do you produce this error: >>> "ERROR: Macros with complex values should be enclosed in parenthesis…"? >> >> Just running checkpatch.pl --file foo >> > > For me checkpath.pl also does not report the error you reported. It does seem > strange to me, as the makros are the same as in rtl2830_priv.h > > Regards > Thomas Yeah, 'rtl2830_priv.h' is the same. Fu… me, now I don't know too! :) cheers, poma -- 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 v4 1/5] rtl2832 ver. 0.4: removed signal statistics
On 05/17/2012 10:49 PM, Antti Palosaari wrote: > On 17.05.2012 23:45, Thomas Mair wrote: >> On 17.05.2012 22:41, Antti Palosaari wrote: >>> On 17.05.2012 23:27, poma wrote: On 05/17/2012 04:19 PM, Antti Palosaari wrote: > Moikka Thomas, > > Here is the review. See comments below. > > And conclusion is that it is ready for the Kernel merge. I did not see > any big functiuonality problems - only some small issues that are > likely > considered as a coding style etc. Feel free to fix those and sent new > patc serie or just new patch top of that. > > Reviewed-by: Antti Palosaari >>> >>> [...] >>> rtl2832.c.diff: - static int -> static const - struct -> static const struct - newline between function call and error check -> […] - 5 indications apropos 'spaces' regarding 'CodingStyle'- line 206 (/usr/share/doc/kernel-doc-3.3.5/Documentation/CodingStyle) […] Use one space around (on each side of) most binary and ternary operators, such as any of these: = + -<>* / % |&^<=>= == != ? : […] grep '>>\|<<' v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig +len = (msb>> 3) + 1; +reading_tmp |= reading[i]<< ((len-1-i)*8); +*val = (reading_tmp>> lsb)& mask; +len = (msb>> 3) + 1; +reading_tmp |= reading[i]<< ((len-1-i)*8); +writing_tmp = reading_tmp& ~(mask<< lsb); +writing_tmp |= ((val& mask)<< lsb); +writing[i] = (writing_tmp>> ((len-1-i)*8))& 0xff; +num = bw_mode<< 20; Bitshift operators seems to be OK. Something else? >>> >>> (len-1-i)*8 >> I almost have a new corrected version of the patch series ready, >> fixing this issues and the >> other ones you mentioned. >>> - 1 indication apropos 'media/dvb/frontends/rtl2832_priv.h:30' Compared to 'rtl2830_priv.h' seems to be OK. ./checkpatch.pl --no-tree v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig ERROR: Missing Signed-off-by: line(s) total: 1 errors, 0 warnings, 1177 lines checked v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS. How do you produce this error: "ERROR: Macros with complex values should be enclosed in parenthesis…"? >>> >>> Just running checkpatch.pl --file foo >>> >> >> For me checkpath.pl also does not report the error you reported. It >> does seem >> strange to me, as the makros are the same as in rtl2830_priv.h > > Are you using some old version of checkpatch.pl ? > Mine is: > commit c06a9ebdb7a4f4823d4225fe789d8c20a1d534eb > Author: Joe Perches > Date: Mon Apr 16 13:35:11 2012 -0600 > > If you are using older version then upgrade. checkpatch.pl is developed > very rapidly and there is all the time new checks. > > regards > Antti https://github.com/torvalds/linux/blob/master/scripts/checkpatch.pl ./checkpatch.pl --version Usage: checkpatch.pl [OPTION]... [FILE]... Version: 0.32 Options: -q, --quietquiet --no-tree run without a kernel tree --no-signoff do not check for 'Signed-off-by' line --patchtreat FILE as patchfile (default) --emacsemacs compile window format --terseone line per report -f, --file treat FILE as regular source file --subjective, --strict enable more subjective tests --ignore TYPE(,TYPE2...) ignore various comma separated message types --show-types show the message "types" in the output --root=PATHPATH to the kernel tree root --no-summary suppress the per-file summary --mailback only produce a report in case of warnings/errors --summary-file include the filename in summary --debug KEY=[0|1] turn on/off debugging of KEY, where KEY is one of 'values', 'possible', 'type', and 'attr' (default is all off) --test-only=WORD report only warnings/errors containing WORD literally -h, --help, --version display this help and exit When FILE is - read standard input. ./checkpatch.pl --no-tree v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig ERROR: Macros with complex values should be enclosed in parenthesis #977: FILE: drivers/media/dvb/frontends/rtl2832_priv.h:30: +#define dbg(f, arg...) \ + if (rtl2832_debug) \ + printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg) ERROR: Missing Signed-off-by: line(s) total: 2 errors, 0 warnings, 1177 lines checked v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig has sty
Re: [PATCH v4 1/5] rtl2832 ver. 0.4: removed signal statistics
On 17.05.2012 23:45, Thomas Mair wrote: On 17.05.2012 22:41, Antti Palosaari wrote: On 17.05.2012 23:27, poma wrote: On 05/17/2012 04:19 PM, Antti Palosaari wrote: Moikka Thomas, Here is the review. See comments below. And conclusion is that it is ready for the Kernel merge. I did not see any big functiuonality problems - only some small issues that are likely considered as a coding style etc. Feel free to fix those and sent new patc serie or just new patch top of that. Reviewed-by: Antti Palosaari [...] rtl2832.c.diff: - static int -> static const - struct -> static const struct - newline between function call and error check -> […] - 5 indications apropos 'spaces' regarding 'CodingStyle'- line 206 (/usr/share/doc/kernel-doc-3.3.5/Documentation/CodingStyle) […] Use one space around (on each side of) most binary and ternary operators, such as any of these: = + -<>* / % |&^<=>= == != ? : […] grep '>>\|<<' v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig +len = (msb>> 3) + 1; +reading_tmp |= reading[i]<< ((len-1-i)*8); +*val = (reading_tmp>> lsb)& mask; +len = (msb>> 3) + 1; +reading_tmp |= reading[i]<< ((len-1-i)*8); +writing_tmp = reading_tmp& ~(mask<< lsb); +writing_tmp |= ((val& mask)<< lsb); +writing[i] = (writing_tmp>> ((len-1-i)*8))& 0xff; +num = bw_mode<< 20; Bitshift operators seems to be OK. Something else? (len-1-i)*8 I almost have a new corrected version of the patch series ready, fixing this issues and the other ones you mentioned. - 1 indication apropos 'media/dvb/frontends/rtl2832_priv.h:30' Compared to 'rtl2830_priv.h' seems to be OK. ./checkpatch.pl --no-tree v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig ERROR: Missing Signed-off-by: line(s) total: 1 errors, 0 warnings, 1177 lines checked v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS. How do you produce this error: "ERROR: Macros with complex values should be enclosed in parenthesis…"? Just running checkpatch.pl --file foo For me checkpath.pl also does not report the error you reported. It does seem strange to me, as the makros are the same as in rtl2830_priv.h Are you using some old version of checkpatch.pl ? Mine is: commit c06a9ebdb7a4f4823d4225fe789d8c20a1d534eb Author: Joe Perches Date: Mon Apr 16 13:35:11 2012 -0600 If you are using older version then upgrade. checkpatch.pl is developed very rapidly and there is all the time new checks. regards Antti -- http://palosaari.fi/ -- 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 v4 1/5] rtl2832 ver. 0.4: removed signal statistics
On 17.05.2012 22:41, Antti Palosaari wrote: > On 17.05.2012 23:27, poma wrote: >> On 05/17/2012 04:19 PM, Antti Palosaari wrote: >>> Moikka Thomas, >>> >>> Here is the review. See comments below. >>> >>> And conclusion is that it is ready for the Kernel merge. I did not see >>> any big functiuonality problems - only some small issues that are likely >>> considered as a coding style etc. Feel free to fix those and sent new >>> patc serie or just new patch top of that. >>> >>> Reviewed-by: Antti Palosaari > > [...] > >> rtl2832.c.diff: >> - static int -> static const >> - struct -> static const struct >> - newline between function call and error check -> […] >> - 5 indications apropos 'spaces' regarding 'CodingStyle'- line 206 >> (/usr/share/doc/kernel-doc-3.3.5/Documentation/CodingStyle) >> […] >> Use one space around (on each side of) most binary and ternary operators, >> such as any of these: >> >> = + -< > * / % |& ^<=>= == != ? : >> >> […] >> >> grep '>>\|<<' v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig >> +len = (msb>> 3) + 1; >> +reading_tmp |= reading[i]<< ((len-1-i)*8); >> +*val = (reading_tmp>> lsb)& mask; >> +len = (msb>> 3) + 1; >> +reading_tmp |= reading[i]<< ((len-1-i)*8); >> +writing_tmp = reading_tmp& ~(mask<< lsb); >> +writing_tmp |= ((val& mask)<< lsb); >> +writing[i] = (writing_tmp>> ((len-1-i)*8))& 0xff; >> +num = bw_mode<< 20; >> >> Bitshift operators seems to be OK. >> Something else? > > (len-1-i)*8 I almost have a new corrected version of the patch series ready, fixing this issues and the other ones you mentioned. > >> - 1 indication apropos 'media/dvb/frontends/rtl2832_priv.h:30' >> Compared to 'rtl2830_priv.h' seems to be OK. >> >> ./checkpatch.pl --no-tree >> v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig >> ERROR: Missing Signed-off-by: line(s) >> >> total: 1 errors, 0 warnings, 1177 lines checked >> >> v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig has style >> problems, please review. If any of these errors >> are false positives report them to the maintainer, see >> CHECKPATCH in MAINTAINERS. >> >> How do you produce this error: >> "ERROR: Macros with complex values should be enclosed in parenthesis…"? > > Just running checkpatch.pl --file foo > For me checkpath.pl also does not report the error you reported. It does seem strange to me, as the makros are the same as in rtl2830_priv.h Regards Thomas -- 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 v4 1/5] rtl2832 ver. 0.4: removed signal statistics
On 17.05.2012 23:27, poma wrote: On 05/17/2012 04:19 PM, Antti Palosaari wrote: Moikka Thomas, Here is the review. See comments below. And conclusion is that it is ready for the Kernel merge. I did not see any big functiuonality problems - only some small issues that are likely considered as a coding style etc. Feel free to fix those and sent new patc serie or just new patch top of that. Reviewed-by: Antti Palosaari [...] rtl2832.c.diff: - static int -> static const - struct -> static const struct - newline between function call and error check -> […] - 5 indications apropos 'spaces' regarding 'CodingStyle'- line 206 (/usr/share/doc/kernel-doc-3.3.5/Documentation/CodingStyle) […] Use one space around (on each side of) most binary and ternary operators, such as any of these: = + -< > * / % |& ^<=>= == != ? : […] grep '>>\|<<' v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig + len = (msb>> 3) + 1; + reading_tmp |= reading[i]<< ((len-1-i)*8); + *val = (reading_tmp>> lsb)& mask; + len = (msb>> 3) + 1; + reading_tmp |= reading[i]<< ((len-1-i)*8); + writing_tmp = reading_tmp& ~(mask<< lsb); + writing_tmp |= ((val& mask)<< lsb); + writing[i] = (writing_tmp>> ((len-1-i)*8))& 0xff; + num = bw_mode<< 20; Bitshift operators seems to be OK. Something else? (len-1-i)*8 - 1 indication apropos 'media/dvb/frontends/rtl2832_priv.h:30' Compared to 'rtl2830_priv.h' seems to be OK. ./checkpatch.pl --no-tree v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig ERROR: Missing Signed-off-by: line(s) total: 1 errors, 0 warnings, 1177 lines checked v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS. How do you produce this error: "ERROR: Macros with complex values should be enclosed in parenthesis…"? Just running checkpatch.pl --file foo And it is ERROR which means it *must* be corrected. regards Antti -- http://palosaari.fi/ -- 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 v4 1/5] rtl2832 ver. 0.4: removed signal statistics
On 05/17/2012 04:19 PM, Antti Palosaari wrote: > Moikka Thomas, > > Here is the review. See comments below. > > And conclusion is that it is ready for the Kernel merge. I did not see > any big functiuonality problems - only some small issues that are likely > considered as a coding style etc. Feel free to fix those and sent new > patc serie or just new patch top of that. > > Reviewed-by: Antti Palosaari > > > On 17.05.2012 01:13, Thomas Mair wrote: >> Changelog for ver. 0.3: >> - removed statistics as their calculation was wrong >> - fixed bug in Makefile >> - indentation and code style improvements >> >> Signed-off-by: Thomas Mair >> --- >> drivers/media/dvb/frontends/Kconfig|7 + >> drivers/media/dvb/frontends/Makefile |1 + >> drivers/media/dvb/frontends/rtl2832.c | 825 >> >> drivers/media/dvb/frontends/rtl2832.h | 74 +++ >> drivers/media/dvb/frontends/rtl2832_priv.h | 258 + >> 5 files changed, 1165 insertions(+), 0 deletions(-) >> create mode 100644 drivers/media/dvb/frontends/rtl2832.c >> create mode 100644 drivers/media/dvb/frontends/rtl2832.h >> create mode 100644 drivers/media/dvb/frontends/rtl2832_priv.h >> >> diff --git a/drivers/media/dvb/frontends/Kconfig >> b/drivers/media/dvb/frontends/Kconfig >> index f479834..f7d67d7 100644 >> --- a/drivers/media/dvb/frontends/Kconfig >> +++ b/drivers/media/dvb/frontends/Kconfig >> @@ -432,6 +432,13 @@ config DVB_RTL2830 >> help >> Say Y when you want to support this frontend. >> >> +config DVB_RTL2832 >> +tristate "Realtek RTL2832 DVB-T" >> +depends on DVB_CORE&& I2C >> +default m if DVB_FE_CUSTOMISE >> +help >> + Say Y when you want to support this frontend. >> + > > It is correct. > > Just for the comment as you said in cover letter that you are unsure > about that. > >> comment "DVB-C (cable) frontends" >> depends on DVB_CORE >> >> diff --git a/drivers/media/dvb/frontends/Makefile >> b/drivers/media/dvb/frontends/Makefile >> index b0381dc..bbf2955 100644 >> --- a/drivers/media/dvb/frontends/Makefile >> +++ b/drivers/media/dvb/frontends/Makefile >> @@ -98,6 +98,7 @@ obj-$(CONFIG_DVB_IT913X_FE) += it913x-fe.o >> obj-$(CONFIG_DVB_A8293) += a8293.o >> obj-$(CONFIG_DVB_TDA10071) += tda10071.o >> obj-$(CONFIG_DVB_RTL2830) += rtl2830.o >> +obj-$(CONFIG_DVB_RTL2830) += rtl2832.o >> obj-$(CONFIG_DVB_M88RS2000) += m88rs2000.o >> obj-$(CONFIG_DVB_AF9033) += af9033.o >> >> diff --git a/drivers/media/dvb/frontends/rtl2832.c >> b/drivers/media/dvb/frontends/rtl2832.c >> new file mode 100644 >> index 000..51c7927 >> --- /dev/null >> +++ b/drivers/media/dvb/frontends/rtl2832.c >> @@ -0,0 +1,825 @@ >> +/* >> + * Realtek RTL2832 DVB-T demodulator driver >> + * >> + * Copyright (C) 2012 Thomas Mair >> + * >> + *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., >> + *51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >> + */ >> + >> +#include "rtl2832_priv.h" >> + >> + >> +int rtl2832_debug; >> +module_param_named(debug, rtl2832_debug, int, 0644); >> +MODULE_PARM_DESC(debug, "Turn on/off frontend debugging >> (default:off)."); >> + >> + >> +static int reg_mask[32] = { > > This should be static const. > >> +0x0001, >> +0x0003, >> +0x0007, >> +0x000f, >> +0x001f, >> +0x003f, >> +0x007f, >> +0x00ff, >> +0x01ff, >> +0x03ff, >> +0x07ff, >> +0x0fff, >> +0x1fff, >> +0x3fff, >> +0x7fff, >> +0x, >> +0x0001, >> +0x0003, >> +0x0007, >> +0x000f, >> +0x001f, >> +0x003f, >> +0x007f, >> +0x00ff, >> +0x01ff, >> +0x03ff, >> +0x07ff, >> +0x0fff, >> +0x1fff, >> +0x3fff, >> +0x7fff, >> +0x >> +}; >> + >> +struct rtl2832_reg_entry registers[] = { > > static const struct > >> +[DVBT_SOFT_RST]= {0x1, 0x1, 2, 2}, >> +[DVBT_IIC_REPEAT]= {0x1, 0x1, 3, 3}, >> +[DVBT_TR_WAIT_MIN_8K]= {0x1, 0x88, 11, 2}, >> +[DVBT_RSD_BER_FAIL_VAL]= {0x1, 0x8f, 15, 0}, >> +[DVBT_EN_BK_TRK]= {0x1, 0xa6, 7, 7}, >> +[DVBT_AD_EN_REG]= {0x0, 0x8, 7, 7}, >> +
Re: [PATCH v4 1/5] rtl2832 ver. 0.4: removed signal statistics
Moikka Thomas, Here is the review. See comments below. And conclusion is that it is ready for the Kernel merge. I did not see any big functiuonality problems - only some small issues that are likely considered as a coding style etc. Feel free to fix those and sent new patc serie or just new patch top of that. Reviewed-by: Antti Palosaari On 17.05.2012 01:13, Thomas Mair wrote: Changelog for ver. 0.3: - removed statistics as their calculation was wrong - fixed bug in Makefile - indentation and code style improvements Signed-off-by: Thomas Mair --- drivers/media/dvb/frontends/Kconfig|7 + drivers/media/dvb/frontends/Makefile |1 + drivers/media/dvb/frontends/rtl2832.c | 825 drivers/media/dvb/frontends/rtl2832.h | 74 +++ drivers/media/dvb/frontends/rtl2832_priv.h | 258 + 5 files changed, 1165 insertions(+), 0 deletions(-) create mode 100644 drivers/media/dvb/frontends/rtl2832.c create mode 100644 drivers/media/dvb/frontends/rtl2832.h create mode 100644 drivers/media/dvb/frontends/rtl2832_priv.h diff --git a/drivers/media/dvb/frontends/Kconfig b/drivers/media/dvb/frontends/Kconfig index f479834..f7d67d7 100644 --- a/drivers/media/dvb/frontends/Kconfig +++ b/drivers/media/dvb/frontends/Kconfig @@ -432,6 +432,13 @@ config DVB_RTL2830 help Say Y when you want to support this frontend. +config DVB_RTL2832 + tristate "Realtek RTL2832 DVB-T" + depends on DVB_CORE&& I2C + default m if DVB_FE_CUSTOMISE + help + Say Y when you want to support this frontend. + It is correct. Just for the comment as you said in cover letter that you are unsure about that. comment "DVB-C (cable) frontends" depends on DVB_CORE diff --git a/drivers/media/dvb/frontends/Makefile b/drivers/media/dvb/frontends/Makefile index b0381dc..bbf2955 100644 --- a/drivers/media/dvb/frontends/Makefile +++ b/drivers/media/dvb/frontends/Makefile @@ -98,6 +98,7 @@ obj-$(CONFIG_DVB_IT913X_FE) += it913x-fe.o obj-$(CONFIG_DVB_A8293) += a8293.o obj-$(CONFIG_DVB_TDA10071) += tda10071.o obj-$(CONFIG_DVB_RTL2830) += rtl2830.o +obj-$(CONFIG_DVB_RTL2830) += rtl2832.o obj-$(CONFIG_DVB_M88RS2000) += m88rs2000.o obj-$(CONFIG_DVB_AF9033) += af9033.o diff --git a/drivers/media/dvb/frontends/rtl2832.c b/drivers/media/dvb/frontends/rtl2832.c new file mode 100644 index 000..51c7927 --- /dev/null +++ b/drivers/media/dvb/frontends/rtl2832.c @@ -0,0 +1,825 @@ +/* + * Realtek RTL2832 DVB-T demodulator driver + * + * Copyright (C) 2012 Thomas Mair + * + * 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., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "rtl2832_priv.h" + + +int rtl2832_debug; +module_param_named(debug, rtl2832_debug, int, 0644); +MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); + + +static int reg_mask[32] = { This should be static const. + 0x0001, + 0x0003, + 0x0007, + 0x000f, + 0x001f, + 0x003f, + 0x007f, + 0x00ff, + 0x01ff, + 0x03ff, + 0x07ff, + 0x0fff, + 0x1fff, + 0x3fff, + 0x7fff, + 0x, + 0x0001, + 0x0003, + 0x0007, + 0x000f, + 0x001f, + 0x003f, + 0x007f, + 0x00ff, + 0x01ff, + 0x03ff, + 0x07ff, + 0x0fff, + 0x1fff, + 0x3fff, + 0x7fff, + 0x +}; + +struct rtl2832_reg_entry registers[] = { static const struct + [DVBT_SOFT_RST] = {0x1, 0x1, 2, 2}, + [DVBT_IIC_REPEAT] = {0x1, 0x1, 3, 3}, + [DVBT_TR_WAIT_MIN_8K] = {0x1, 0x88, 11, 2}, + [DVBT_RSD_BER_FAIL_VAL] = {0x1, 0x8f, 15, 0}, + [DVBT_EN_BK_TRK]= {0x1, 0xa6, 7, 7}, + [DVBT_AD_EN_REG]= {0x0, 0x8, 7, 7}, + [DVBT_AD_EN_REG1] = {0x0, 0x8, 6, 6}, + [DVBT_EN_BBIN] = {0x1, 0xb1, 0, 0}, + [DVBT_MGD_THD0] = {0x1, 0x95, 7, 0}, + [DVBT_MGD_THD1] = {0x1, 0x96, 7, 0}, + [DVBT_MGD_THD2] = {0x1, 0x97, 7, 0}, + [DVBT_MGD_THD3] = {0x1, 0x98, 7, 0}, +
Re: [PATCH v4 1/5] rtl2832 ver. 0.4: removed signal statistics
On 17.05.2012 05:40, poma wrote: > […] > v4-1-5-rtl2832-ver.-0.4-v2.diff > Oh thanks. That Makefile is haunting me badly ;) -- 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 v4 1/5] rtl2832 ver. 0.4: removed signal statistics
[…] v4-1-5-rtl2832-ver.-0.4-v2.diff --- v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch.orig 2012-05-17 05:17:16.732328539 +0200 +++ v4-1-5-rtl2832-ver.-0.4-removed-signal-statistics.patch 2012-05-17 05:17:35.999265106 +0200 @@ -24,7 +24,7 @@ obj-$(CONFIG_DVB_A8293) += a8293.o obj-$(CONFIG_DVB_TDA10071) += tda10071.o obj-$(CONFIG_DVB_RTL2830) += rtl2830.o -+obj-$(CONFIG_DVB_RTL2830) += rtl2832.o ++obj-$(CONFIG_DVB_RTL2832) += rtl2832.o obj-$(CONFIG_DVB_M88RS2000) += m88rs2000.o obj-$(CONFIG_DVB_AF9033) += af9033.o
Re: [PATCH v4 1/5] rtl2832 ver. 0.4: removed signal statistics
On 05/17/2012 12:13 AM, Thomas Mair wrote: > Changelog for ver. 0.3: > - removed statistics as their calculation was wrong > - fixed bug in Makefile > - indentation and code style improvements > > Signed-off-by: Thomas Mair > --- > drivers/media/dvb/frontends/Kconfig|7 + > drivers/media/dvb/frontends/Makefile |1 + > drivers/media/dvb/frontends/rtl2832.c | 825 > > drivers/media/dvb/frontends/rtl2832.h | 74 +++ > drivers/media/dvb/frontends/rtl2832_priv.h | 258 + > 5 files changed, 1165 insertions(+), 0 deletions(-) > create mode 100644 drivers/media/dvb/frontends/rtl2832.c > create mode 100644 drivers/media/dvb/frontends/rtl2832.h > create mode 100644 drivers/media/dvb/frontends/rtl2832_priv.h > > diff --git a/drivers/media/dvb/frontends/Kconfig > b/drivers/media/dvb/frontends/Kconfig > index f479834..f7d67d7 100644 > --- a/drivers/media/dvb/frontends/Kconfig > +++ b/drivers/media/dvb/frontends/Kconfig > @@ -432,6 +432,13 @@ config DVB_RTL2830 > help > Say Y when you want to support this frontend. > > +config DVB_RTL2832 > + tristate "Realtek RTL2832 DVB-T" > + depends on DVB_CORE && I2C > + default m if DVB_FE_CUSTOMISE > + help > + Say Y when you want to support this frontend. > + > comment "DVB-C (cable) frontends" > depends on DVB_CORE > > diff --git a/drivers/media/dvb/frontends/Makefile > b/drivers/media/dvb/frontends/Makefile > index b0381dc..bbf2955 100644 > --- a/drivers/media/dvb/frontends/Makefile > +++ b/drivers/media/dvb/frontends/Makefile > @@ -98,6 +98,7 @@ obj-$(CONFIG_DVB_IT913X_FE) += it913x-fe.o > obj-$(CONFIG_DVB_A8293) += a8293.o > obj-$(CONFIG_DVB_TDA10071) += tda10071.o > obj-$(CONFIG_DVB_RTL2830) += rtl2830.o > +obj-$(CONFIG_DVB_RTL2830) += rtl2832.o > obj-$(CONFIG_DVB_M88RS2000) += m88rs2000.o > obj-$(CONFIG_DVB_AF9033) += af9033.o > > diff --git a/drivers/media/dvb/frontends/rtl2832.c > b/drivers/media/dvb/frontends/rtl2832.c > new file mode 100644 > index 000..51c7927 > --- /dev/null > +++ b/drivers/media/dvb/frontends/rtl2832.c > @@ -0,0 +1,825 @@ > +/* > + * Realtek RTL2832 DVB-T demodulator driver > + * > + * Copyright (C) 2012 Thomas Mair > + * > + * 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., > + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > + */ > + > +#include "rtl2832_priv.h" > + > + > +int rtl2832_debug; > +module_param_named(debug, rtl2832_debug, int, 0644); > +MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); > + > + > +static int reg_mask[32] = { > + 0x0001, > + 0x0003, > + 0x0007, > + 0x000f, > + 0x001f, > + 0x003f, > + 0x007f, > + 0x00ff, > + 0x01ff, > + 0x03ff, > + 0x07ff, > + 0x0fff, > + 0x1fff, > + 0x3fff, > + 0x7fff, > + 0x, > + 0x0001, > + 0x0003, > + 0x0007, > + 0x000f, > + 0x001f, > + 0x003f, > + 0x007f, > + 0x00ff, > + 0x01ff, > + 0x03ff, > + 0x07ff, > + 0x0fff, > + 0x1fff, > + 0x3fff, > + 0x7fff, > + 0x > +}; > + > +struct rtl2832_reg_entry registers[] = { > + [DVBT_SOFT_RST] = {0x1, 0x1, 2, 2}, > + [DVBT_IIC_REPEAT] = {0x1, 0x1, 3, 3}, > + [DVBT_TR_WAIT_MIN_8K] = {0x1, 0x88, 11, 2}, > + [DVBT_RSD_BER_FAIL_VAL] = {0x1, 0x8f, 15, 0}, > + [DVBT_EN_BK_TRK]= {0x1, 0xa6, 7, 7}, > + [DVBT_AD_EN_REG]= {0x0, 0x8, 7, 7}, > + [DVBT_AD_EN_REG1] = {0x0, 0x8, 6, 6}, > + [DVBT_EN_BBIN] = {0x1, 0xb1, 0, 0}, > + [DVBT_MGD_THD0] = {0x1, 0x95, 7, 0}, > + [DVBT_MGD_THD1] = {0x1, 0x96, 7, 0}, > + [DVBT_MGD_THD2] = {0x1, 0x97, 7, 0}, > + [DVBT_MGD_THD3] = {0x1, 0x98, 7, 0}, > + [DVBT_MGD_THD4] = {0x1, 0x99, 7, 0}, > + [DVBT_MGD_THD5] = {0x1, 0x9a, 7, 0}, > + [DVBT_MGD_THD6] = {0x1, 0x9b, 7, 0}, > + [DVBT_MGD_THD7] = {0x1, 0x9c, 7, 0}, > + [DVBT_EN_CACQ_NOTCH]= {0x1, 0x61, 4, 4}, > + [DVBT_AD_AV_REF]= {0x0, 0x9, 6, 0}, > + [DVBT_REG_PI] = {0x0, 0xa, 2, 0}, >