diff mbox series

[v2,RESEND] Input: mtk-pmic-keys - Add support for MT6331 PMIC keys

Message ID 20220706101122.201007-1-angelogioacchino.delregno@collabora.com (mailing list archive)
State Superseded
Headers show
Series [v2,RESEND] Input: mtk-pmic-keys - Add support for MT6331 PMIC keys | expand

Commit Message

AngeloGioacchino Del Regno July 6, 2022, 10:11 a.m. UTC
Add support for PMIC Keys of the MT6331 PMIC.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
---
 drivers/input/keyboard/mtk-pmic-keys.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

Comments

kernel test robot July 6, 2022, 11:44 a.m. UTC | #1
Hi AngeloGioacchino,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on dtor-input/next]
[also build test ERROR on linus/master v5.19-rc5 next-20220705]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/intel-lab-lkp/linux/commits/AngeloGioacchino-Del-Regno/Input-mtk-pmic-keys-Add-support-for-MT6331-PMIC-keys/20220706-181323
base:   https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
config: arc-randconfig-r043-20220703 (https://download.01.org/0day-ci/archive/20220706/202207061915.tYTQKEhu-lkp@intel.com/config)
compiler: arceb-elf-gcc (GCC) 11.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/5e286347fa7c13c4674f97ed475e4f42a49ce5b4
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review AngeloGioacchino-Del-Regno/Input-mtk-pmic-keys-Add-support-for-MT6331-PMIC-keys/20220706-181323
        git checkout 5e286347fa7c13c4674f97ed475e4f42a49ce5b4
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=arc SHELL=/bin/bash drivers/input/keyboard/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/input/keyboard/mtk-pmic-keys.c:12:10: fatal error: linux/mfd/mt6331/registers.h: No such file or directory
      12 | #include <linux/mfd/mt6331/registers.h>
         |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   compilation terminated.


vim +12 drivers/input/keyboard/mtk-pmic-keys.c

  > 12	#include <linux/mfd/mt6331/registers.h>
    13	#include <linux/mfd/mt6358/registers.h>
    14	#include <linux/mfd/mt6397/core.h>
    15	#include <linux/mfd/mt6397/registers.h>
    16	#include <linux/module.h>
    17	#include <linux/of_device.h>
    18	#include <linux/of.h>
    19	#include <linux/platform_device.h>
    20	#include <linux/regmap.h>
    21
AngeloGioacchino Del Regno July 6, 2022, 12:13 p.m. UTC | #2
Il 06/07/22 13:44, kernel test robot ha scritto:
> Hi AngeloGioacchino,
> 
> Thank you for the patch! Yet something to improve:
> 
> [auto build test ERROR on dtor-input/next]
> [also build test ERROR on linus/master v5.19-rc5 next-20220705]


This patch compiles fine on next-20220706.


> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/AngeloGioacchino-Del-Regno/Input-mtk-pmic-keys-Add-support-for-MT6331-PMIC-keys/20220706-181323
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
> config: arc-randconfig-r043-20220703 (https://download.01.org/0day-ci/archive/20220706/202207061915.tYTQKEhu-lkp@intel.com/config)
> compiler: arceb-elf-gcc (GCC) 11.3.0
> reproduce (this is a W=1 build):
>          wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>          chmod +x ~/bin/make.cross
>          # https://github.com/intel-lab-lkp/linux/commit/5e286347fa7c13c4674f97ed475e4f42a49ce5b4
>          git remote add linux-review https://github.com/intel-lab-lkp/linux
>          git fetch --no-tags linux-review AngeloGioacchino-Del-Regno/Input-mtk-pmic-keys-Add-support-for-MT6331-PMIC-keys/20220706-181323
>          git checkout 5e286347fa7c13c4674f97ed475e4f42a49ce5b4
>          # save the config file
>          mkdir build_dir && cp config build_dir/.config
>          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=arc SHELL=/bin/bash drivers/input/keyboard/
> 
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>>> drivers/input/keyboard/mtk-pmic-keys.c:12:10: fatal error: linux/mfd/mt6331/registers.h: No such file or directory
>        12 | #include <linux/mfd/mt6331/registers.h>
>           |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     compilation terminated.
> 
> 
> vim +12 drivers/input/keyboard/mtk-pmic-keys.c
> 
>    > 12	#include <linux/mfd/mt6331/registers.h>
>      13	#include <linux/mfd/mt6358/registers.h>
>      14	#include <linux/mfd/mt6397/core.h>
>      15	#include <linux/mfd/mt6397/registers.h>
>      16	#include <linux/module.h>
>      17	#include <linux/of_device.h>
>      18	#include <linux/of.h>
>      19	#include <linux/platform_device.h>
>      20	#include <linux/regmap.h>
>      21	
>
Matthias Brugger July 6, 2022, 1:32 p.m. UTC | #3
On 06/07/2022 12:11, AngeloGioacchino Del Regno wrote:
> Add support for PMIC Keys of the MT6331 PMIC.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>

> ---
>   drivers/input/keyboard/mtk-pmic-keys.c | 21 +++++++++++++++++++++
>   1 file changed, 21 insertions(+)
> 
> diff --git a/drivers/input/keyboard/mtk-pmic-keys.c b/drivers/input/keyboard/mtk-pmic-keys.c
> index 6404081253ea..9b34da0ec260 100644
> --- a/drivers/input/keyboard/mtk-pmic-keys.c
> +++ b/drivers/input/keyboard/mtk-pmic-keys.c
> @@ -9,6 +9,7 @@
>   #include <linux/interrupt.h>
>   #include <linux/kernel.h>
>   #include <linux/mfd/mt6323/registers.h>
> +#include <linux/mfd/mt6331/registers.h>
>   #include <linux/mfd/mt6358/registers.h>
>   #include <linux/mfd/mt6397/core.h>
>   #include <linux/mfd/mt6397/registers.h>
> @@ -22,6 +23,10 @@
>   #define MTK_PMIC_PWRKEY_RST	BIT(6)
>   #define MTK_PMIC_HOMEKEY_RST	BIT(5)
>   
> +#define MTK_PMIC_MT6331_RST_DU_MASK	GENMASK(13, 12)
> +#define MTK_PMIC_MT6331_PWRKEY_RST	BIT(9)
> +#define MTK_PMIC_MT6331_HOMEKEY_RST	BIT(8)
> +
>   #define MTK_PMIC_PWRKEY_INDEX	0
>   #define MTK_PMIC_HOMEKEY_INDEX	1
>   #define MTK_PMIC_MAX_KEY_COUNT	2
> @@ -72,6 +77,19 @@ static const struct mtk_pmic_regs mt6323_regs = {
>   	.rst_lprst_mask = MTK_PMIC_RST_DU_MASK,
>   };
>   
> +static const struct mtk_pmic_regs mt6331_regs = {
> +	.keys_regs[MTK_PMIC_PWRKEY_INDEX] =
> +		MTK_PMIC_KEYS_REGS(MT6331_TOPSTATUS, 0x2,
> +				   MT6331_INT_MISC_CON, 0x4,
> +				   MTK_PMIC_MT6331_PWRKEY_RST),
> +	.keys_regs[MTK_PMIC_HOMEKEY_INDEX] =
> +		MTK_PMIC_KEYS_REGS(MT6331_TOPSTATUS, 0x4,
> +				   MT6331_INT_MISC_CON, 0x2,
> +				   MTK_PMIC_MT6331_HOMEKEY_RST),
> +	.pmic_rst_reg = MT6331_TOP_RST_MISC,
> +	.rst_lprst_mask = MTK_PMIC_MT6331_RST_DU_MASK,
> +};
> +
>   static const struct mtk_pmic_regs mt6358_regs = {
>   	.keys_regs[MTK_PMIC_PWRKEY_INDEX] =
>   		MTK_PMIC_KEYS_REGS(MT6358_TOPSTATUS,
> @@ -255,6 +273,9 @@ static const struct of_device_id of_mtk_pmic_keys_match_tbl[] = {
>   	}, {
>   		.compatible = "mediatek,mt6323-keys",
>   		.data = &mt6323_regs,
> +	}, {
> +		.compatible = "mediatek,mt6331-keys",
> +		.data = &mt6331_regs,
>   	}, {
>   		.compatible = "mediatek,mt6358-keys",
>   		.data = &mt6358_regs,
Dmitry Torokhov July 8, 2022, 9:51 p.m. UTC | #4
On Wed, Jul 06, 2022 at 02:13:45PM +0200, AngeloGioacchino Del Regno wrote:
> Il 06/07/22 13:44, kernel test robot ha scritto:
> > Hi AngeloGioacchino,
> > 
> > Thank you for the patch! Yet something to improve:
> > 
> > [auto build test ERROR on dtor-input/next]
> > [also build test ERROR on linus/master v5.19-rc5 next-20220705]
> 
> 
> This patch compiles fine on next-20220706.

Unfortunately linux/mfd/mt6331/registers.h is still not in mainline. We
either need to wait when it gets there or ask Lee for an immutable
branch that would contain shared definitions that I cam pull from.

Thanks.
diff mbox series

Patch

diff --git a/drivers/input/keyboard/mtk-pmic-keys.c b/drivers/input/keyboard/mtk-pmic-keys.c
index 6404081253ea..9b34da0ec260 100644
--- a/drivers/input/keyboard/mtk-pmic-keys.c
+++ b/drivers/input/keyboard/mtk-pmic-keys.c
@@ -9,6 +9,7 @@ 
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
 #include <linux/mfd/mt6323/registers.h>
+#include <linux/mfd/mt6331/registers.h>
 #include <linux/mfd/mt6358/registers.h>
 #include <linux/mfd/mt6397/core.h>
 #include <linux/mfd/mt6397/registers.h>
@@ -22,6 +23,10 @@ 
 #define MTK_PMIC_PWRKEY_RST	BIT(6)
 #define MTK_PMIC_HOMEKEY_RST	BIT(5)
 
+#define MTK_PMIC_MT6331_RST_DU_MASK	GENMASK(13, 12)
+#define MTK_PMIC_MT6331_PWRKEY_RST	BIT(9)
+#define MTK_PMIC_MT6331_HOMEKEY_RST	BIT(8)
+
 #define MTK_PMIC_PWRKEY_INDEX	0
 #define MTK_PMIC_HOMEKEY_INDEX	1
 #define MTK_PMIC_MAX_KEY_COUNT	2
@@ -72,6 +77,19 @@  static const struct mtk_pmic_regs mt6323_regs = {
 	.rst_lprst_mask = MTK_PMIC_RST_DU_MASK,
 };
 
+static const struct mtk_pmic_regs mt6331_regs = {
+	.keys_regs[MTK_PMIC_PWRKEY_INDEX] =
+		MTK_PMIC_KEYS_REGS(MT6331_TOPSTATUS, 0x2,
+				   MT6331_INT_MISC_CON, 0x4,
+				   MTK_PMIC_MT6331_PWRKEY_RST),
+	.keys_regs[MTK_PMIC_HOMEKEY_INDEX] =
+		MTK_PMIC_KEYS_REGS(MT6331_TOPSTATUS, 0x4,
+				   MT6331_INT_MISC_CON, 0x2,
+				   MTK_PMIC_MT6331_HOMEKEY_RST),
+	.pmic_rst_reg = MT6331_TOP_RST_MISC,
+	.rst_lprst_mask = MTK_PMIC_MT6331_RST_DU_MASK,
+};
+
 static const struct mtk_pmic_regs mt6358_regs = {
 	.keys_regs[MTK_PMIC_PWRKEY_INDEX] =
 		MTK_PMIC_KEYS_REGS(MT6358_TOPSTATUS,
@@ -255,6 +273,9 @@  static const struct of_device_id of_mtk_pmic_keys_match_tbl[] = {
 	}, {
 		.compatible = "mediatek,mt6323-keys",
 		.data = &mt6323_regs,
+	}, {
+		.compatible = "mediatek,mt6331-keys",
+		.data = &mt6331_regs,
 	}, {
 		.compatible = "mediatek,mt6358-keys",
 		.data = &mt6358_regs,