From patchwork Fri Feb 15 12:56:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14902 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 2677F23E01 for ; Fri, 15 Feb 2013 12:57:56 +0000 (UTC) Received: from mail-vb0-f47.google.com (mail-vb0-f47.google.com [209.85.212.47]) by fiordland.canonical.com (Postfix) with ESMTP id D39CDA18025 for ; Fri, 15 Feb 2013 12:57:55 +0000 (UTC) Received: by mail-vb0-f47.google.com with SMTP id e21so2119156vbm.6 for ; Fri, 15 Feb 2013 04:57:55 -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=+/oNalmT/0/+iKypSAW4mUmb3lPJGRjiIfSb7t5RcSI=; b=JPLCWts7G/vqOBaZHU+woZioY0xV4nRc+LNeTN6eys7fBgvv0KJwyoHiHYpx3cP+ei 1Gm+GyHRjUkCF13/cjZ/ht0uMQGhiAJd6nK6NlbxQUx9BlRjOpLX7Tz7eR3iYK+kOANY clazY8qkSg43WFRszngyV7rI0wgerPT5YAjVXu5nEvNXxiYhFUq3+jR5olzdtIcYMRlI s6wYYkVU/y+GltD4WzBZqZcWPrbDPSoEEbCPlzMTrMmwIHKwNnLn1BVbQIWorO1jGuED x9vI1uqXSNEE7JHEolQ3szy8rX6mgDMk370Apl2YrAi2O5AP6JtpzUh62yKbXU59mPNW n+Fw== X-Received: by 10.58.12.200 with SMTP id a8mr2893535vec.52.1360933075361; Fri, 15 Feb 2013 04:57:55 -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 oa5csp11394vcb; Fri, 15 Feb 2013 04:57:54 -0800 (PST) X-Received: by 10.194.174.234 with SMTP id bv10mr3970440wjc.47.1360933074500; Fri, 15 Feb 2013 04:57:54 -0800 (PST) Received: from mail-we0-x231.google.com ([2a00:1450:400c:c03::231]) by mx.google.com with ESMTPS id cl16si4946643wjb.210.2013.02.15.04.57.54 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:57:54 -0800 (PST) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::231 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c03::231; Authentication-Results: mx.google.com; spf=neutral (google.com: 2a00:1450:400c:c03::231 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-we0-f177.google.com with SMTP id d7so2792104wer.36 for ; Fri, 15 Feb 2013 04:57:54 -0800 (PST) X-Received: by 10.194.103.163 with SMTP id fx3mr3928032wjb.58.1360933074009; Fri, 15 Feb 2013 04:57:54 -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 j4sm2852410wiz.10.2013.02.15.04.57.52 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:57:53 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, sameo@linux.intel.com Cc: arnd@arndb.de, linus.walleij@stericsson.com, zhoubin , Lee Jones Subject: [PATCH 17/35] mfd: ab8500: Introduce AB8540 cuts definition Date: Fri, 15 Feb 2013 12:56:48 +0000 Message-Id: <1360933026-30325-18-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360933026-30325-1-git-send-email-lee.jones@linaro.org> References: <1360933026-30325-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQkgPF/ZPcQU0Vxc3brzaZkarztN9FIAgRSFjZ8w1F/XSws89dZu6NJLHE6F241ftD1XY/Hi From: zhoubin Add AB8540 cuts definition and its associated helper functions. Signed-off-by: zhoubin Signed-off-by: Lee Jones Reviewed-by: Ying Bao JIA Reviewed-by: Marcus COOPER Reviewed-by: Mattias WALLIN Reviewed-by: Philippe LANGLAIS Tested-by: Xiao Mei ZHANG Tested-by: Maxime COQUELIN --- include/linux/mfd/abx500/ab8500.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h index 7e323fc..06a8292 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 @@ -442,6 +443,31 @@ static inline int is_ab9540_2p0_or_earlier(struct ab8500 *ab) return (is_ab9540(ab) && (ab->chip_id < AB8500_CUT2P0)); } +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); +} + #ifdef CONFIG_AB8500_DEBUG void ab8500_dump_all_banks(struct device *dev); void ab8500_debug_register_interrupt(int line);