From patchwork Mon Mar 30 12:00:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TGlnaHQgSHNpZWggKOisneaYjueHiCk=?= X-Patchwork-Id: 207132 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MIME_BASE64_TEXT, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY, USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86C93C43331 for ; Mon, 30 Mar 2020 12:00:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 599D120774 for ; Mon, 30 Mar 2020 12:00:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="us9yw9J8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730021AbgC3MA5 (ORCPT ); Mon, 30 Mar 2020 08:00:57 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:25463 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729996AbgC3MA4 (ORCPT ); Mon, 30 Mar 2020 08:00:56 -0400 X-UUID: ad913c9caa8c40668a9b277c134f23ea-20200330 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=aHZOu1UIhdMUGeaAiOn3YyNfGHs7OeO5XFt+0Uq4sc8=; b=us9yw9J8WW4Sv0PHVq/VyFDo4EvKhHGlEKiTGnBO2RLFuTQX8sTKDQVqHHV+Q1UoPOJSrZ7HPGnG6LTvNCKFxdcoKXG5pNgXgvZbC3X1J8b9fYYtx7PabKyzzJObzlCzUBcEndJ8zG5mOIk4tY5aTGUAzp85w2n/PkCPFykcwzI=; X-UUID: ad913c9caa8c40668a9b277c134f23ea-20200330 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 114862305; Mon, 30 Mar 2020 20:00:51 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 30 Mar 2020 20:00:46 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 30 Mar 2020 20:00:47 +0800 From: To: CC: , , , , , Light Hsieh Subject: [PATCH v5 0/2] pinctrl: mediatek: make MediaTek pinctrl v2 driver ready for buidling loadable module Date: Mon, 30 Mar 2020 20:00:46 +0800 Message-ID: <1585569648-14017-1-git-send-email-light.hsieh@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty MIME-Version: 1.0 X-TM-SNTS-SMTP: F8C29F2B654CA22D3A890F74A392E3A3A920FDA8CE8213DE8FECC487E85F8B462000:8 X-MTK: N Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Light Hsieh In the future we want to be able to build the MediaTek pinctrl driver, based on paris, as kernel module. This patch allows pinctrl-paris.c, the external interrupt controller mtk-eint.c, and pinctrl-mtk-common-v2.c to be loadable as module. The following is the rationale for determining whether mtk-eint.c, pinctrl-mtk-common-v2.c, and pinctrl-paris.c are built as loadable module: 1. drivers/pinctrl/mediatek/Kconfig: 1.1 PINCTRL_MTXXXX: change from bool to tristate. It is specified in defconfig file. MTXXXX can only be the user of pinctrl-paris, which can MT6765 or MT8183. The patch for changing PINCTRL_MT6765 from bool to tristate will be given as the next patch of the patch series. 1.2 PINCTRL_MTK_PARIS: change from bool to tristate and select PINCTRL_MTK_V2. No need to specify in defconfig file. * PINCTRL_MTK_PARIS will be y if any PINCTRL_MTXXXX selecting PINCTRL_MTK_PARIS is y. * PINCTRL_MTK_PARIS will be n if all PINCTRL_MTXXXX selecting PINCTRL_MTK_PARIS is n. * PINCTRL_MTK_PARIS will be m if some PINCTRL_MTXXXX selecting PINCTRL_MTK_PARIS are m and other PINCTRL_MTXXXX selecting PINCTRL_MTK_PARIS are n. 1.3 PINCTRL_MTK_MOORE: select EINT_MTK and PINCTRL_MTK_V2. It is make to be ready for building as loadable kernel module because it is not used on Android kernel. 1.4 PINCTRL_MTK_V2: add this tristate config which depends on PINCTRL_MTK_PARIS and PINCTRL_MTK_MOORE. No need to specify in defconfig file. * PINCTRL_MTK_V2 will be y if either PINCTRL_MTK_PARIS or PINCTRL_MTK_MOORE is y. * PINCTRL_MTK_V2 will be n if both PINCTRL_MTK_PARIS and PINCTRL_MTK_MOORE are n. * PINCTRL_MTK_V2 will be m if PINCTRL_MTK_PARIS is m and PINCTRL_MTK_MOORE is n. 1.5 EINT_MTK: change from bool to tristate and add rule for default. No need to specify in defconfig file. * First rule: determine if EINT_MTK is y or n according to selection of PINCTRL_MTK or PINCTRL_MTK_MORE. * Second rule: determine if EINT_MTK is y, m, or n according to selection of PINCTRL_MTK_PARIS. 2. drivers/pinctrl/mediatek/Makefile: Use PINCTRL_MTK_V2 to determine if pinctrl-mtk-common-v2.c is built as loadable module or built-in. Light Hsieh (2): pinctrl: mediatek: make MediaTek pinctrl v2 driver ready for buidling loadable module pinctrl: mediatek: make MediaTek MT6765 pinctrl ready for buiding loadable module drivers/pinctrl/mediatek/Kconfig | 13 ++++++++++--- drivers/pinctrl/mediatek/Makefile | 5 +++-- drivers/pinctrl/mediatek/mtk-eint.c | 9 +++++++++ drivers/pinctrl/mediatek/pinctrl-mt6765.c | 4 ++++ drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 24 ++++++++++++++++++++++++ drivers/pinctrl/mediatek/pinctrl-paris.c | 6 ++++++ 6 files changed, 56 insertions(+), 5 deletions(-) -- 1.8.1.1.dirty