summaryrefslogtreecommitdiff
path: root/wcte12xp/vpmadt032.c
diff options
context:
space:
mode:
Diffstat (limited to 'wcte12xp/vpmadt032.c')
-rw-r--r--wcte12xp/vpmadt032.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/wcte12xp/vpmadt032.c b/wcte12xp/vpmadt032.c
index e6ff1cd..0b6a8a4 100644
--- a/wcte12xp/vpmadt032.c
+++ b/wcte12xp/vpmadt032.c
@@ -403,10 +403,20 @@ int t1_vpm150m_setreg(struct t1 *wc, unsigned int len, unsigned int addr, unsign
unsigned short t1_vpm150m_getreg(struct t1 *wc, unsigned int len, unsigned int addr, unsigned short *data)
{
unsigned short res;
- t1_vpm150m_setpage(wc, addr >> 16);
- if ((addr >> 16) != ((addr + len) >> 16))
- module_printk("getreg: You found it!\n");
- res = t1_vpm150m_getreg_full(wc, 0, len, addr & 0xffff, data);
+ unsigned short count=0;
+ unsigned short first_data=0;
+ do {
+ t1_vpm150m_setpage(wc, addr >> 16);
+ if ((addr >> 16) != ((addr + len) >> 16))
+ module_printk("getreg: You found it!\n");
+ if (count > 0) {
+ first_data = *data;
+ }
+ res = t1_vpm150m_getreg_full(wc, 0, len, addr & 0xffff, data);
+ } while (((0==count++) || (first_data != *data)) && (count < 100));
+ if (count >= 100) {
+ module_printk(" %s:%d\n", __FILE__, __LINE__);
+ }
return res;
}