public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ad525x_dpot: [BUG] eeprom command send instead of dec/inc all commands
@ 2011-03-12 13:08 Richard Genoud
  2011-03-12 17:42 ` [stable] " Greg KH
  2011-03-21  7:57 ` Hennerich, Michael
  0 siblings, 2 replies; 3+ messages in thread
From: Richard Genoud @ 2011-03-12 13:08 UTC (permalink / raw)
  To: Michael Hennerich
  Cc: stable, linux-kernel, device-driver-devel, Richard Genoud

When a DEC_ALL or INC_ALL command is issued, an eeprom command is send.
This is because DPOT_DEC_ALL (DPOT_ADDR_CMD | 0x30) and DPOT_INC_ALL
(DPOT_ADDR_CMD | 0x58) defines overlap with DPOT_ADDR_EEPROM (0x20).

So, DPOT_ADDR_CMD bit should be tested before DPOT_ADDR_EEPROM bit.

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
---
 drivers/misc/ad525x_dpot.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c
index 7cb9110..b6c5391 100644
--- a/drivers/misc/ad525x_dpot.c
+++ b/drivers/misc/ad525x_dpot.c
@@ -289,8 +289,6 @@ static s32 dpot_write_spi(struct dpot_data *dpot, u8 reg, u16 value)
 			}
 			val = DPOT_SPI_RDAC | (reg & DPOT_RDAC_MASK);
 		}
-	} else if (reg & DPOT_ADDR_EEPROM) {
-		val = DPOT_SPI_EEPROM | (reg & DPOT_RDAC_MASK);
 	} else if (reg & DPOT_ADDR_CMD) {
 		switch (reg) {
 		case DPOT_DEC_ALL_6DB:
@@ -306,6 +304,8 @@ static s32 dpot_write_spi(struct dpot_data *dpot, u8 reg, u16 value)
 			val = DPOT_SPI_INC_ALL;
 			break;
 		}
+	} else if (reg & DPOT_ADDR_EEPROM) {
+		val = DPOT_SPI_EEPROM | (reg & DPOT_RDAC_MASK);
 	} else if (reg & DPOT_ADDR_OTP) {
 		if (dpot->uid == DPOT_UID(AD5291_ID) ||
 			dpot->uid == DPOT_UID(AD5292_ID)) {
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [stable] [PATCH] ad525x_dpot: [BUG] eeprom command send instead of dec/inc all commands
  2011-03-12 13:08 [PATCH] ad525x_dpot: [BUG] eeprom command send instead of dec/inc all commands Richard Genoud
@ 2011-03-12 17:42 ` Greg KH
  2011-03-21  7:57 ` Hennerich, Michael
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2011-03-12 17:42 UTC (permalink / raw)
  To: Richard Genoud
  Cc: Michael Hennerich, device-driver-devel, stable, linux-kernel

On Sat, Mar 12, 2011 at 02:08:21PM +0100, Richard Genoud wrote:
> When a DEC_ALL or INC_ALL command is issued, an eeprom command is send.
> This is because DPOT_DEC_ALL (DPOT_ADDR_CMD | 0x30) and DPOT_INC_ALL
> (DPOT_ADDR_CMD | 0x58) defines overlap with DPOT_ADDR_EEPROM (0x20).
> 
> So, DPOT_ADDR_CMD bit should be tested before DPOT_ADDR_EEPROM bit.
> 
> Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
> ---
>  drivers/misc/ad525x_dpot.c |    4 ++--

This is not how you submit a patch for submission to the stable kernel
tree.  Please read Documentation/stable_kernel_rules.txt for how to do
this properly.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] ad525x_dpot: [BUG] eeprom command send instead of dec/inc all commands
  2011-03-12 13:08 [PATCH] ad525x_dpot: [BUG] eeprom command send instead of dec/inc all commands Richard Genoud
  2011-03-12 17:42 ` [stable] " Greg KH
@ 2011-03-21  7:57 ` Hennerich, Michael
  1 sibling, 0 replies; 3+ messages in thread
From: Hennerich, Michael @ 2011-03-21  7:57 UTC (permalink / raw)
  To: Richard Genoud
  Cc: stable@kernel.org, linux-kernel@vger.kernel.org,
	device-driver-devel@blackfin.uclinux.org

Richard Genoud wrote on 2011-03-12:
> When a DEC_ALL or INC_ALL command is issued, an eeprom command is send.
> This is because DPOT_DEC_ALL (DPOT_ADDR_CMD | 0x30) and DPOT_INC_ALL
> (DPOT_ADDR_CMD | 0x58) defines overlap with DPOT_ADDR_EEPROM (0x20).
>
> So, DPOT_ADDR_CMD bit should be tested before DPOT_ADDR_EEPROM bit.
>
> Signed-off-by: Richard Genoud <richard.genoud@gmail.com>

Acked-by: Michael Hennerich <michael.hennerich@analog.com>

> ---
>  drivers/misc/ad525x_dpot.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c
> index 7cb9110..b6c5391 100644
> --- a/drivers/misc/ad525x_dpot.c
> +++ b/drivers/misc/ad525x_dpot.c
> @@ -289,8 +289,6 @@ static s32 dpot_write_spi(struct dpot_data *dpot,
> u8 reg, u16 value)
>                       }
>                       val = DPOT_SPI_RDAC | (reg & DPOT_RDAC_MASK);
>               }
> -     } else if (reg & DPOT_ADDR_EEPROM) {
> -             val = DPOT_SPI_EEPROM | (reg & DPOT_RDAC_MASK);
>       } else if (reg & DPOT_ADDR_CMD) {
>               switch (reg) {
>               case DPOT_DEC_ALL_6DB:
> @@ -306,6 +304,8 @@ static s32 dpot_write_spi(struct dpot_data *dpot,
> u8 reg, u16 value)
>                       val = DPOT_SPI_INC_ALL;
>                       break;
>               }
> +     } else if (reg & DPOT_ADDR_EEPROM) {
> +             val = DPOT_SPI_EEPROM | (reg & DPOT_RDAC_MASK);
>       } else if (reg & DPOT_ADDR_OTP) {
>               if (dpot->uid == DPOT_UID(AD5291_ID) ||
>                       dpot->uid == DPOT_UID(AD5292_ID)) {

Greetings,
Michael

--
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368; Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin, Margaret Seif


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-21  7:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-12 13:08 [PATCH] ad525x_dpot: [BUG] eeprom command send instead of dec/inc all commands Richard Genoud
2011-03-12 17:42 ` [stable] " Greg KH
2011-03-21  7:57 ` Hennerich, Michael

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox