From: Richard Genoud <richard.genoud@gmail.com>
To: Michael Hennerich <michael.hennerich@analog.com>
Cc: stable@kernel.org, linux-kernel@vger.kernel.org,
device-driver-devel@blackfin.uclinux.org,
Richard Genoud <richard.genoud@gmail.com>
Subject: [PATCH] ad525x_dpot: [BUG] eeprom command send instead of dec/inc all commands
Date: Sat, 12 Mar 2011 14:08:21 +0100 [thread overview]
Message-ID: <1299935301-3849-1-git-send-email-richard.genoud@gmail.com> (raw)
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
next reply other threads:[~2011-03-12 13:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-12 13:08 Richard Genoud [this message]
2011-03-12 17:42 ` [stable] " Greg KH
2011-03-21 7:57 ` Hennerich, Michael
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1299935301-3849-1-git-send-email-richard.genoud@gmail.com \
--to=richard.genoud@gmail.com \
--cc=device-driver-devel@blackfin.uclinux.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.hennerich@analog.com \
--cc=stable@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®