From patchwork Mon Jun 1 23:09:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 6524981 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 597DD9F1CC for ; Mon, 1 Jun 2015 23:09:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8548F20462 for ; Mon, 1 Jun 2015 23:09:51 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 72C1520389 for ; Mon, 1 Jun 2015 23:09:50 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 947AF2604A3; Tue, 2 Jun 2015 01:09:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id B63F0260436; Tue, 2 Jun 2015 01:09:36 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7836726044E; Tue, 2 Jun 2015 01:09:35 +0200 (CEST) Received: from mail.mleia.com (li271-223.members.linode.com [178.79.152.223]) by alsa0.perex.cz (Postfix) with ESMTP id 8DB67260422 for ; Tue, 2 Jun 2015 01:09:28 +0200 (CEST) Received: from mail.mleia.com (localhost [127.0.0.1]) by mail.mleia.com (Postfix) with ESMTP id 507B39AE5E; Tue, 2 Jun 2015 00:12:14 +0100 (BST) From: Vladimir Zapolskiy To: Mark Brown , Liam Girdwood , Linus Walleij , Alexandre Courbot Date: Tue, 2 Jun 2015 02:09:12 +0300 Message-Id: <1433200158-6890-1-git-send-email-vz@mleia.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1433200031-6748-1-git-send-email-vz@mleia.com> References: <1433200031-6748-1-git-send-email-vz@mleia.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-49551924 X-CRM114-CacheID: sfid-20150602_001214_355633_4E27A01A X-CRM114-Status: UNSURE ( 8.22 ) X-CRM114-Notice: Please train this message. Cc: Oder Chiou , alsa-devel@alsa-project.org, Takashi Iwai , linux-gpio@vger.kernel.org, Bard Liao Subject: [alsa-devel] [PATCH 1/7] ASoC: rt5677: add GPIO helper macros X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Add generic macro definitions for GPIO[1-5] direction and value register bits, argument is RT5677_GPIOn. Signed-off-by: Vladimir Zapolskiy Cc: Bard Liao Cc: Oder Chiou --- sound/soc/codecs/rt5677.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/soc/codecs/rt5677.h b/sound/soc/codecs/rt5677.h index 7eca38a..5b84255 100644 --- a/sound/soc/codecs/rt5677.h +++ b/sound/soc/codecs/rt5677.h @@ -1622,6 +1622,12 @@ #define RT5677_GPIO1_P_NOR (0x0 << 0) #define RT5677_GPIO1_P_INV (0x1 << 0) +#define RT5677_GPIO_DIR_OUT_MASK(n) (0x3 << (n * 3 + 1)) +#define RT5677_GPIO_DIR_MASK(n) (0x1 << (n * 3 + 2)) +#define RT5677_GPIO_DIR_OUT(n) (0x1 << (n * 3 + 2)) +#define RT5677_GPIO_OUT_MASK(n) (0x1 << (n * 3 + 1)) +#define RT5677_GPIO_OUT_HI(n) (0x1 << (n * 3 + 1)) + /* GPIO Control 3 (0xc2) */ #define RT5677_GPIO6_DIR_MASK (0x1 << 2) #define RT5677_GPIO6_DIR_SFT 2