From patchwork Mon Jan 8 07:33:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yixun Lan X-Patchwork-Id: 856738 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zFRpb6xpjz9s7f for ; Mon, 8 Jan 2018 18:33:43 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755874AbeAHHdb (ORCPT ); Mon, 8 Jan 2018 02:33:31 -0500 Received: from mail-sh2.amlogic.com ([58.32.228.45]:22807 "EHLO mail-sh2.amlogic.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755820AbeAHHdI (ORCPT ); Mon, 8 Jan 2018 02:33:08 -0500 Received: from localhost.localdomain (10.18.20.170) by mail-sh2.amlogic.com (10.18.11.6) with Microsoft SMTP Server id 15.0.1320.4; Mon, 8 Jan 2018 15:32:28 +0800 From: Yixun Lan To: Linus Walleij CC: Neil Armstrong , Jerome Brunet , Kevin Hilman , Carlo Caione , Yixun Lan , Xingyu Chen , Martin Blumenstingl , , , , Subject: [PATCH 1/2] pinctrl: meson: introduce a macro to have name/groups seperated Date: Mon, 8 Jan 2018 15:33:27 +0800 Message-ID: <20180108073328.205769-2-yixun.lan@amlogic.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108073328.205769-1-yixun.lan@amlogic.com> References: <20180108073328.205769-1-yixun.lan@amlogic.com> MIME-Version: 1.0 X-Originating-IP: [10.18.20.170] Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org We introduce a macro FUNCTION_EX here, the main motivation is trying to have the possibility to expand the macro with the same of the '.name' number but different multiple '.groups/.num_groups' numbers. With this change, the meson pinctrl drivr is capable of have one uniform 'function' name but with different pin 'groups', as we face the sitiuation that two pin groups may live inside different hardware domain (EE vs AO domain), which mean we couldn't put them in one single group. Signed-off-by: Yixun Lan --- drivers/pinctrl/meson/pinctrl-meson.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/meson/pinctrl-meson.h b/drivers/pinctrl/meson/pinctrl-meson.h index 12a391109329..d8f705098810 100644 --- a/drivers/pinctrl/meson/pinctrl-meson.h +++ b/drivers/pinctrl/meson/pinctrl-meson.h @@ -124,13 +124,15 @@ struct meson_pinctrl { struct device_node *of_node; }; -#define FUNCTION(fn) \ +#define FUNCTION_EX(fn, ex) \ { \ .name = #fn, \ - .groups = fn ## _groups, \ - .num_groups = ARRAY_SIZE(fn ## _groups), \ + .groups = fn ## ex ## _groups, \ + .num_groups = ARRAY_SIZE(fn ## ex ## _groups), \ } +#define FUNCTION(fn) FUNCTION_EX(fn, ) + #define BANK(n, f, l, fi, li, per, peb, pr, pb, dr, db, or, ob, ir, ib) \ { \ .name = n, \ From patchwork Mon Jan 8 07:33:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yixun Lan X-Patchwork-Id: 856736 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zFRpG3z2Dz9s7f for ; Mon, 8 Jan 2018 18:33:26 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755819AbeAHHdL (ORCPT ); Mon, 8 Jan 2018 02:33:11 -0500 Received: from mail-sh2.amlogic.com ([58.32.228.45]:22807 "EHLO mail-sh2.amlogic.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755854AbeAHHdJ (ORCPT ); Mon, 8 Jan 2018 02:33:09 -0500 Received: from localhost.localdomain (10.18.20.170) by mail-sh2.amlogic.com (10.18.11.6) with Microsoft SMTP Server id 15.0.1320.4; Mon, 8 Jan 2018 15:32:28 +0800 From: Yixun Lan To: Linus Walleij CC: Neil Armstrong , Jerome Brunet , Kevin Hilman , Carlo Caione , Yixun Lan , Xingyu Chen , Martin Blumenstingl , , , , Subject: [PATCH 2/2] pinctrl: meson-axg: correct the pin expansion of UART_AO_B Date: Mon, 8 Jan 2018 15:33:28 +0800 Message-ID: <20180108073328.205769-3-yixun.lan@amlogic.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108073328.205769-1-yixun.lan@amlogic.com> References: <20180108073328.205769-1-yixun.lan@amlogic.com> MIME-Version: 1.0 X-Originating-IP: [10.18.20.170] Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The 'uart_ao_b_groups' for the UART_AO_B pins is already defined which is living inside the AO domain, for these pins which are routed out from EE domain, we need to correct them with the 'FUNCTION_EX' macro, otherwise there is a conflict in the code level. Also slightly adjust the name to make it short and more consistent. Signed-off-by: Yixun Lan --- drivers/pinctrl/meson/pinctrl-meson-axg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/meson/pinctrl-meson-axg.c b/drivers/pinctrl/meson/pinctrl-meson-axg.c index 1fda9d6c7ea3..308e5433bd04 100644 --- a/drivers/pinctrl/meson/pinctrl-meson-axg.c +++ b/drivers/pinctrl/meson/pinctrl-meson-axg.c @@ -716,7 +716,7 @@ static const char * const uart_b_groups[] = { "uart_tx_b_x", "uart_rx_b_x", "uart_cts_b_x", "uart_rts_b_x", }; -static const char * const uart_ao_b_gpioz_groups[] = { +static const char * const uart_ao_b_z_groups[] = { "uart_ao_tx_b_z", "uart_ao_rx_b_z", "uart_ao_cts_b_z", "uart_ao_rts_b_z", }; @@ -855,7 +855,7 @@ static struct meson_pmx_func meson_axg_periphs_functions[] = { FUNCTION(nand), FUNCTION(uart_a), FUNCTION(uart_b), - FUNCTION(uart_ao_b_gpioz), + FUNCTION_EX(uart_ao_b, _z), FUNCTION(i2c0), FUNCTION(i2c1), FUNCTION(i2c2),