From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 01/40] mfd: Differentiate between newly added abx500 based platforms
Date: Fri, 15 Feb 2013 12:44:31 +0000 [thread overview]
Message-ID: <1360932310-30065-2-git-send-email-lee.jones@linaro.org> (raw)
In-Reply-To: <1360932310-30065-1-git-send-email-lee.jones@linaro.org>
Provide the functionality to check for more abx500 type platforms.
These new platforms include: ab9540v3, <=ab8540v1, <=ab8540v1.1,
<=ab8540v1.2, <=ab8540v2, ab8540v2, <=ab8505v2 and <=ab9540v2.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
include/linux/mfd/abx500/ab8500.h | 46 +++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h
index b9a6a84..28bffd0 100644
--- a/include/linux/mfd/abx500/ab8500.h
+++ b/include/linux/mfd/abx500/ab8500.h
@@ -32,6 +32,7 @@ enum ab8500_version {
#define AB8500_CUTEARLY 0x00
#define AB8500_CUT1P0 0x10
#define AB8500_CUT1P1 0x11
+#define AB8500_CUT1P2 0x12 /* Only valid for AB8540 */
#define AB8500_CUT2P0 0x20
#define AB8500_CUT3P0 0x30
#define AB8500_CUT3P3 0x33
@@ -365,4 +366,49 @@ static inline int is_ab9540_2p0(struct ab8500 *ab)
{
return (is_ab9540(ab) && (ab->chip_id == AB8500_CUT2P0));
}
+
+/*
+ * Be careful, the marketing name for this chip is 2.1
+ * but the value read from the chip is 3.0 (0x30)
+ */
+static inline int is_ab9540_3p0(struct ab8500 *ab)
+{
+ return (is_ab9540(ab) && (ab->chip_id == AB8500_CUT3P0));
+}
+
+static inline int is_ab8540_1p0_or_earlier(struct ab8500 *ab)
+{
+ return is_ab8540(ab) && (ab->chip_id <= AB8500_CUT1P0);
+}
+
+static inline int is_ab8540_1p1_or_earlier(struct ab8500 *ab)
+{
+ return is_ab8540(ab) && (ab->chip_id <= AB8500_CUT1P1);
+}
+
+static inline int is_ab8540_1p2_or_earlier(struct ab8500 *ab)
+{
+ return is_ab8540(ab) && (ab->chip_id <= AB8500_CUT1P2);
+}
+
+static inline int is_ab8540_2p0_or_earlier(struct ab8500 *ab)
+{
+ return is_ab8540(ab) && (ab->chip_id <= AB8500_CUT2P0);
+}
+
+static inline int is_ab8540_2p0(struct ab8500 *ab)
+{
+ return is_ab8540(ab) && (ab->chip_id == AB8500_CUT2P0);
+}
+
+static inline int is_ab8505_2p0_earlier(struct ab8500 *ab)
+{
+ return (is_ab8505(ab) && (ab->chip_id < AB8500_CUT2P0));
+}
+
+static inline int is_ab9540_2p0_or_earlier(struct ab8500 *ab)
+{
+ return (is_ab9540(ab) && (ab->chip_id < AB8500_CUT2P0));
+}
+
#endif /* MFD_AB8500_H */
--
1.7.10.4
next prev parent reply other threads:[~2013-02-15 12:44 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-15 12:44 [PATCH 00/40] Power: AB8500: Internal development push Lee Jones
2013-02-15 12:44 ` Lee Jones [this message]
2013-02-15 12:44 ` [PATCH 02/40] pm2301-charger: Enable SW EOC control on the ab9540 Lee Jones
2013-02-15 12:44 ` [PATCH 03/40] abx500-chargalg: Store the AB8500 MFD parent device for platform differentiation Lee Jones
2013-02-15 12:44 ` [PATCH 04/40] ab8500-fg: Add power cut feature for ab8505 and ab8540 Lee Jones
2013-02-15 12:44 ` [PATCH 05/40] ab8500-fg: Report unscaled capacity Lee Jones
2013-02-15 12:44 ` [PATCH 06/40] ab8500-charger: Add backup battery charge voltages on the ab8540 Lee Jones
2013-02-15 12:44 ` [PATCH 07/40] ab8500-charger: Trivial coding style changes Lee Jones
2013-02-15 12:44 ` [PATCH 08/40] ab8500-bm: Quick re-attach charging behaviour Lee Jones
2013-02-15 12:44 ` [PATCH 09/40] pm2301-charger: Support for over voltage protection on the ab9540 Lee Jones
2013-02-15 12:44 ` [PATCH 10/40] ab8500-bm: Charge only mode fixes for " Lee Jones
2013-02-15 12:44 ` [PATCH 11/40] pm2301-charger: Force main charger detect Lee Jones
2013-02-15 12:44 ` [PATCH 12/40] pm2301-charger: Resolve I2C detection problem on ab9540 Lee Jones
2013-02-15 12:44 ` [PATCH 13/40] ab8500_charger: Prevent auto drop of VBUS Lee Jones
2013-02-15 12:44 ` [PATCH 14/40] pm2301-charger: Die temp thermal protection Lee Jones
2013-02-15 12:44 ` [PATCH 15/40] pm2301-charger: Wake system when ext charger is plugged-in Lee Jones
2013-02-15 12:44 ` [PATCH 16/40] ab8500-btemp: Filter btemp readings Lee Jones
2013-02-15 12:44 ` [PATCH 17/40] ab8500-fg: Allow capacity to raise from 1% when charging Lee Jones
2013-02-15 12:44 ` [PATCH 18/40] ab8500-charger: Add AB8505_USB_LINK_STATUS Lee Jones
2013-02-15 12:44 ` [PATCH 19/40] pm2301-charger: Always compile the PM2301 Charger driver with AB8500 Battery Mgnt Lee Jones
2013-02-15 12:44 ` [PATCH 20/40] ab8500-bm: Add usb power path support Lee Jones
2013-02-15 12:44 ` [PATCH 21/40] ab8500-btemp: Defer btemp filtering while initialising Lee Jones
2013-02-15 12:44 ` [PATCH 22/40] ab8500-bm: Add support for the new ab8540 platform Lee Jones
2013-02-15 12:44 ` [PATCH 23/40] ab8500-charger: Use USBLink1Status Register Lee Jones
2013-02-15 12:44 ` [PATCH 24/40] abx500-chargalg: Prevent the watchdog from being kicked twice Lee Jones
2013-02-15 12:44 ` [PATCH 25/40] ab8500-chargalg: Use hrtimer Lee Jones
2013-02-15 12:44 ` [PATCH 26/40] ab8500-charger: Add UsbLineCtrl2 reference Lee Jones
2013-02-15 12:44 ` [PATCH 27/40] pm2301-charger: Adjust interrupt handler behavior Lee Jones
2013-02-15 12:44 ` [PATCH 28/40] pm2301-charger: Add pm_runtime_resume & pm_runtime_suspend Lee Jones
2013-02-15 12:44 ` [PATCH 29/40] ab8500-charger: Run detect workaround only on AB8500 Lee Jones
2013-02-15 12:45 ` [PATCH 30/40] pm2301-charger: Removed unused code from PM2301 driver Lee Jones
2013-02-15 12:45 ` [PATCH 31/40] abx500-chargalg: Use module_platform_driver() rather Lee Jones
2013-02-15 12:45 ` [PATCH 32/40] ab8500-charger: Remove duplicate code Lee Jones
2013-02-15 12:45 ` [PATCH 33/40] pm2301-charger: lpn pin used only in C2C boards Lee Jones
2013-02-15 12:45 ` [PATCH 34/40] pm2301-charger: Charging LED control for pm2301 Lee Jones
2013-02-15 12:45 ` [PATCH 35/40] ab8500-bm: Trivially fix up some incorrect and out-of-date comments Lee Jones
2013-02-15 12:45 ` [PATCH 36/40] pm2301-charger: Wake device on register access Lee Jones
2013-02-15 12:45 ` [PATCH 37/40] pm2301-charger: Reference put missing after access Lee Jones
2013-02-15 12:45 ` [PATCH 38/40] abx500-chargalg: Add charging current step interface Lee Jones
2013-02-15 12:45 ` [PATCH 39/40] ab8500-fg: Change current calculation Lee Jones
2013-02-15 12:45 ` [PATCH 40/40] ab8500-charger: Do not use [delayed_]work_pending() Lee Jones
2013-03-02 23:33 ` [PATCH 00/40] Power: AB8500: Internal development push Anton Vorontsov
2013-03-04 10:08 ` Samuel Ortiz
2013-03-04 17:49 ` Anton Vorontsov
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=1360932310-30065-2-git-send-email-lee.jones@linaro.org \
--to=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).