[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1360933026-30325-7-git-send-email-lee.jones@linaro.org>
Date: Fri, 15 Feb 2013 12:56:37 +0000
From: Lee Jones <lee.jones@...aro.org>
To: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
sameo@...ux.intel.com
Cc: arnd@...db.de, linus.walleij@...ricsson.com,
Marcus Cooper <marcus.xm.cooper@...ricsson.com>,
Lee Jones <lee.jones@...aro.org>
Subject: [PATCH 06/35] mfd: ab8500-core: Sysfs chip id modification
From: Marcus Cooper <marcus.xm.cooper@...ricsson.com>
On newer variants of the ab a version and revision value can be
read. This modification merges these two values to create a
chip id.
Signed-off-by: Marcus Cooper <marcus.xm.cooper@...ricsson.com>
Signed-off-by: Lee Jones <lee.jones@...aro.org>
Reviewed-by: Mattias WALLIN <mattias.wallin@...ricsson.com>
Tested-by: Jonas ABERG <jonas.aberg@...ricsson.com>
---
drivers/mfd/ab8500-core.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 7c20728..678afd0 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -1095,9 +1095,15 @@ static ssize_t show_chip_id(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct ab8500 *ab8500;
+ int chip_id = -EINVAL;
ab8500 = dev_get_drvdata(dev);
- return sprintf(buf, "%#x\n", ab8500 ? ab8500->chip_id : -EINVAL);
+ if(ab8500) {
+ chip_id = ab8500->chip_id;
+ if((is_ab8505(ab8500) || is_ab9540(ab8500)) && ab8500->version != 0xFF)
+ chip_id = (ab8500->version << 8) | chip_id;
+ }
+ return sprintf(buf, "%#x\n", chip_id);
}
/*
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists