Staging: dt3155: fix 50Hz configuration

Previous thread: Staging: iio: fix up the iio_get_new_idr_val comment by Linux Kernel Mailing List on Friday, April 30, 2010 - 10:59 am. (1 message)

Next thread: staging: iio: Function iio_get_new_idr_val() return negative value if fails. by Linux Kernel Mailing List on Friday, April 30, 2010 - 10:59 am. (1 message)
From: Linux Kernel Mailing List
Date: Friday, April 30, 2010 - 10:59 am

Gitweb:     http://git.kernel.org/linus/6536560cabab170ed2969b005bf69a496e9c45bf
Commit:     6536560cabab170ed2969b005bf69a496e9c45bf
Parent:     d01f42a22ef381ba973958e977209ac9a8667d57
Author:     H Hartley Sweeten <hartleys@visionengravers.com>
AuthorDate: Wed Apr 14 18:29:17 2010 -0500
Committer:  Greg Kroah-Hartman <gregkh@suse.de>
CommitDate: Fri Apr 30 09:30:10 2010 -0700

    Staging: dt3155: fix 50Hz configuration
    
    According to the header file, dt3155_io.h, the 50/60 Hz configuration
    is controlled by a bit in the I2C CSR2 register (bit 2).  The function
    dt3155_init_isr actually reads the I2C CONFIG register into the global
    I2C_CSR union variable then modifies the bit.  It then does a write
    to the I2C CONFIG register with the global I2C_CONFIG union variable
    which is not even set with a value anywhere in the driver.
    
    My guess is 50Hz operation doesn't even work as-is.
    
    Fix this by actually reading and writing the correct register with
    the correct value.
    
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
    Cc: Simon Horman <horms@verge.net.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/staging/dt3155/dt3155_drv.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/dt3155/dt3155_drv.c b/drivers/staging/dt3155/dt3155_drv.c
index e2c44ec..7ac2c6d 100644
--- a/drivers/staging/dt3155/dt3155_drv.c
+++ b/drivers/staging/dt3155/dt3155_drv.c
@@ -464,9 +464,9 @@ static void dt3155_init_isr(int minor)
   /* 50/60 Hz should be set before this point but let's make sure it is */
   /* right anyway */
 
-  ReadI2C(dt3155_lbase[ minor ], CONFIG, &i2c_csr2.reg);
+  ReadI2C(dt3155_lbase[ minor ], CSR2, &i2c_csr2.reg);
   i2c_csr2.fld.HZ50 = FORMAT50HZ;
-  WriteI2C(dt3155_lbase[ minor ], CONFIG, i2c_config.reg);
+  WriteI2C(dt3155_lbase[ minor ], CSR2, i2c_csr2.reg);
 
   /* enable busmaster chip, clear flags */
 
--

Previous thread: Staging: iio: fix up the iio_get_new_idr_val comment by Linux Kernel Mailing List on Friday, April 30, 2010 - 10:59 am. (1 message)

Next thread: staging: iio: Function iio_get_new_idr_val() return negative value if fails. by Linux Kernel Mailing List on Friday, April 30, 2010 - 10:59 am. (1 message)