From: Light Hsieh <[email protected]>
Google plan to make platform driver as kernel module for future
Andriod kernel. This patch make platforms that use pinctrl-paris.c
of MediaTek pinctrl v2 ready for building kernel module.
Signed-off-by: Light Hsieh <[email protected]>
---
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 | 5 +++++
drivers/pinctrl/pinconf-generic.c | 1 +
5 files changed, 43 insertions(+)
diff --git a/drivers/pinctrl/mediatek/mtk-eint.c b/drivers/pinctrl/mediatek/mtk-eint.c
index 7e526bcf..99703a8 100644
--- a/drivers/pinctrl/mediatek/mtk-eint.c
+++ b/drivers/pinctrl/mediatek/mtk-eint.c
@@ -9,6 +9,7 @@
*
*/
+#include <linux/module.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/gpio/driver.h>
@@ -379,6 +380,7 @@ int mtk_eint_do_suspend(struct mtk_eint *eint)
return 0;
}
+EXPORT_SYMBOL_GPL(mtk_eint_do_suspend);
int mtk_eint_do_resume(struct mtk_eint *eint)
{
@@ -386,6 +388,7 @@ int mtk_eint_do_resume(struct mtk_eint *eint)
return 0;
}
+EXPORT_SYMBOL_GPL(mtk_eint_do_resume);
int mtk_eint_set_debounce(struct mtk_eint *eint, unsigned long eint_num,
unsigned int debounce)
@@ -440,6 +443,7 @@ int mtk_eint_set_debounce(struct mtk_eint *eint, unsigned long eint_num,
return 0;
}
+EXPORT_SYMBOL_GPL(mtk_eint_set_debounce);
int mtk_eint_find_irq(struct mtk_eint *eint, unsigned long eint_n)
{
@@ -451,6 +455,7 @@ int mtk_eint_find_irq(struct mtk_eint *eint, unsigned long eint_n)
return irq;
}
+EXPORT_SYMBOL_GPL(mtk_eint_find_irq);
int mtk_eint_do_init(struct mtk_eint *eint)
{
@@ -495,3 +500,7 @@ int mtk_eint_do_init(struct mtk_eint *eint)
return 0;
}
+EXPORT_SYMBOL_GPL(mtk_eint_do_init);
+
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("MediaTek EINT Driver");
diff --git a/drivers/pinctrl/mediatek/pinctrl-mt6765.c b/drivers/pinctrl/mediatek/pinctrl-mt6765.c
index 905dae8c..2c59d39 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mt6765.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mt6765.c
@@ -6,6 +6,7 @@
*
*/
+#include <linux/module.h>
#include "pinctrl-mtk-mt6765.h"
#include "pinctrl-paris.h"
@@ -1103,3 +1104,6 @@ static int __init mt6765_pinctrl_init(void)
return platform_driver_register(&mt6765_pinctrl_driver);
}
arch_initcall(mt6765_pinctrl_init);
+
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("MediaTek MT6765 Pinctrl Driver");
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
index 1da9425..cdf2d69 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
@@ -6,6 +6,7 @@
*
*/
+#include <linux/module.h>
#include <dt-bindings/pinctrl/mt65xx.h>
#include <linux/device.h>
#include <linux/err.h>
@@ -206,6 +207,7 @@ int mtk_hw_set_value(struct mtk_pinctrl *hw, const struct mtk_pin_desc *desc,
return 0;
}
+EXPORT_SYMBOL_GPL(mtk_hw_set_value);
int mtk_hw_get_value(struct mtk_pinctrl *hw, const struct mtk_pin_desc *desc,
int field, int *value)
@@ -225,6 +227,7 @@ int mtk_hw_get_value(struct mtk_pinctrl *hw, const struct mtk_pin_desc *desc,
return 0;
}
+EXPORT_SYMBOL_GPL(mtk_hw_get_value);
static int mtk_xt_find_eint_num(struct mtk_pinctrl *hw, unsigned long eint_n)
{
@@ -363,6 +366,7 @@ int mtk_build_eint(struct mtk_pinctrl *hw, struct platform_device *pdev)
return mtk_eint_do_init(hw->eint);
}
+EXPORT_SYMBOL_GPL(mtk_build_eint);
/* Revision 0 */
int mtk_pinconf_bias_disable_set(struct mtk_pinctrl *hw,
@@ -382,6 +386,7 @@ int mtk_pinconf_bias_disable_set(struct mtk_pinctrl *hw,
return 0;
}
+EXPORT_SYMBOL_GPL(mtk_pinconf_bias_disable_set);
int mtk_pinconf_bias_disable_get(struct mtk_pinctrl *hw,
const struct mtk_pin_desc *desc, int *res)
@@ -404,6 +409,7 @@ int mtk_pinconf_bias_disable_get(struct mtk_pinctrl *hw,
return 0;
}
+EXPORT_SYMBOL_GPL(mtk_pinconf_bias_disable_get);
int mtk_pinconf_bias_set(struct mtk_pinctrl *hw,
const struct mtk_pin_desc *desc, bool pullup)
@@ -423,6 +429,7 @@ int mtk_pinconf_bias_set(struct mtk_pinctrl *hw,
return 0;
}
+EXPORT_SYMBOL_GPL(mtk_pinconf_bias_set);
int mtk_pinconf_bias_get(struct mtk_pinctrl *hw,
const struct mtk_pin_desc *desc, bool pullup, int *res)
@@ -442,6 +449,7 @@ int mtk_pinconf_bias_get(struct mtk_pinctrl *hw,
return 0;
}
+EXPORT_SYMBOL_GPL(mtk_pinconf_bias_get);
/* Revision 1 */
int mtk_pinconf_bias_disable_set_rev1(struct mtk_pinctrl *hw,
@@ -456,6 +464,7 @@ int mtk_pinconf_bias_disable_set_rev1(struct mtk_pinctrl *hw,
return 0;
}
+EXPORT_SYMBOL_GPL(mtk_pinconf_bias_disable_set_rev1);
int mtk_pinconf_bias_disable_get_rev1(struct mtk_pinctrl *hw,
const struct mtk_pin_desc *desc, int *res)
@@ -473,6 +482,7 @@ int mtk_pinconf_bias_disable_get_rev1(struct mtk_pinctrl *hw,
return 0;
}
+EXPORT_SYMBOL_GPL(mtk_pinconf_bias_disable_get_rev1);
int mtk_pinconf_bias_set_rev1(struct mtk_pinctrl *hw,
const struct mtk_pin_desc *desc, bool pullup)
@@ -492,6 +502,7 @@ int mtk_pinconf_bias_set_rev1(struct mtk_pinctrl *hw,
return 0;
}
+EXPORT_SYMBOL_GPL(mtk_pinconf_bias_set_rev1);
int mtk_pinconf_bias_get_rev1(struct mtk_pinctrl *hw,
const struct mtk_pin_desc *desc, bool pullup,
@@ -517,6 +528,7 @@ int mtk_pinconf_bias_get_rev1(struct mtk_pinctrl *hw,
return 0;
}
+EXPORT_SYMBOL_GPL(mtk_pinconf_bias_set_gev1);
/* Combo for the following pull register type:
* 1. PU + PD
@@ -717,6 +729,7 @@ int mtk_pinconf_bias_set_combo(struct mtk_pinctrl *hw,
out:
return err;
}
+EXPORT_SYMBOL_GPL(mtk_pinconf_bias_set_combo);
int mtk_pinconf_bias_get_combo(struct mtk_pinctrl *hw,
const struct mtk_pin_desc *desc,
@@ -737,6 +750,7 @@ int mtk_pinconf_bias_get_combo(struct mtk_pinctrl *hw,
out:
return err;
}
+EXPORT_SYMBOL_GPL(mtk_pinconf_bias_get_combo);
/* Revision 0 */
int mtk_pinconf_drive_set(struct mtk_pinctrl *hw,
@@ -766,6 +780,7 @@ int mtk_pinconf_drive_set(struct mtk_pinctrl *hw,
return err;
}
+EXPORT_SYMBOL_GPL(mtk_pinconf_drive_set);
int mtk_pinconf_drive_get(struct mtk_pinctrl *hw,
const struct mtk_pin_desc *desc, int *val)
@@ -790,6 +805,7 @@ int mtk_pinconf_drive_get(struct mtk_pinctrl *hw,
return 0;
}
+EXPORT_SYMBOL_GPL(mtk_pinconf_drive_get);
/* Revision 1 */
int mtk_pinconf_drive_set_rev1(struct mtk_pinctrl *hw,
@@ -811,6 +827,7 @@ int mtk_pinconf_drive_set_rev1(struct mtk_pinctrl *hw,
return err;
}
+EXPORT_SYMBOL_GPL(mtk_pinconf_drive_set_rev1);
int mtk_pinconf_drive_get_rev1(struct mtk_pinctrl *hw,
const struct mtk_pin_desc *desc, int *val)
@@ -828,18 +845,21 @@ int mtk_pinconf_drive_get_rev1(struct mtk_pinctrl *hw,
return 0;
}
+EXPORT_SYMBOL_GPL(mtk_pinconf_drive_get_rev1);
int mtk_pinconf_drive_set_raw(struct mtk_pinctrl *hw,
const struct mtk_pin_desc *desc, u32 arg)
{
return mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV, arg);
}
+EXPORT_SYMBOL_GPL(mtk_pinconf_drive_set_raw);
int mtk_pinconf_drive_get_raw(struct mtk_pinctrl *hw,
const struct mtk_pin_desc *desc, int *val)
{
return mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DRV, val);
}
+EXPORT_SYMBOL_GPL(mtk_pinconf_drive_get_raw);
int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw,
const struct mtk_pin_desc *desc, bool pullup,
@@ -880,6 +900,7 @@ int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw,
return err;
}
+EXPORT_SYMBOL_GPL(mtk_pinconf_adv_pull_set);
int mtk_pinconf_adv_pull_get(struct mtk_pinctrl *hw,
const struct mtk_pin_desc *desc, bool pullup,
@@ -922,6 +943,7 @@ int mtk_pinconf_adv_pull_get(struct mtk_pinctrl *hw,
return 0;
}
+EXPORT_SYMBOL_GPL(mtk_pinconf_adv_pull_get);
int mtk_pinconf_adv_drive_set(struct mtk_pinctrl *hw,
const struct mtk_pin_desc *desc, u32 arg)
@@ -948,6 +970,7 @@ int mtk_pinconf_adv_drive_set(struct mtk_pinctrl *hw,
return err;
}
+EXPORT_SYMBOL_GPL(mtk_pinconf_adv_drive_set);
int mtk_pinconf_adv_drive_get(struct mtk_pinctrl *hw,
const struct mtk_pin_desc *desc, u32 *val)
@@ -971,3 +994,4 @@ int mtk_pinconf_adv_drive_get(struct mtk_pinctrl *hw,
return 0;
}
+EXPORT_SYMBOL_GPL(mtk_pinconf_adv_drive_get);
diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c
index 83bf29c..af97794 100644
--- a/drivers/pinctrl/mediatek/pinctrl-paris.c
+++ b/drivers/pinctrl/mediatek/pinctrl-paris.c
@@ -9,6 +9,7 @@
* Hongzhou.Yang <[email protected]>
*/
+#include <linux/module.h>
#include <linux/gpio/driver.h>
#include <dt-bindings/pinctrl/mt65xx.h>
#include "pinctrl-paris.h"
@@ -1037,3 +1038,7 @@ static int mtk_paris_pinctrl_resume(struct device *device)
.suspend_noirq = mtk_paris_pinctrl_suspend,
.resume_noirq = mtk_paris_pinctrl_resume,
};
+EXPORT_SYMBOL_GPL(mtk_paris_pinctrl_probe);
+
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("MediaTek Pinctrl Common Driver V2 Paris");
diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c
index 9eb8630..dfef471 100644
--- a/drivers/pinctrl/pinconf-generic.c
+++ b/drivers/pinctrl/pinconf-generic.c
@@ -286,6 +286,7 @@ int pinconf_generic_parse_dt_config(struct device_node *np,
kfree(cfg);
return ret;
}
+EXPORT_SYMBOL_GPL(pinconf_generic_parse_dt_config);
int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev,
struct device_node *np, struct pinctrl_map **map,
--
1.8.1.1.dirty
From: Light Hsieh <[email protected]>
1. drivers/pinctrl/mediatek/Kconfig:
1.1 PINCTRL_MT6765: change from bool to tristate. It is specified in
defconfig file.
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 are n.
* PINCTRL_MTK_PARIS will be m if all PINCTRL_MTXXXX selecting
PINCTRL_MTK_PARIS are m.
1.3 PINCTRL_MTK_MOORE: select EINT_MTK and PINCTRL_MTK_V2.
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 both 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 kernel module or
built-in.
Signed-off-by: Light Hsieh <[email protected]>
---
drivers/pinctrl/mediatek/Kconfig | 17 +++++++++++++----
drivers/pinctrl/mediatek/Makefile | 5 +++--
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/drivers/pinctrl/mediatek/Kconfig b/drivers/pinctrl/mediatek/Kconfig
index 701f9af..d48c313 100644
--- a/drivers/pinctrl/mediatek/Kconfig
+++ b/drivers/pinctrl/mediatek/Kconfig
@@ -3,10 +3,12 @@ menu "MediaTek pinctrl drivers"
depends on ARCH_MEDIATEK || COMPILE_TEST
config EINT_MTK
- bool "MediaTek External Interrupt Support"
+ tristate "MediaTek External Interrupt Support"
depends on PINCTRL_MTK || PINCTRL_MTK_MOORE || PINCTRL_MTK_PARIS || COMPILE_TEST
select GPIOLIB
select IRQ_DOMAIN
+ default y if PINCTRL_MTK || PINCTRL_MTK_MOORE
+ default PINCTRL_MTK_PARIS
config PINCTRL_MTK
bool
@@ -17,23 +19,30 @@ config PINCTRL_MTK
select EINT_MTK
select OF_GPIO
+config PINCTRL_MTK_V2
+ tristate
+ depends on PINCTRL_MTK_MOORE || PINCTRL_MTK_PARIS
+
config PINCTRL_MTK_MOORE
- bool
+ tristate
depends on OF
select GENERIC_PINCONF
select GENERIC_PINCTRL_GROUPS
select GENERIC_PINMUX_FUNCTIONS
+ select EINT_MTK
select GPIOLIB
select OF_GPIO
+ select PINCTRL_MTK_V2
config PINCTRL_MTK_PARIS
- bool
+ tristate
depends on OF
select PINMUX
select GENERIC_PINCONF
select GPIOLIB
select EINT_MTK
select OF_GPIO
+ select PINCTRL_MTK_V2
# For ARMv7 SoCs
config PINCTRL_MT2701
@@ -80,7 +89,7 @@ config PINCTRL_MT2712
select PINCTRL_MTK
config PINCTRL_MT6765
- bool "Mediatek MT6765 pin control"
+ tristate "Mediatek MT6765 pin control"
depends on OF
depends on ARM64 || COMPILE_TEST
default ARM64 && ARCH_MEDIATEK
diff --git a/drivers/pinctrl/mediatek/Makefile b/drivers/pinctrl/mediatek/Makefile
index a74325a..4b71328 100644
--- a/drivers/pinctrl/mediatek/Makefile
+++ b/drivers/pinctrl/mediatek/Makefile
@@ -2,8 +2,9 @@
# Core
obj-$(CONFIG_EINT_MTK) += mtk-eint.o
obj-$(CONFIG_PINCTRL_MTK) += pinctrl-mtk-common.o
-obj-$(CONFIG_PINCTRL_MTK_MOORE) += pinctrl-moore.o pinctrl-mtk-common-v2.o
-obj-$(CONFIG_PINCTRL_MTK_PARIS) += pinctrl-paris.o pinctrl-mtk-common-v2.o
+obj-$(CONFIG_PINCTRL_MTK_V2) += pinctrl-mtk-common-v2.o
+obj-$(CONFIG_PINCTRL_MTK_MOORE) += pinctrl-moore.o
+obj-$(CONFIG_PINCTRL_MTK_PARIS) += pinctrl-paris.o
# SoC Drivers
obj-$(CONFIG_PINCTRL_MT2701) += pinctrl-mt2701.o
--
1.8.1.1.dirty
Dear Reviewers:
Google plan to make platform driver as kernel module in future Android
kernel.
This patch series prepare to make platforms that use MediaTek pinctrl
paris driver (pinctrl-paris.c, pinctrl-mtk-common-v2.c, and mtk-eint.c)
compatible for building either kernel module or built-in.
Please give your comments.
Light
On Thu, 2020-02-13 at 14:08 +0800, [email protected] wrote:
> From: Light Hsieh <[email protected]>
>
> Google plan to make platform driver as kernel module for future
> Andriod kernel. This patch make platforms that use pinctrl-paris.c
> of MediaTek pinctrl v2 ready for building kernel module.
>
> Signed-off-by: Light Hsieh <[email protected]>
> ---
> 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 | 5 +++++
> drivers/pinctrl/pinconf-generic.c | 1 +
> 5 files changed, 43 insertions(+)
>
> diff --git a/drivers/pinctrl/mediatek/mtk-eint.c b/drivers/pinctrl/mediatek/mtk-eint.c
> index 7e526bcf..99703a8 100644
> --- a/drivers/pinctrl/mediatek/mtk-eint.c
> +++ b/drivers/pinctrl/mediatek/mtk-eint.c
> @@ -9,6 +9,7 @@
> *
> */
>
> +#include <linux/module.h>
> #include <linux/delay.h>
> #include <linux/err.h>
> #include <linux/gpio/driver.h>
> @@ -379,6 +380,7 @@ int mtk_eint_do_suspend(struct mtk_eint *eint)
>
> return 0;
> }
> +EXPORT_SYMBOL_GPL(mtk_eint_do_suspend);
>
> int mtk_eint_do_resume(struct mtk_eint *eint)
> {
> @@ -386,6 +388,7 @@ int mtk_eint_do_resume(struct mtk_eint *eint)
>
> return 0;
> }
> +EXPORT_SYMBOL_GPL(mtk_eint_do_resume);
>
> int mtk_eint_set_debounce(struct mtk_eint *eint, unsigned long eint_num,
> unsigned int debounce)
> @@ -440,6 +443,7 @@ int mtk_eint_set_debounce(struct mtk_eint *eint, unsigned long eint_num,
>
> return 0;
> }
> +EXPORT_SYMBOL_GPL(mtk_eint_set_debounce);
>
> int mtk_eint_find_irq(struct mtk_eint *eint, unsigned long eint_n)
> {
> @@ -451,6 +455,7 @@ int mtk_eint_find_irq(struct mtk_eint *eint, unsigned long eint_n)
>
> return irq;
> }
> +EXPORT_SYMBOL_GPL(mtk_eint_find_irq);
>
> int mtk_eint_do_init(struct mtk_eint *eint)
> {
> @@ -495,3 +500,7 @@ int mtk_eint_do_init(struct mtk_eint *eint)
>
> return 0;
> }
> +EXPORT_SYMBOL_GPL(mtk_eint_do_init);
> +
> +MODULE_LICENSE("GPL v2");
> +MODULE_DESCRIPTION("MediaTek EINT Driver");
> diff --git a/drivers/pinctrl/mediatek/pinctrl-mt6765.c b/drivers/pinctrl/mediatek/pinctrl-mt6765.c
> index 905dae8c..2c59d39 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-mt6765.c
> +++ b/drivers/pinctrl/mediatek/pinctrl-mt6765.c
> @@ -6,6 +6,7 @@
> *
> */
>
> +#include <linux/module.h>
> #include "pinctrl-mtk-mt6765.h"
> #include "pinctrl-paris.h"
>
> @@ -1103,3 +1104,6 @@ static int __init mt6765_pinctrl_init(void)
> return platform_driver_register(&mt6765_pinctrl_driver);
> }
> arch_initcall(mt6765_pinctrl_init);
> +
> +MODULE_LICENSE("GPL v2");
> +MODULE_DESCRIPTION("MediaTek MT6765 Pinctrl Driver");
> diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> index 1da9425..cdf2d69 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> @@ -6,6 +6,7 @@
> *
> */
>
> +#include <linux/module.h>
> #include <dt-bindings/pinctrl/mt65xx.h>
> #include <linux/device.h>
> #include <linux/err.h>
> @@ -206,6 +207,7 @@ int mtk_hw_set_value(struct mtk_pinctrl *hw, const struct mtk_pin_desc *desc,
>
> return 0;
> }
> +EXPORT_SYMBOL_GPL(mtk_hw_set_value);
>
> int mtk_hw_get_value(struct mtk_pinctrl *hw, const struct mtk_pin_desc *desc,
> int field, int *value)
> @@ -225,6 +227,7 @@ int mtk_hw_get_value(struct mtk_pinctrl *hw, const struct mtk_pin_desc *desc,
>
> return 0;
> }
> +EXPORT_SYMBOL_GPL(mtk_hw_get_value);
>
> static int mtk_xt_find_eint_num(struct mtk_pinctrl *hw, unsigned long eint_n)
> {
> @@ -363,6 +366,7 @@ int mtk_build_eint(struct mtk_pinctrl *hw, struct platform_device *pdev)
>
> return mtk_eint_do_init(hw->eint);
> }
> +EXPORT_SYMBOL_GPL(mtk_build_eint);
>
> /* Revision 0 */
> int mtk_pinconf_bias_disable_set(struct mtk_pinctrl *hw,
> @@ -382,6 +386,7 @@ int mtk_pinconf_bias_disable_set(struct mtk_pinctrl *hw,
>
> return 0;
> }
> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_disable_set);
>
> int mtk_pinconf_bias_disable_get(struct mtk_pinctrl *hw,
> const struct mtk_pin_desc *desc, int *res)
> @@ -404,6 +409,7 @@ int mtk_pinconf_bias_disable_get(struct mtk_pinctrl *hw,
>
> return 0;
> }
> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_disable_get);
>
> int mtk_pinconf_bias_set(struct mtk_pinctrl *hw,
> const struct mtk_pin_desc *desc, bool pullup)
> @@ -423,6 +429,7 @@ int mtk_pinconf_bias_set(struct mtk_pinctrl *hw,
>
> return 0;
> }
> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_set);
>
> int mtk_pinconf_bias_get(struct mtk_pinctrl *hw,
> const struct mtk_pin_desc *desc, bool pullup, int *res)
> @@ -442,6 +449,7 @@ int mtk_pinconf_bias_get(struct mtk_pinctrl *hw,
>
> return 0;
> }
> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_get);
>
> /* Revision 1 */
> int mtk_pinconf_bias_disable_set_rev1(struct mtk_pinctrl *hw,
> @@ -456,6 +464,7 @@ int mtk_pinconf_bias_disable_set_rev1(struct mtk_pinctrl *hw,
>
> return 0;
> }
> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_disable_set_rev1);
>
> int mtk_pinconf_bias_disable_get_rev1(struct mtk_pinctrl *hw,
> const struct mtk_pin_desc *desc, int *res)
> @@ -473,6 +482,7 @@ int mtk_pinconf_bias_disable_get_rev1(struct mtk_pinctrl *hw,
>
> return 0;
> }
> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_disable_get_rev1);
>
> int mtk_pinconf_bias_set_rev1(struct mtk_pinctrl *hw,
> const struct mtk_pin_desc *desc, bool pullup)
> @@ -492,6 +502,7 @@ int mtk_pinconf_bias_set_rev1(struct mtk_pinctrl *hw,
>
> return 0;
> }
> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_set_rev1);
>
> int mtk_pinconf_bias_get_rev1(struct mtk_pinctrl *hw,
> const struct mtk_pin_desc *desc, bool pullup,
> @@ -517,6 +528,7 @@ int mtk_pinconf_bias_get_rev1(struct mtk_pinctrl *hw,
>
> return 0;
> }
> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_set_gev1);
>
> /* Combo for the following pull register type:
> * 1. PU + PD
> @@ -717,6 +729,7 @@ int mtk_pinconf_bias_set_combo(struct mtk_pinctrl *hw,
> out:
> return err;
> }
> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_set_combo);
>
> int mtk_pinconf_bias_get_combo(struct mtk_pinctrl *hw,
> const struct mtk_pin_desc *desc,
> @@ -737,6 +750,7 @@ int mtk_pinconf_bias_get_combo(struct mtk_pinctrl *hw,
> out:
> return err;
> }
> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_get_combo);
>
> /* Revision 0 */
> int mtk_pinconf_drive_set(struct mtk_pinctrl *hw,
> @@ -766,6 +780,7 @@ int mtk_pinconf_drive_set(struct mtk_pinctrl *hw,
>
> return err;
> }
> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_set);
>
> int mtk_pinconf_drive_get(struct mtk_pinctrl *hw,
> const struct mtk_pin_desc *desc, int *val)
> @@ -790,6 +805,7 @@ int mtk_pinconf_drive_get(struct mtk_pinctrl *hw,
>
> return 0;
> }
> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_get);
>
> /* Revision 1 */
> int mtk_pinconf_drive_set_rev1(struct mtk_pinctrl *hw,
> @@ -811,6 +827,7 @@ int mtk_pinconf_drive_set_rev1(struct mtk_pinctrl *hw,
>
> return err;
> }
> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_set_rev1);
>
> int mtk_pinconf_drive_get_rev1(struct mtk_pinctrl *hw,
> const struct mtk_pin_desc *desc, int *val)
> @@ -828,18 +845,21 @@ int mtk_pinconf_drive_get_rev1(struct mtk_pinctrl *hw,
>
> return 0;
> }
> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_get_rev1);
>
> int mtk_pinconf_drive_set_raw(struct mtk_pinctrl *hw,
> const struct mtk_pin_desc *desc, u32 arg)
> {
> return mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV, arg);
> }
> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_set_raw);
>
> int mtk_pinconf_drive_get_raw(struct mtk_pinctrl *hw,
> const struct mtk_pin_desc *desc, int *val)
> {
> return mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DRV, val);
> }
> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_get_raw);
>
> int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw,
> const struct mtk_pin_desc *desc, bool pullup,
> @@ -880,6 +900,7 @@ int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw,
>
> return err;
> }
> +EXPORT_SYMBOL_GPL(mtk_pinconf_adv_pull_set);
>
> int mtk_pinconf_adv_pull_get(struct mtk_pinctrl *hw,
> const struct mtk_pin_desc *desc, bool pullup,
> @@ -922,6 +943,7 @@ int mtk_pinconf_adv_pull_get(struct mtk_pinctrl *hw,
>
> return 0;
> }
> +EXPORT_SYMBOL_GPL(mtk_pinconf_adv_pull_get);
>
> int mtk_pinconf_adv_drive_set(struct mtk_pinctrl *hw,
> const struct mtk_pin_desc *desc, u32 arg)
> @@ -948,6 +970,7 @@ int mtk_pinconf_adv_drive_set(struct mtk_pinctrl *hw,
>
> return err;
> }
> +EXPORT_SYMBOL_GPL(mtk_pinconf_adv_drive_set);
>
> int mtk_pinconf_adv_drive_get(struct mtk_pinctrl *hw,
> const struct mtk_pin_desc *desc, u32 *val)
> @@ -971,3 +994,4 @@ int mtk_pinconf_adv_drive_get(struct mtk_pinctrl *hw,
>
> return 0;
> }
> +EXPORT_SYMBOL_GPL(mtk_pinconf_adv_drive_get);
> diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c
> index 83bf29c..af97794 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-paris.c
> +++ b/drivers/pinctrl/mediatek/pinctrl-paris.c
> @@ -9,6 +9,7 @@
> * Hongzhou.Yang <[email protected]>
> */
>
> +#include <linux/module.h>
> #include <linux/gpio/driver.h>
> #include <dt-bindings/pinctrl/mt65xx.h>
> #include "pinctrl-paris.h"
> @@ -1037,3 +1038,7 @@ static int mtk_paris_pinctrl_resume(struct device *device)
> .suspend_noirq = mtk_paris_pinctrl_suspend,
> .resume_noirq = mtk_paris_pinctrl_resume,
> };
> +EXPORT_SYMBOL_GPL(mtk_paris_pinctrl_probe);
> +
> +MODULE_LICENSE("GPL v2");
> +MODULE_DESCRIPTION("MediaTek Pinctrl Common Driver V2 Paris");
> diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c
> index 9eb8630..dfef471 100644
> --- a/drivers/pinctrl/pinconf-generic.c
> +++ b/drivers/pinctrl/pinconf-generic.c
> @@ -286,6 +286,7 @@ int pinconf_generic_parse_dt_config(struct device_node *np,
> kfree(cfg);
> return ret;
> }
> +EXPORT_SYMBOL_GPL(pinconf_generic_parse_dt_config);
>
> int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev,
> struct device_node *np, struct pinctrl_map **map,
On 13/02/2020 07:17, Light Hsieh wrote:
> Dear Reviewers:
>
> Google plan to make platform driver as kernel module in future Android
> kernel.
> This patch series prepare to make platforms that use MediaTek pinctrl
> paris driver (pinctrl-paris.c, pinctrl-mtk-common-v2.c, and mtk-eint.c)
> compatible for building either kernel module or built-in.
>
> Please give your comments.
>
I think I didn't explain myself good enough.
These should be three patches:
1. change mtk-eint driver + Kconfig to be loadable as a module
2. change pinctrl-paris + Kconfig to be loadable as a module
3. change mt6765.
Please make sure that every patch compiles and does not break the system. This
will later help to use git-bisect to hunt down bugs in the kernel.
Regards,
Matthias
> Light
>
> On Thu, 2020-02-13 at 14:08 +0800, [email protected] wrote:
>> From: Light Hsieh <[email protected]>
>>
>> Google plan to make platform driver as kernel module for future
>> Andriod kernel. This patch make platforms that use pinctrl-paris.c
>> of MediaTek pinctrl v2 ready for building kernel module.
>>
>> Signed-off-by: Light Hsieh <[email protected]>
>> ---
>> 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 | 5 +++++
>> drivers/pinctrl/pinconf-generic.c | 1 +
>> 5 files changed, 43 insertions(+)
>>
>> diff --git a/drivers/pinctrl/mediatek/mtk-eint.c b/drivers/pinctrl/mediatek/mtk-eint.c
>> index 7e526bcf..99703a8 100644
>> --- a/drivers/pinctrl/mediatek/mtk-eint.c
>> +++ b/drivers/pinctrl/mediatek/mtk-eint.c
>> @@ -9,6 +9,7 @@
>> *
>> */
>>
>> +#include <linux/module.h>
>> #include <linux/delay.h>
>> #include <linux/err.h>
>> #include <linux/gpio/driver.h>
>> @@ -379,6 +380,7 @@ int mtk_eint_do_suspend(struct mtk_eint *eint)
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_eint_do_suspend);
>>
>> int mtk_eint_do_resume(struct mtk_eint *eint)
>> {
>> @@ -386,6 +388,7 @@ int mtk_eint_do_resume(struct mtk_eint *eint)
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_eint_do_resume);
>>
>> int mtk_eint_set_debounce(struct mtk_eint *eint, unsigned long eint_num,
>> unsigned int debounce)
>> @@ -440,6 +443,7 @@ int mtk_eint_set_debounce(struct mtk_eint *eint, unsigned long eint_num,
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_eint_set_debounce);
>>
>> int mtk_eint_find_irq(struct mtk_eint *eint, unsigned long eint_n)
>> {
>> @@ -451,6 +455,7 @@ int mtk_eint_find_irq(struct mtk_eint *eint, unsigned long eint_n)
>>
>> return irq;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_eint_find_irq);
>>
>> int mtk_eint_do_init(struct mtk_eint *eint)
>> {
>> @@ -495,3 +500,7 @@ int mtk_eint_do_init(struct mtk_eint *eint)
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_eint_do_init);
>> +
>> +MODULE_LICENSE("GPL v2");
>> +MODULE_DESCRIPTION("MediaTek EINT Driver");
>> diff --git a/drivers/pinctrl/mediatek/pinctrl-mt6765.c b/drivers/pinctrl/mediatek/pinctrl-mt6765.c
>> index 905dae8c..2c59d39 100644
>> --- a/drivers/pinctrl/mediatek/pinctrl-mt6765.c
>> +++ b/drivers/pinctrl/mediatek/pinctrl-mt6765.c
>> @@ -6,6 +6,7 @@
>> *
>> */
>>
>> +#include <linux/module.h>
>> #include "pinctrl-mtk-mt6765.h"
>> #include "pinctrl-paris.h"
>>
>> @@ -1103,3 +1104,6 @@ static int __init mt6765_pinctrl_init(void)
>> return platform_driver_register(&mt6765_pinctrl_driver);
>> }
>> arch_initcall(mt6765_pinctrl_init);
>> +
>> +MODULE_LICENSE("GPL v2");
>> +MODULE_DESCRIPTION("MediaTek MT6765 Pinctrl Driver");
>> diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
>> index 1da9425..cdf2d69 100644
>> --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
>> +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
>> @@ -6,6 +6,7 @@
>> *
>> */
>>
>> +#include <linux/module.h>
>> #include <dt-bindings/pinctrl/mt65xx.h>
>> #include <linux/device.h>
>> #include <linux/err.h>
>> @@ -206,6 +207,7 @@ int mtk_hw_set_value(struct mtk_pinctrl *hw, const struct mtk_pin_desc *desc,
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_hw_set_value);
>>
>> int mtk_hw_get_value(struct mtk_pinctrl *hw, const struct mtk_pin_desc *desc,
>> int field, int *value)
>> @@ -225,6 +227,7 @@ int mtk_hw_get_value(struct mtk_pinctrl *hw, const struct mtk_pin_desc *desc,
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_hw_get_value);
>>
>> static int mtk_xt_find_eint_num(struct mtk_pinctrl *hw, unsigned long eint_n)
>> {
>> @@ -363,6 +366,7 @@ int mtk_build_eint(struct mtk_pinctrl *hw, struct platform_device *pdev)
>>
>> return mtk_eint_do_init(hw->eint);
>> }
>> +EXPORT_SYMBOL_GPL(mtk_build_eint);
>>
>> /* Revision 0 */
>> int mtk_pinconf_bias_disable_set(struct mtk_pinctrl *hw,
>> @@ -382,6 +386,7 @@ int mtk_pinconf_bias_disable_set(struct mtk_pinctrl *hw,
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_disable_set);
>>
>> int mtk_pinconf_bias_disable_get(struct mtk_pinctrl *hw,
>> const struct mtk_pin_desc *desc, int *res)
>> @@ -404,6 +409,7 @@ int mtk_pinconf_bias_disable_get(struct mtk_pinctrl *hw,
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_disable_get);
>>
>> int mtk_pinconf_bias_set(struct mtk_pinctrl *hw,
>> const struct mtk_pin_desc *desc, bool pullup)
>> @@ -423,6 +429,7 @@ int mtk_pinconf_bias_set(struct mtk_pinctrl *hw,
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_set);
>>
>> int mtk_pinconf_bias_get(struct mtk_pinctrl *hw,
>> const struct mtk_pin_desc *desc, bool pullup, int *res)
>> @@ -442,6 +449,7 @@ int mtk_pinconf_bias_get(struct mtk_pinctrl *hw,
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_get);
>>
>> /* Revision 1 */
>> int mtk_pinconf_bias_disable_set_rev1(struct mtk_pinctrl *hw,
>> @@ -456,6 +464,7 @@ int mtk_pinconf_bias_disable_set_rev1(struct mtk_pinctrl *hw,
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_disable_set_rev1);
>>
>> int mtk_pinconf_bias_disable_get_rev1(struct mtk_pinctrl *hw,
>> const struct mtk_pin_desc *desc, int *res)
>> @@ -473,6 +482,7 @@ int mtk_pinconf_bias_disable_get_rev1(struct mtk_pinctrl *hw,
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_disable_get_rev1);
>>
>> int mtk_pinconf_bias_set_rev1(struct mtk_pinctrl *hw,
>> const struct mtk_pin_desc *desc, bool pullup)
>> @@ -492,6 +502,7 @@ int mtk_pinconf_bias_set_rev1(struct mtk_pinctrl *hw,
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_set_rev1);
>>
>> int mtk_pinconf_bias_get_rev1(struct mtk_pinctrl *hw,
>> const struct mtk_pin_desc *desc, bool pullup,
>> @@ -517,6 +528,7 @@ int mtk_pinconf_bias_get_rev1(struct mtk_pinctrl *hw,
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_set_gev1);
>>
>> /* Combo for the following pull register type:
>> * 1. PU + PD
>> @@ -717,6 +729,7 @@ int mtk_pinconf_bias_set_combo(struct mtk_pinctrl *hw,
>> out:
>> return err;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_set_combo);
>>
>> int mtk_pinconf_bias_get_combo(struct mtk_pinctrl *hw,
>> const struct mtk_pin_desc *desc,
>> @@ -737,6 +750,7 @@ int mtk_pinconf_bias_get_combo(struct mtk_pinctrl *hw,
>> out:
>> return err;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_get_combo);
>>
>> /* Revision 0 */
>> int mtk_pinconf_drive_set(struct mtk_pinctrl *hw,
>> @@ -766,6 +780,7 @@ int mtk_pinconf_drive_set(struct mtk_pinctrl *hw,
>>
>> return err;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_set);
>>
>> int mtk_pinconf_drive_get(struct mtk_pinctrl *hw,
>> const struct mtk_pin_desc *desc, int *val)
>> @@ -790,6 +805,7 @@ int mtk_pinconf_drive_get(struct mtk_pinctrl *hw,
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_get);
>>
>> /* Revision 1 */
>> int mtk_pinconf_drive_set_rev1(struct mtk_pinctrl *hw,
>> @@ -811,6 +827,7 @@ int mtk_pinconf_drive_set_rev1(struct mtk_pinctrl *hw,
>>
>> return err;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_set_rev1);
>>
>> int mtk_pinconf_drive_get_rev1(struct mtk_pinctrl *hw,
>> const struct mtk_pin_desc *desc, int *val)
>> @@ -828,18 +845,21 @@ int mtk_pinconf_drive_get_rev1(struct mtk_pinctrl *hw,
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_get_rev1);
>>
>> int mtk_pinconf_drive_set_raw(struct mtk_pinctrl *hw,
>> const struct mtk_pin_desc *desc, u32 arg)
>> {
>> return mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV, arg);
>> }
>> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_set_raw);
>>
>> int mtk_pinconf_drive_get_raw(struct mtk_pinctrl *hw,
>> const struct mtk_pin_desc *desc, int *val)
>> {
>> return mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DRV, val);
>> }
>> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_get_raw);
>>
>> int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw,
>> const struct mtk_pin_desc *desc, bool pullup,
>> @@ -880,6 +900,7 @@ int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw,
>>
>> return err;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_pinconf_adv_pull_set);
>>
>> int mtk_pinconf_adv_pull_get(struct mtk_pinctrl *hw,
>> const struct mtk_pin_desc *desc, bool pullup,
>> @@ -922,6 +943,7 @@ int mtk_pinconf_adv_pull_get(struct mtk_pinctrl *hw,
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_pinconf_adv_pull_get);
>>
>> int mtk_pinconf_adv_drive_set(struct mtk_pinctrl *hw,
>> const struct mtk_pin_desc *desc, u32 arg)
>> @@ -948,6 +970,7 @@ int mtk_pinconf_adv_drive_set(struct mtk_pinctrl *hw,
>>
>> return err;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_pinconf_adv_drive_set);
>>
>> int mtk_pinconf_adv_drive_get(struct mtk_pinctrl *hw,
>> const struct mtk_pin_desc *desc, u32 *val)
>> @@ -971,3 +994,4 @@ int mtk_pinconf_adv_drive_get(struct mtk_pinctrl *hw,
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(mtk_pinconf_adv_drive_get);
>> diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c
>> index 83bf29c..af97794 100644
>> --- a/drivers/pinctrl/mediatek/pinctrl-paris.c
>> +++ b/drivers/pinctrl/mediatek/pinctrl-paris.c
>> @@ -9,6 +9,7 @@
>> * Hongzhou.Yang <[email protected]>
>> */
>>
>> +#include <linux/module.h>
>> #include <linux/gpio/driver.h>
>> #include <dt-bindings/pinctrl/mt65xx.h>
>> #include "pinctrl-paris.h"
>> @@ -1037,3 +1038,7 @@ static int mtk_paris_pinctrl_resume(struct device *device)
>> .suspend_noirq = mtk_paris_pinctrl_suspend,
>> .resume_noirq = mtk_paris_pinctrl_resume,
>> };
>> +EXPORT_SYMBOL_GPL(mtk_paris_pinctrl_probe);
>> +
>> +MODULE_LICENSE("GPL v2");
>> +MODULE_DESCRIPTION("MediaTek Pinctrl Common Driver V2 Paris");
>> diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c
>> index 9eb8630..dfef471 100644
>> --- a/drivers/pinctrl/pinconf-generic.c
>> +++ b/drivers/pinctrl/pinconf-generic.c
>> @@ -286,6 +286,7 @@ int pinconf_generic_parse_dt_config(struct device_node *np,
>> kfree(cfg);
>> return ret;
>> }
>> +EXPORT_SYMBOL_GPL(pinconf_generic_parse_dt_config);
>>
>> int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev,
>> struct device_node *np, struct pinctrl_map **map,
>
> _______________________________________________
> Linux-mediatek mailing list
> [email protected]
> http://lists.infradead.org/mailman/listinfo/linux-mediatek
>
On Fri, 2020-02-14 at 11:37 +0100, Matthias Brugger wrote:
>
> On 13/02/2020 07:17, Light Hsieh wrote:
> > Dear Reviewers:
> >
> > Google plan to make platform driver as kernel module in future Android
> > kernel.
> > This patch series prepare to make platforms that use MediaTek pinctrl
> > paris driver (pinctrl-paris.c, pinctrl-mtk-common-v2.c, and mtk-eint.c)
> > compatible for building either kernel module or built-in.
> >
> > Please give your comments.
> >
>
> I think I didn't explain myself good enough.
> These should be three patches:
>
> 1. change mtk-eint driver + Kconfig to be loadable as a module
> 2. change pinctrl-paris + Kconfig to be loadable as a module
> 3. change mt6765.
>
> Please make sure that every patch compiles and does not break the system. This
> will later help to use git-bisect to hunt down bugs in the kernel.
>
> Regards,
> Matthias
>
Actually, I don't understand the necessity of splitting into 2 or 3
patches.
1. mtk-eint cannot be built as loadable module when pinctrl-paris and
pinctrl-mtk-common-v2 is not built as loadable module.
2. pinctrl-paris and pinctrl-mtk-common-v2 cannot be built as loadable
module when pinctrl-mtk6765 is not built as loadable module
3. besides, if pinctrl-mtk675 and any other MediaTek platform pinctrl
driver that use mtk-eint, pinctrl-paris, and pinctrl-mtk-common-v2 are
built-in, mtk-eint, pinctrl-paris, and pinctrl-mtk-common-v2 cannot be
built as loadable module.
The rationale can be learned from the description of change made to
Kconfig and Makefile.
So, just applying patch 1 and patch 2 of your proposal does not make
sense.
BR.
Light
> > Light
> >
> > On Thu, 2020-02-13 at 14:08 +0800, [email protected] wrote:
> >> From: Light Hsieh <[email protected]>
> >>
> >> Google plan to make platform driver as kernel module for future
> >> Andriod kernel. This patch make platforms that use pinctrl-paris.c
> >> of MediaTek pinctrl v2 ready for building kernel module.
> >>
> >> Signed-off-by: Light Hsieh <[email protected]>
> >> ---
> >> 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 | 5 +++++
> >> drivers/pinctrl/pinconf-generic.c | 1 +
> >> 5 files changed, 43 insertions(+)
> >>
> >> diff --git a/drivers/pinctrl/mediatek/mtk-eint.c b/drivers/pinctrl/mediatek/mtk-eint.c
> >> index 7e526bcf..99703a8 100644
> >> --- a/drivers/pinctrl/mediatek/mtk-eint.c
> >> +++ b/drivers/pinctrl/mediatek/mtk-eint.c
> >> @@ -9,6 +9,7 @@
> >> *
> >> */
> >>
> >> +#include <linux/module.h>
> >> #include <linux/delay.h>
> >> #include <linux/err.h>
> >> #include <linux/gpio/driver.h>
> >> @@ -379,6 +380,7 @@ int mtk_eint_do_suspend(struct mtk_eint *eint)
> >>
> >> return 0;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_eint_do_suspend);
> >>
> >> int mtk_eint_do_resume(struct mtk_eint *eint)
> >> {
> >> @@ -386,6 +388,7 @@ int mtk_eint_do_resume(struct mtk_eint *eint)
> >>
> >> return 0;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_eint_do_resume);
> >>
> >> int mtk_eint_set_debounce(struct mtk_eint *eint, unsigned long eint_num,
> >> unsigned int debounce)
> >> @@ -440,6 +443,7 @@ int mtk_eint_set_debounce(struct mtk_eint *eint, unsigned long eint_num,
> >>
> >> return 0;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_eint_set_debounce);
> >>
> >> int mtk_eint_find_irq(struct mtk_eint *eint, unsigned long eint_n)
> >> {
> >> @@ -451,6 +455,7 @@ int mtk_eint_find_irq(struct mtk_eint *eint, unsigned long eint_n)
> >>
> >> return irq;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_eint_find_irq);
> >>
> >> int mtk_eint_do_init(struct mtk_eint *eint)
> >> {
> >> @@ -495,3 +500,7 @@ int mtk_eint_do_init(struct mtk_eint *eint)
> >>
> >> return 0;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_eint_do_init);
> >> +
> >> +MODULE_LICENSE("GPL v2");
> >> +MODULE_DESCRIPTION("MediaTek EINT Driver");
> >> diff --git a/drivers/pinctrl/mediatek/pinctrl-mt6765.c b/drivers/pinctrl/mediatek/pinctrl-mt6765.c
> >> index 905dae8c..2c59d39 100644
> >> --- a/drivers/pinctrl/mediatek/pinctrl-mt6765.c
> >> +++ b/drivers/pinctrl/mediatek/pinctrl-mt6765.c
> >> @@ -6,6 +6,7 @@
> >> *
> >> */
> >>
> >> +#include <linux/module.h>
> >> #include "pinctrl-mtk-mt6765.h"
> >> #include "pinctrl-paris.h"
> >>
> >> @@ -1103,3 +1104,6 @@ static int __init mt6765_pinctrl_init(void)
> >> return platform_driver_register(&mt6765_pinctrl_driver);
> >> }
> >> arch_initcall(mt6765_pinctrl_init);
> >> +
> >> +MODULE_LICENSE("GPL v2");
> >> +MODULE_DESCRIPTION("MediaTek MT6765 Pinctrl Driver");
> >> diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> >> index 1da9425..cdf2d69 100644
> >> --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> >> +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> >> @@ -6,6 +6,7 @@
> >> *
> >> */
> >>
> >> +#include <linux/module.h>
> >> #include <dt-bindings/pinctrl/mt65xx.h>
> >> #include <linux/device.h>
> >> #include <linux/err.h>
> >> @@ -206,6 +207,7 @@ int mtk_hw_set_value(struct mtk_pinctrl *hw, const struct mtk_pin_desc *desc,
> >>
> >> return 0;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_hw_set_value);
> >>
> >> int mtk_hw_get_value(struct mtk_pinctrl *hw, const struct mtk_pin_desc *desc,
> >> int field, int *value)
> >> @@ -225,6 +227,7 @@ int mtk_hw_get_value(struct mtk_pinctrl *hw, const struct mtk_pin_desc *desc,
> >>
> >> return 0;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_hw_get_value);
> >>
> >> static int mtk_xt_find_eint_num(struct mtk_pinctrl *hw, unsigned long eint_n)
> >> {
> >> @@ -363,6 +366,7 @@ int mtk_build_eint(struct mtk_pinctrl *hw, struct platform_device *pdev)
> >>
> >> return mtk_eint_do_init(hw->eint);
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_build_eint);
> >>
> >> /* Revision 0 */
> >> int mtk_pinconf_bias_disable_set(struct mtk_pinctrl *hw,
> >> @@ -382,6 +386,7 @@ int mtk_pinconf_bias_disable_set(struct mtk_pinctrl *hw,
> >>
> >> return 0;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_disable_set);
> >>
> >> int mtk_pinconf_bias_disable_get(struct mtk_pinctrl *hw,
> >> const struct mtk_pin_desc *desc, int *res)
> >> @@ -404,6 +409,7 @@ int mtk_pinconf_bias_disable_get(struct mtk_pinctrl *hw,
> >>
> >> return 0;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_disable_get);
> >>
> >> int mtk_pinconf_bias_set(struct mtk_pinctrl *hw,
> >> const struct mtk_pin_desc *desc, bool pullup)
> >> @@ -423,6 +429,7 @@ int mtk_pinconf_bias_set(struct mtk_pinctrl *hw,
> >>
> >> return 0;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_set);
> >>
> >> int mtk_pinconf_bias_get(struct mtk_pinctrl *hw,
> >> const struct mtk_pin_desc *desc, bool pullup, int *res)
> >> @@ -442,6 +449,7 @@ int mtk_pinconf_bias_get(struct mtk_pinctrl *hw,
> >>
> >> return 0;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_get);
> >>
> >> /* Revision 1 */
> >> int mtk_pinconf_bias_disable_set_rev1(struct mtk_pinctrl *hw,
> >> @@ -456,6 +464,7 @@ int mtk_pinconf_bias_disable_set_rev1(struct mtk_pinctrl *hw,
> >>
> >> return 0;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_disable_set_rev1);
> >>
> >> int mtk_pinconf_bias_disable_get_rev1(struct mtk_pinctrl *hw,
> >> const struct mtk_pin_desc *desc, int *res)
> >> @@ -473,6 +482,7 @@ int mtk_pinconf_bias_disable_get_rev1(struct mtk_pinctrl *hw,
> >>
> >> return 0;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_disable_get_rev1);
> >>
> >> int mtk_pinconf_bias_set_rev1(struct mtk_pinctrl *hw,
> >> const struct mtk_pin_desc *desc, bool pullup)
> >> @@ -492,6 +502,7 @@ int mtk_pinconf_bias_set_rev1(struct mtk_pinctrl *hw,
> >>
> >> return 0;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_set_rev1);
> >>
> >> int mtk_pinconf_bias_get_rev1(struct mtk_pinctrl *hw,
> >> const struct mtk_pin_desc *desc, bool pullup,
> >> @@ -517,6 +528,7 @@ int mtk_pinconf_bias_get_rev1(struct mtk_pinctrl *hw,
> >>
> >> return 0;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_set_gev1);
> >>
> >> /* Combo for the following pull register type:
> >> * 1. PU + PD
> >> @@ -717,6 +729,7 @@ int mtk_pinconf_bias_set_combo(struct mtk_pinctrl *hw,
> >> out:
> >> return err;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_set_combo);
> >>
> >> int mtk_pinconf_bias_get_combo(struct mtk_pinctrl *hw,
> >> const struct mtk_pin_desc *desc,
> >> @@ -737,6 +750,7 @@ int mtk_pinconf_bias_get_combo(struct mtk_pinctrl *hw,
> >> out:
> >> return err;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_get_combo);
> >>
> >> /* Revision 0 */
> >> int mtk_pinconf_drive_set(struct mtk_pinctrl *hw,
> >> @@ -766,6 +780,7 @@ int mtk_pinconf_drive_set(struct mtk_pinctrl *hw,
> >>
> >> return err;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_set);
> >>
> >> int mtk_pinconf_drive_get(struct mtk_pinctrl *hw,
> >> const struct mtk_pin_desc *desc, int *val)
> >> @@ -790,6 +805,7 @@ int mtk_pinconf_drive_get(struct mtk_pinctrl *hw,
> >>
> >> return 0;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_get);
> >>
> >> /* Revision 1 */
> >> int mtk_pinconf_drive_set_rev1(struct mtk_pinctrl *hw,
> >> @@ -811,6 +827,7 @@ int mtk_pinconf_drive_set_rev1(struct mtk_pinctrl *hw,
> >>
> >> return err;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_set_rev1);
> >>
> >> int mtk_pinconf_drive_get_rev1(struct mtk_pinctrl *hw,
> >> const struct mtk_pin_desc *desc, int *val)
> >> @@ -828,18 +845,21 @@ int mtk_pinconf_drive_get_rev1(struct mtk_pinctrl *hw,
> >>
> >> return 0;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_get_rev1);
> >>
> >> int mtk_pinconf_drive_set_raw(struct mtk_pinctrl *hw,
> >> const struct mtk_pin_desc *desc, u32 arg)
> >> {
> >> return mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV, arg);
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_set_raw);
> >>
> >> int mtk_pinconf_drive_get_raw(struct mtk_pinctrl *hw,
> >> const struct mtk_pin_desc *desc, int *val)
> >> {
> >> return mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DRV, val);
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_get_raw);
> >>
> >> int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw,
> >> const struct mtk_pin_desc *desc, bool pullup,
> >> @@ -880,6 +900,7 @@ int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw,
> >>
> >> return err;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_pinconf_adv_pull_set);
> >>
> >> int mtk_pinconf_adv_pull_get(struct mtk_pinctrl *hw,
> >> const struct mtk_pin_desc *desc, bool pullup,
> >> @@ -922,6 +943,7 @@ int mtk_pinconf_adv_pull_get(struct mtk_pinctrl *hw,
> >>
> >> return 0;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_pinconf_adv_pull_get);
> >>
> >> int mtk_pinconf_adv_drive_set(struct mtk_pinctrl *hw,
> >> const struct mtk_pin_desc *desc, u32 arg)
> >> @@ -948,6 +970,7 @@ int mtk_pinconf_adv_drive_set(struct mtk_pinctrl *hw,
> >>
> >> return err;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_pinconf_adv_drive_set);
> >>
> >> int mtk_pinconf_adv_drive_get(struct mtk_pinctrl *hw,
> >> const struct mtk_pin_desc *desc, u32 *val)
> >> @@ -971,3 +994,4 @@ int mtk_pinconf_adv_drive_get(struct mtk_pinctrl *hw,
> >>
> >> return 0;
> >> }
> >> +EXPORT_SYMBOL_GPL(mtk_pinconf_adv_drive_get);
> >> diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c
> >> index 83bf29c..af97794 100644
> >> --- a/drivers/pinctrl/mediatek/pinctrl-paris.c
> >> +++ b/drivers/pinctrl/mediatek/pinctrl-paris.c
> >> @@ -9,6 +9,7 @@
> >> * Hongzhou.Yang <[email protected]>
> >> */
> >>
> >> +#include <linux/module.h>
> >> #include <linux/gpio/driver.h>
> >> #include <dt-bindings/pinctrl/mt65xx.h>
> >> #include "pinctrl-paris.h"
> >> @@ -1037,3 +1038,7 @@ static int mtk_paris_pinctrl_resume(struct device *device)
> >> .suspend_noirq = mtk_paris_pinctrl_suspend,
> >> .resume_noirq = mtk_paris_pinctrl_resume,
> >> };
> >> +EXPORT_SYMBOL_GPL(mtk_paris_pinctrl_probe);
> >> +
> >> +MODULE_LICENSE("GPL v2");
> >> +MODULE_DESCRIPTION("MediaTek Pinctrl Common Driver V2 Paris");
> >> diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c
> >> index 9eb8630..dfef471 100644
> >> --- a/drivers/pinctrl/pinconf-generic.c
> >> +++ b/drivers/pinctrl/pinconf-generic.c
> >> @@ -286,6 +286,7 @@ int pinconf_generic_parse_dt_config(struct device_node *np,
> >> kfree(cfg);
> >> return ret;
> >> }
> >> +EXPORT_SYMBOL_GPL(pinconf_generic_parse_dt_config);
> >>
> >> int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev,
> >> struct device_node *np, struct pinctrl_map **map,
> >
> > _______________________________________________
> > Linux-mediatek mailing list
> > [email protected]
> > http://lists.infradead.org/mailman/listinfo/linux-mediatek
> >
On 14/02/2020 12:02, Light Hsieh wrote:
> On Fri, 2020-02-14 at 11:37 +0100, Matthias Brugger wrote:
>>
>> On 13/02/2020 07:17, Light Hsieh wrote:
>>> Dear Reviewers:
>>>
>>> Google plan to make platform driver as kernel module in future Android
>>> kernel.
>>> This patch series prepare to make platforms that use MediaTek pinctrl
>>> paris driver (pinctrl-paris.c, pinctrl-mtk-common-v2.c, and mtk-eint.c)
>>> compatible for building either kernel module or built-in.
>>>
>>> Please give your comments.
>>>
>>
>> I think I didn't explain myself good enough.
>> These should be three patches:
>>
>> 1. change mtk-eint driver + Kconfig to be loadable as a module
>> 2. change pinctrl-paris + Kconfig to be loadable as a module
>> 3. change mt6765.
>>
>> Please make sure that every patch compiles and does not break the system. This
>> will later help to use git-bisect to hunt down bugs in the kernel.
>>
>> Regards,
>> Matthias
>>
>
> Actually, I don't understand the necessity of splitting into 2 or 3
> patches.
>
Basically because smaller logical changes per patch makes it easier to review
and understand what is done and why.
> 1. mtk-eint cannot be built as loadable module when pinctrl-paris and
> pinctrl-mtk-common-v2 is not built as loadable module.
>
> 2. pinctrl-paris and pinctrl-mtk-common-v2 cannot be built as loadable
> module when pinctrl-mtk6765 is not built as loadable module
>
Correct, but think about it that you want to backport these patches and add
support for a new SoC, in this case you don't need to add mt6765 support to your
downstream kernel.
Same if you want to be able to built moore as a module in the future. You will
only need to rely on patch 1.
But I won't argue with you, patch 1+2 can be put together if you insist. :)
But I think patch 3 should be independent for sure.
Regards,
Matthias
> 3. besides, if pinctrl-mtk675 and any other MediaTek platform pinctrl
> driver that use mtk-eint, pinctrl-paris, and pinctrl-mtk-common-v2 are
> built-in, mtk-eint, pinctrl-paris, and pinctrl-mtk-common-v2 cannot be
> built as loadable module.
>
> The rationale can be learned from the description of change made to
> Kconfig and Makefile.
>
> So, just applying patch 1 and patch 2 of your proposal does not make
> sense.
>
> BR.
>
> Light
>
>
>
>>> Light
>>>
>>> On Thu, 2020-02-13 at 14:08 +0800, [email protected] wrote:
>>>> From: Light Hsieh <[email protected]>
>>>>
>>>> Google plan to make platform driver as kernel module for future
>>>> Andriod kernel. This patch make platforms that use pinctrl-paris.c
>>>> of MediaTek pinctrl v2 ready for building kernel module.
>>>>
>>>> Signed-off-by: Light Hsieh <[email protected]>
>>>> ---
>>>> 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 | 5 +++++
>>>> drivers/pinctrl/pinconf-generic.c | 1 +
>>>> 5 files changed, 43 insertions(+)
>>>>
>>>> diff --git a/drivers/pinctrl/mediatek/mtk-eint.c b/drivers/pinctrl/mediatek/mtk-eint.c
>>>> index 7e526bcf..99703a8 100644
>>>> --- a/drivers/pinctrl/mediatek/mtk-eint.c
>>>> +++ b/drivers/pinctrl/mediatek/mtk-eint.c
>>>> @@ -9,6 +9,7 @@
>>>> *
>>>> */
>>>>
>>>> +#include <linux/module.h>
>>>> #include <linux/delay.h>
>>>> #include <linux/err.h>
>>>> #include <linux/gpio/driver.h>
>>>> @@ -379,6 +380,7 @@ int mtk_eint_do_suspend(struct mtk_eint *eint)
>>>>
>>>> return 0;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_eint_do_suspend);
>>>>
>>>> int mtk_eint_do_resume(struct mtk_eint *eint)
>>>> {
>>>> @@ -386,6 +388,7 @@ int mtk_eint_do_resume(struct mtk_eint *eint)
>>>>
>>>> return 0;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_eint_do_resume);
>>>>
>>>> int mtk_eint_set_debounce(struct mtk_eint *eint, unsigned long eint_num,
>>>> unsigned int debounce)
>>>> @@ -440,6 +443,7 @@ int mtk_eint_set_debounce(struct mtk_eint *eint, unsigned long eint_num,
>>>>
>>>> return 0;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_eint_set_debounce);
>>>>
>>>> int mtk_eint_find_irq(struct mtk_eint *eint, unsigned long eint_n)
>>>> {
>>>> @@ -451,6 +455,7 @@ int mtk_eint_find_irq(struct mtk_eint *eint, unsigned long eint_n)
>>>>
>>>> return irq;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_eint_find_irq);
>>>>
>>>> int mtk_eint_do_init(struct mtk_eint *eint)
>>>> {
>>>> @@ -495,3 +500,7 @@ int mtk_eint_do_init(struct mtk_eint *eint)
>>>>
>>>> return 0;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_eint_do_init);
>>>> +
>>>> +MODULE_LICENSE("GPL v2");
>>>> +MODULE_DESCRIPTION("MediaTek EINT Driver");
>>>> diff --git a/drivers/pinctrl/mediatek/pinctrl-mt6765.c b/drivers/pinctrl/mediatek/pinctrl-mt6765.c
>>>> index 905dae8c..2c59d39 100644
>>>> --- a/drivers/pinctrl/mediatek/pinctrl-mt6765.c
>>>> +++ b/drivers/pinctrl/mediatek/pinctrl-mt6765.c
>>>> @@ -6,6 +6,7 @@
>>>> *
>>>> */
>>>>
>>>> +#include <linux/module.h>
>>>> #include "pinctrl-mtk-mt6765.h"
>>>> #include "pinctrl-paris.h"
>>>>
>>>> @@ -1103,3 +1104,6 @@ static int __init mt6765_pinctrl_init(void)
>>>> return platform_driver_register(&mt6765_pinctrl_driver);
>>>> }
>>>> arch_initcall(mt6765_pinctrl_init);
>>>> +
>>>> +MODULE_LICENSE("GPL v2");
>>>> +MODULE_DESCRIPTION("MediaTek MT6765 Pinctrl Driver");
>>>> diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
>>>> index 1da9425..cdf2d69 100644
>>>> --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
>>>> +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
>>>> @@ -6,6 +6,7 @@
>>>> *
>>>> */
>>>>
>>>> +#include <linux/module.h>
>>>> #include <dt-bindings/pinctrl/mt65xx.h>
>>>> #include <linux/device.h>
>>>> #include <linux/err.h>
>>>> @@ -206,6 +207,7 @@ int mtk_hw_set_value(struct mtk_pinctrl *hw, const struct mtk_pin_desc *desc,
>>>>
>>>> return 0;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_hw_set_value);
>>>>
>>>> int mtk_hw_get_value(struct mtk_pinctrl *hw, const struct mtk_pin_desc *desc,
>>>> int field, int *value)
>>>> @@ -225,6 +227,7 @@ int mtk_hw_get_value(struct mtk_pinctrl *hw, const struct mtk_pin_desc *desc,
>>>>
>>>> return 0;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_hw_get_value);
>>>>
>>>> static int mtk_xt_find_eint_num(struct mtk_pinctrl *hw, unsigned long eint_n)
>>>> {
>>>> @@ -363,6 +366,7 @@ int mtk_build_eint(struct mtk_pinctrl *hw, struct platform_device *pdev)
>>>>
>>>> return mtk_eint_do_init(hw->eint);
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_build_eint);
>>>>
>>>> /* Revision 0 */
>>>> int mtk_pinconf_bias_disable_set(struct mtk_pinctrl *hw,
>>>> @@ -382,6 +386,7 @@ int mtk_pinconf_bias_disable_set(struct mtk_pinctrl *hw,
>>>>
>>>> return 0;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_disable_set);
>>>>
>>>> int mtk_pinconf_bias_disable_get(struct mtk_pinctrl *hw,
>>>> const struct mtk_pin_desc *desc, int *res)
>>>> @@ -404,6 +409,7 @@ int mtk_pinconf_bias_disable_get(struct mtk_pinctrl *hw,
>>>>
>>>> return 0;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_disable_get);
>>>>
>>>> int mtk_pinconf_bias_set(struct mtk_pinctrl *hw,
>>>> const struct mtk_pin_desc *desc, bool pullup)
>>>> @@ -423,6 +429,7 @@ int mtk_pinconf_bias_set(struct mtk_pinctrl *hw,
>>>>
>>>> return 0;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_set);
>>>>
>>>> int mtk_pinconf_bias_get(struct mtk_pinctrl *hw,
>>>> const struct mtk_pin_desc *desc, bool pullup, int *res)
>>>> @@ -442,6 +449,7 @@ int mtk_pinconf_bias_get(struct mtk_pinctrl *hw,
>>>>
>>>> return 0;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_get);
>>>>
>>>> /* Revision 1 */
>>>> int mtk_pinconf_bias_disable_set_rev1(struct mtk_pinctrl *hw,
>>>> @@ -456,6 +464,7 @@ int mtk_pinconf_bias_disable_set_rev1(struct mtk_pinctrl *hw,
>>>>
>>>> return 0;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_disable_set_rev1);
>>>>
>>>> int mtk_pinconf_bias_disable_get_rev1(struct mtk_pinctrl *hw,
>>>> const struct mtk_pin_desc *desc, int *res)
>>>> @@ -473,6 +482,7 @@ int mtk_pinconf_bias_disable_get_rev1(struct mtk_pinctrl *hw,
>>>>
>>>> return 0;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_disable_get_rev1);
>>>>
>>>> int mtk_pinconf_bias_set_rev1(struct mtk_pinctrl *hw,
>>>> const struct mtk_pin_desc *desc, bool pullup)
>>>> @@ -492,6 +502,7 @@ int mtk_pinconf_bias_set_rev1(struct mtk_pinctrl *hw,
>>>>
>>>> return 0;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_set_rev1);
>>>>
>>>> int mtk_pinconf_bias_get_rev1(struct mtk_pinctrl *hw,
>>>> const struct mtk_pin_desc *desc, bool pullup,
>>>> @@ -517,6 +528,7 @@ int mtk_pinconf_bias_get_rev1(struct mtk_pinctrl *hw,
>>>>
>>>> return 0;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_set_gev1);
>>>>
>>>> /* Combo for the following pull register type:
>>>> * 1. PU + PD
>>>> @@ -717,6 +729,7 @@ int mtk_pinconf_bias_set_combo(struct mtk_pinctrl *hw,
>>>> out:
>>>> return err;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_set_combo);
>>>>
>>>> int mtk_pinconf_bias_get_combo(struct mtk_pinctrl *hw,
>>>> const struct mtk_pin_desc *desc,
>>>> @@ -737,6 +750,7 @@ int mtk_pinconf_bias_get_combo(struct mtk_pinctrl *hw,
>>>> out:
>>>> return err;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_get_combo);
>>>>
>>>> /* Revision 0 */
>>>> int mtk_pinconf_drive_set(struct mtk_pinctrl *hw,
>>>> @@ -766,6 +780,7 @@ int mtk_pinconf_drive_set(struct mtk_pinctrl *hw,
>>>>
>>>> return err;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_set);
>>>>
>>>> int mtk_pinconf_drive_get(struct mtk_pinctrl *hw,
>>>> const struct mtk_pin_desc *desc, int *val)
>>>> @@ -790,6 +805,7 @@ int mtk_pinconf_drive_get(struct mtk_pinctrl *hw,
>>>>
>>>> return 0;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_get);
>>>>
>>>> /* Revision 1 */
>>>> int mtk_pinconf_drive_set_rev1(struct mtk_pinctrl *hw,
>>>> @@ -811,6 +827,7 @@ int mtk_pinconf_drive_set_rev1(struct mtk_pinctrl *hw,
>>>>
>>>> return err;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_set_rev1);
>>>>
>>>> int mtk_pinconf_drive_get_rev1(struct mtk_pinctrl *hw,
>>>> const struct mtk_pin_desc *desc, int *val)
>>>> @@ -828,18 +845,21 @@ int mtk_pinconf_drive_get_rev1(struct mtk_pinctrl *hw,
>>>>
>>>> return 0;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_get_rev1);
>>>>
>>>> int mtk_pinconf_drive_set_raw(struct mtk_pinctrl *hw,
>>>> const struct mtk_pin_desc *desc, u32 arg)
>>>> {
>>>> return mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV, arg);
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_set_raw);
>>>>
>>>> int mtk_pinconf_drive_get_raw(struct mtk_pinctrl *hw,
>>>> const struct mtk_pin_desc *desc, int *val)
>>>> {
>>>> return mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DRV, val);
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_pinconf_drive_get_raw);
>>>>
>>>> int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw,
>>>> const struct mtk_pin_desc *desc, bool pullup,
>>>> @@ -880,6 +900,7 @@ int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw,
>>>>
>>>> return err;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_pinconf_adv_pull_set);
>>>>
>>>> int mtk_pinconf_adv_pull_get(struct mtk_pinctrl *hw,
>>>> const struct mtk_pin_desc *desc, bool pullup,
>>>> @@ -922,6 +943,7 @@ int mtk_pinconf_adv_pull_get(struct mtk_pinctrl *hw,
>>>>
>>>> return 0;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_pinconf_adv_pull_get);
>>>>
>>>> int mtk_pinconf_adv_drive_set(struct mtk_pinctrl *hw,
>>>> const struct mtk_pin_desc *desc, u32 arg)
>>>> @@ -948,6 +970,7 @@ int mtk_pinconf_adv_drive_set(struct mtk_pinctrl *hw,
>>>>
>>>> return err;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_pinconf_adv_drive_set);
>>>>
>>>> int mtk_pinconf_adv_drive_get(struct mtk_pinctrl *hw,
>>>> const struct mtk_pin_desc *desc, u32 *val)
>>>> @@ -971,3 +994,4 @@ int mtk_pinconf_adv_drive_get(struct mtk_pinctrl *hw,
>>>>
>>>> return 0;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(mtk_pinconf_adv_drive_get);
>>>> diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c
>>>> index 83bf29c..af97794 100644
>>>> --- a/drivers/pinctrl/mediatek/pinctrl-paris.c
>>>> +++ b/drivers/pinctrl/mediatek/pinctrl-paris.c
>>>> @@ -9,6 +9,7 @@
>>>> * Hongzhou.Yang <[email protected]>
>>>> */
>>>>
>>>> +#include <linux/module.h>
>>>> #include <linux/gpio/driver.h>
>>>> #include <dt-bindings/pinctrl/mt65xx.h>
>>>> #include "pinctrl-paris.h"
>>>> @@ -1037,3 +1038,7 @@ static int mtk_paris_pinctrl_resume(struct device *device)
>>>> .suspend_noirq = mtk_paris_pinctrl_suspend,
>>>> .resume_noirq = mtk_paris_pinctrl_resume,
>>>> };
>>>> +EXPORT_SYMBOL_GPL(mtk_paris_pinctrl_probe);
>>>> +
>>>> +MODULE_LICENSE("GPL v2");
>>>> +MODULE_DESCRIPTION("MediaTek Pinctrl Common Driver V2 Paris");
>>>> diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c
>>>> index 9eb8630..dfef471 100644
>>>> --- a/drivers/pinctrl/pinconf-generic.c
>>>> +++ b/drivers/pinctrl/pinconf-generic.c
>>>> @@ -286,6 +286,7 @@ int pinconf_generic_parse_dt_config(struct device_node *np,
>>>> kfree(cfg);
>>>> return ret;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(pinconf_generic_parse_dt_config);
>>>>
>>>> int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev,
>>>> struct device_node *np, struct pinctrl_map **map,
>>>
>>> _______________________________________________
>>> Linux-mediatek mailing list
>>> [email protected]
>>> http://lists.infradead.org/mailman/listinfo/linux-mediatek
>>>
>