From patchwork Fri Feb 15 12:44:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14846 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 7922C23E2E for ; Fri, 15 Feb 2013 12:45:45 +0000 (UTC) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by fiordland.canonical.com (Postfix) with ESMTP id 373BDA18025 for ; Fri, 15 Feb 2013 12:45:45 +0000 (UTC) Received: by mail-ve0-f172.google.com with SMTP id cz11so2995978veb.17 for ; Fri, 15 Feb 2013 04:45:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=0BWnapnqQkiSdmsG6iA281pC6fzYn5vEluALT/a6t5o=; b=niai1B7qstGGkK7aiysPleI905AihzF7AttmRl1SWHUoNZcVVwmpXumK2r8v4WRHGX gUNYDdjbCEQQyfcHZdbaVRC/4yLahXCvONH/YeYBrG5wLwltaNABo3o6XBb+M1WvM8d7 39Ki9003xx+vNIOFYNT3scYTCcn84WUk32hHJG+vWgAwhFshtsjdTMLr4bcOsCmupgkB vRnPfj6EkWVQ7EqoOxJmX2mQbfHM5CO9SclVpNzCTbQ7sJFYuHg/UY9riMAH//FMxp7a sDt1Ozb5rDoNZ8U0jCYgTCvSvdWaKYV8KAAmXCfvTAyhPtPrypfhRcwuQvbr9AXdUIFp Yq5A== X-Received: by 10.52.33.167 with SMTP id s7mr2508517vdi.52.1360932344483; Fri, 15 Feb 2013 04:45:44 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.221.4.5 with SMTP id oa5csp10798vcb; Fri, 15 Feb 2013 04:45:43 -0800 (PST) X-Received: by 10.194.118.166 with SMTP id kn6mr4018816wjb.18.1360932343530; Fri, 15 Feb 2013 04:45:43 -0800 (PST) Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by mx.google.com with ESMTPS id ba8si10177593wjc.204.2013.02.15.04.45.43 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:45:43 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.179 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.179; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.179 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-wi0-f179.google.com with SMTP id ez12so1099015wid.12 for ; Fri, 15 Feb 2013 04:45:43 -0800 (PST) X-Received: by 10.194.87.100 with SMTP id w4mr3870709wjz.48.1360932342211; Fri, 15 Feb 2013 04:45:42 -0800 (PST) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPS id bs6sm5133904wib.4.2013.02.15.04.45.39 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:45:40 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, linus.walleij@stericsson.com, cbouatmailru@gmail.com, sameo@linux.intel.com, Lee Jones Subject: [PATCH 01/40] mfd: Differentiate between newly added abx500 based platforms Date: Fri, 15 Feb 2013 12:44:31 +0000 Message-Id: <1360932310-30065-2-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360932310-30065-1-git-send-email-lee.jones@linaro.org> References: <1360932310-30065-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQmH+dMzdQlUMGhJzcIKuPft0n964Z9vVRP2tBxltlWNBsgpgi4pnifZFdZY1ZuPslV0USu9 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 --- 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 */