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: 2147731 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id C8C213FCF6 for ; Fri, 15 Feb 2013 13:21:27 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U6LBS-0002ri-5H; Fri, 15 Feb 2013 13:18:34 +0000 Received: from mail-wi0-f173.google.com ([209.85.212.173]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1U6KrZ-00086j-BF for linux-arm-kernel@lists.infradead.org; Fri, 15 Feb 2013 12:58:02 +0000 Received: by mail-wi0-f173.google.com with SMTP id hq4so1113183wib.6 for ; Fri, 15 Feb 2013 04:57:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=+/oNalmT/0/+iKypSAW4mUmb3lPJGRjiIfSb7t5RcSI=; b=o1ymQ6Ul8FYg7Yzf7iEjw6I9x5I1h0Ed27Ic3UdEIBjcpV3M1o1H58TvFRNeErbGA8 /shSKd9/LsX5WpFtjNsR/4wlwlAQejU/D03JFPm/+yTwUnzBFD/pAKsOq6VhRTgmR2co LUQwlYdhYwhlMM0cxUqQTKVRuHHe9f/sgqqv8wy4SvPS1T+1zWARHW4AnCbda71g1Ze6 Scdu5wm//0nF+f/NpqnHwVQgMWnfQZQFVEfPvb1RQSiYkAECjOCGNfA85Wl7t29o5XjY l/IxhLZro/SiMoJdFZ5QL/POzGqUWaFwTuXh5Fphl65tbPTLfin1gHEp+biaAqXxY2FM JQ+A== 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 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: ALoCoQkEqvYfcRw0QorI0mKFHKmmRYPbLMMhjo9QxEioJ0cm5BJfdlkV4ExfsOMZAIY3rrUwFSNx X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130215_075801_982299_1821E63A X-CRM114-Status: UNSURE ( 9.50 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.173 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: zhoubin , Lee Jones , linus.walleij@stericsson.com, arnd@arndb.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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);