From patchwork Mon Feb 12 22:03:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 872424 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zgKhz4Nv8z9s7h for ; Tue, 13 Feb 2018 09:14:43 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Qso2v/YP"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zgKhz31wYzF0pZ for ; Tue, 13 Feb 2018 09:14:43 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Qso2v/YP"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c05::243; helo=mail-pg0-x243.google.com; envelope-from=nicoleotsuka@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Qso2v/YP"; dkim-atps=neutral Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zgKR80wH2zF0pS for ; Tue, 13 Feb 2018 09:02:40 +1100 (AEDT) Received: by mail-pg0-x243.google.com with SMTP id m19so3415330pgn.1 for ; Mon, 12 Feb 2018 14:02:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Sb+BnDP4NOjLeeaUQ4n6o5oi8FnjKDHlmT0sykruCzE=; b=Qso2v/YPIYbvRkJcMX2rR6I9lGzZRVy0VLJ/b+OUN2KawmkZQJ5x8JTcV9mkh5Y6uJ rcg1mcQ0TGZkaxkhnq6svNMM1TspJp7vYzgcw+kPp2RXaxARMU2tlUgZP6wLPTPKgqar AsD1rcjT0v8QRbI6ZLfuoIjXbcwzSbkibKDCEPSmt9/dpU7RbDikYbJMfgJvmF/C07XG s25yk6oUBg7qt2TaeburRqsSE7ktSAZqSJKDGq/jC4O7KmitGH/CyOSxtyjaByYxRH+5 RvqhXUF4nR5JXqanKtwxbOckqB4BJ1Vr2bXXDsLxYdiiHX/uiP0g9kJT5xvuQTEyRPwm qjZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Sb+BnDP4NOjLeeaUQ4n6o5oi8FnjKDHlmT0sykruCzE=; b=beuksAlWjA7Jggk95bcWC/5nkgblT2hONoOdbarOWVbvozLTY36nZou1PDHP5N/aVU 4YJQmUCe/GJF1VCDEB0a6uzKUe7wCG3cyj7g3VueIiBjVKUrvnqoyiHPZ1q6jekYUlk3 CMxeJjb0ZBbKyhLbv0pCD2qVeIE99BdnlQOVyLdPp6/2CcluRqiHgk22+X+ybUCoRS8z qBXV7k9wkQs17AGjupuC80o60+obrmLjlKVQqfP5AEDrgGa0s3QmrTdcf23/XJDBBqsz J8LC8tuxI19s+tl7CqpomDmjNueSjmiqKpc3JIJ/HGRV2eU244zwT00VjGmeadHKX7F2 KVXQ== X-Gm-Message-State: APf1xPAc7OpRUsOXX0lUCq53LGjLDk6KfB69yeu7kmralUyP4DHaF7ta 6tFJuNdOWxqcGxMz9xZJKNo= X-Google-Smtp-Source: AH8x225NG9ClhxU/kY0pdGWOZTpfbA1evETW1w5notyGSv/Dj8E/3McKgoZOobtRmV9pkl9CXMaLYg== X-Received: by 10.99.116.22 with SMTP id p22mr10321092pgc.89.1518472958989; Mon, 12 Feb 2018 14:02:38 -0800 (PST) Received: from Asurada-Nvidia.nvidia.com (thunderhill.nvidia.com. [216.228.112.22]) by smtp.gmail.com with ESMTPSA id c8sm13386159pgn.72.2018.02.12.14.02.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Feb 2018 14:02:38 -0800 (PST) From: Nicolin Chen To: broonie@kernel.org, timur@tabi.org Subject: [PATCH v6 01/17] ASoC: fsl_ssi: Redefine RX and TX macros Date: Mon, 12 Feb 2018 14:03:09 -0800 Message-Id: <1518473005-14090-2-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1518473005-14090-1-git-send-email-nicoleotsuka@gmail.com> References: <1518473005-14090-1-git-send-email-nicoleotsuka@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mail@maciej.szmigiero.name, kernel@pengutronix.de, lgirdwood@gmail.com, alsa-devel@alsa-project.org, caleb@crome.org, linux-kernel@vger.kernel.org, arnaud.mouiche@invoxia.com, lukma@denx.de, fabio.estevam@nxp.com, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The RX and TX macros were defined implicitly and there was a potential risk if someone changes their values. Since they were defined to index the array ssi->regvals[2], this patch moves these two macros to fsl_ssi.c, closer to its owner ssi->regvals. And it also puts some comments here to limit their value within [0, 1]. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome Tested-by: Maciej S. Szmigiero Reviewed-by: Maciej S. Szmigiero --- sound/soc/fsl/fsl_ssi.c | 4 ++++ sound/soc/fsl/fsl_ssi.h | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 24fb672..3c8dd60 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -56,6 +56,10 @@ #include "fsl_ssi.h" #include "imx-pcm.h" +/* Define RX and TX to index ssi->regvals array; Can be 0 or 1 only */ +#define RX 0 +#define TX 1 + /** * FSLSSI_I2S_FORMATS: audio formats supported by the SSI * diff --git a/sound/soc/fsl/fsl_ssi.h b/sound/soc/fsl/fsl_ssi.h index de2fdc5..18f8dd5 100644 --- a/sound/soc/fsl/fsl_ssi.h +++ b/sound/soc/fsl/fsl_ssi.h @@ -12,9 +12,6 @@ #ifndef _MPC8610_I2S_H #define _MPC8610_I2S_H -#define RX 0 -#define TX 1 - /* -- SSI Register Map -- */ /* SSI Transmit Data Register 0 */