From patchwork Mon Aug 27 10:09:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 10576817 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D7B55139B for ; Mon, 27 Aug 2018 10:11:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C09AF29909 for ; Mon, 27 Aug 2018 10:11:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4BFF29914; Mon, 27 Aug 2018 10:11:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,SUSPICIOUS_RECIPS, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3511429909 for ; Mon, 27 Aug 2018 10:11:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=MMH9qCThHgZi1eqRvi+gb7aJ1VaLo2CWM/9EqSzmFkk=; b=O1EoGC0ABmdyhO Zh+pfqq1TZxYIx2HsiRrVDhgeG39pBBFeRDk55cdHdGoILLy3aIq89DB+WcRkhfAVI+KSu6cDyX08 5yPBUvooCcZBZ2A6WTow7vKlxbM0BPVSzBOE3ztgfAnBhsslRtbxi9ccsNuwm0T/msZ4ESwwzos4Y GBR3Q7zWHMU4rzExaFViaYClH04f+1rjQ3dTaR2BF7fdD5hKyoktGz0b3XrF5bC77fSBV27kycuXh Beo9/hXn4WgYf1mpOBWnCL8fzjy4U8rIn243BzmJZIcv8yMUHJl/oM1Ju6VYHCaaNXTW835kYEgY1 oDGEQ/gKM8+SQqnm0p/A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuEU0-0001Ml-QG; Mon, 27 Aug 2018 10:10:53 +0000 Received: from [210.61.82.184] (helo=mailgw02.mediatek.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuETl-0001Fh-CM; Mon, 27 Aug 2018 10:10:40 +0000 X-UUID: 695a0d47516246178c98830844b68f4e-20180827 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1942752243; Mon, 27 Aug 2018 18:10:19 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Mon, 27 Aug 2018 18:10:17 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Mon, 27 Aug 2018 18:10:18 +0800 From: To: , Subject: [PATCH 00/16] Unify MediaTek pinctrl in preparation for MT8183 and MT6765 Date: Mon, 27 Aug 2018 18:09:59 +0800 Message-ID: X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180827_031037_554215_E8DE02A8 X-CRM114-Status: UNSURE ( 9.76 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-gpio@vger.kernel.org, Sean Wang , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sean Wang Irregular register arrangement and their logic access from various MediaTek SoCs being introduced already causes pinctrl-mtk-common to bloat and became really hard to maintain so that the patch creates pinctrl-mtk-common-v2 based on the core of mt7622 pinctrl to try make the register operations to be simple. The goals pinctrl-mtk-common-v2 want to achieve are to hopefully support all of MediaTek SoCs, and two kinds of dt-bindings being supported, Linux generic pinctrl dt-binding which mt762x like to support and MediaTek vendor per-pin dt-binding the other SoCs support the MT8183 and MT6765 incline to make use of. The patch starts to refactor MT7622 pinctrl driver first with splitting out these portable ways from there such as table-based register operation and the other operations in common in the both kinds of driver. Sean Wang (16): pinctrl: mediatek: add pinctrl-mtk-common-v2 for all MediaTek pinctrls pinctrl: mediatek: add pinctrl-moore that implements the generic pinctrl dt-bindings pinctrl: mediatek: extend struct mtk_pin_field_calc to pinctrl-mtk-common-v2.c pinctrl: mediatek: extend struct mtk_pin_desc to pinctrl-mtk-common-v2.c pinctrl: mediatek: extend struct mtk_pin_soc to pinctrl-mtk-common-v2.c pinctrl: mediatek: add driving strength related support to pinctrl-mtk-common-v2.c pinctrl: mediatek: add drv register support to pinctrl-mtk-common-v2.c pinctrl: mediatek: add pull related support to pinctrl-mtk-common-v2.c pinctrl: mediatek: add advanced pull related support to pinctrl-mtk-common-v2.c pinctrl: mediatek: add ies register support to pinctrl-mtk-common-v2.c pinctrl: mediatek: add pullen, pullsel register support to pinctrl-mtk-common-v2.c pinctrl: mediatek: add MT7623 pinctrl driver based on generic pinctrl binding pinctrl: mediatek: use pin descriptor all in pinctrl-mtk-common-v2.c pinctrl: mediatek: add multiple register bases support to pinctrl-mtk-common-v2.c pinctrl: mediatek: adjust error code and message when some register not supported is found pinctrl: mediatek: extend struct mtk_pin_desc which per-pin driver depends on drivers/pinctrl/mediatek/Kconfig | 25 +- drivers/pinctrl/mediatek/Makefile | 2 + drivers/pinctrl/mediatek/pinctrl-moore.c | 813 ++++++++++++ drivers/pinctrl/mediatek/pinctrl-moore.h | 57 + drivers/pinctrl/mediatek/pinctrl-mt7622.c | 1407 ++++----------------- drivers/pinctrl/mediatek/pinctrl-mt7623.c | 1441 ++++++++++++++++++++++ drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 510 ++++++++ drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h | 281 +++++ 8 files changed, 3345 insertions(+), 1191 deletions(-) create mode 100644 drivers/pinctrl/mediatek/pinctrl-moore.c create mode 100644 drivers/pinctrl/mediatek/pinctrl-moore.h create mode 100644 drivers/pinctrl/mediatek/pinctrl-mt7623.c create mode 100644 drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c create mode 100644 drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h