2021-07-02 12:26:01

by Matthias Schiffer

[permalink] [raw]
Subject: [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support

Updated patch series:

- A number of new patches (more hardware support and a few fixes)
- Patches 1-3 have gained Fixes tags
- Patch 2 depends on 1, so maybe we can push the GPIO patch through the
MFD tree to keep them together?
- The change in patch 7 was somewhat controversial. I've added a
warning, but it is the last patch of the series, so it doesn't affect
the rest of the series if it is rejected.


Matthias Schiffer (7):
gpio: tqmx86: really make IRQ optional
mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set
mfd: tqmx86: remove incorrect TQMx90UC board ID
mfd: tqmx86: fix typo in "platform"
mfd: tqmx86: add support for TQMx110EB and TQMxE40x
mfd: tqmx86: add support for TQ-Systems DMI IDs
mfd: tqmx86: assume 24MHz LPC clock for unknown boards

drivers/gpio/gpio-tqmx86.c | 6 ++---
drivers/mfd/tqmx86.c | 48 ++++++++++++++++++++++++++++++--------
2 files changed, 41 insertions(+), 13 deletions(-)

--
2.17.1


2021-07-02 12:26:01

by Matthias Schiffer

[permalink] [raw]
Subject: [PATCH v2 3/7] mfd: tqmx86: remove incorrect TQMx90UC board ID

No TQMx90UC exists at the moment, and it is undecided whether ID 10 will
be used eventually (and if it is, how that SoM will be named).

Fixes: 2f17dd34ffed ("mfd: tqmx86: IO controller with I2C, Wachdog and GPIO")
Signed-off-by: Matthias Schiffer <[email protected]>
---

v2: new patch

drivers/mfd/tqmx86.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c
index 732013f40e4e..9b65dbedc1bb 100644
--- a/drivers/mfd/tqmx86.c
+++ b/drivers/mfd/tqmx86.c
@@ -35,7 +35,6 @@
#define TQMX86_REG_BOARD_ID_E39x 7
#define TQMX86_REG_BOARD_ID_70EB 8
#define TQMX86_REG_BOARD_ID_80UC 9
-#define TQMX86_REG_BOARD_ID_90UC 10
#define TQMX86_REG_BOARD_REV 0x21
#define TQMX86_REG_IO_EXT_INT 0x26
#define TQMX86_REG_IO_EXT_INT_NONE 0
@@ -128,8 +127,6 @@ static const char *tqmx86_board_id_to_name(u8 board_id)
return "TQMx70EB";
case TQMX86_REG_BOARD_ID_80UC:
return "TQMx80UC";
- case TQMX86_REG_BOARD_ID_90UC:
- return "TQMx90UC";
default:
return "Unknown";
}
@@ -142,7 +139,6 @@ static int tqmx86_board_id_to_clk_rate(u8 board_id)
case TQMX86_REG_BOARD_ID_60EB:
case TQMX86_REG_BOARD_ID_70EB:
case TQMX86_REG_BOARD_ID_80UC:
- case TQMX86_REG_BOARD_ID_90UC:
return 24000;
case TQMX86_REG_BOARD_ID_E39M:
case TQMX86_REG_BOARD_ID_E39C:
--
2.17.1

2021-07-02 12:26:12

by Matthias Schiffer

[permalink] [raw]
Subject: [PATCH v2 6/7] mfd: tqmx86: add support for TQ-Systems DMI IDs

Newer TQMx86 modules use TQ-Systems instead of TQ-Group as their vendor
ID.

Signed-off-by: Matthias Schiffer <[email protected]>
---

v2: new patch

drivers/mfd/tqmx86.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c
index 9eb05b3ef573..58f35c8b5a45 100644
--- a/drivers/mfd/tqmx86.c
+++ b/drivers/mfd/tqmx86.c
@@ -271,6 +271,14 @@ static const struct dmi_system_id tqmx86_dmi_table[] __initconst = {
},
.callback = tqmx86_create_platform_device,
},
+ {
+ .ident = "TQMX86",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "TQ-Systems"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "TQMx"),
+ },
+ .callback = tqmx86_create_platform_device,
+ },
{}
};
MODULE_DEVICE_TABLE(dmi, tqmx86_dmi_table);
--
2.17.1

2021-07-02 12:26:37

by Matthias Schiffer

[permalink] [raw]
Subject: [PATCH v2 4/7] mfd: tqmx86: fix typo in "platform"

Rename variable from "ocores_platfom_data" to "ocores_platform_data".

Signed-off-by: Matthias Schiffer <[email protected]>
---

v2: new patch

drivers/mfd/tqmx86.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c
index 9b65dbedc1bb..ff1bdb742e3f 100644
--- a/drivers/mfd/tqmx86.c
+++ b/drivers/mfd/tqmx86.c
@@ -76,7 +76,7 @@ static struct i2c_board_info tqmx86_i2c_devices[] = {
},
};

-static struct ocores_i2c_platform_data ocores_platfom_data = {
+static struct ocores_i2c_platform_data ocores_platform_data = {
.num_devices = ARRAY_SIZE(tqmx86_i2c_devices),
.devices = tqmx86_i2c_devices,
};
@@ -84,8 +84,8 @@ static struct ocores_i2c_platform_data ocores_platfom_data = {
static const struct mfd_cell tqmx86_i2c_soft_dev[] = {
{
.name = "ocores-i2c",
- .platform_data = &ocores_platfom_data,
- .pdata_size = sizeof(ocores_platfom_data),
+ .platform_data = &ocores_platform_data,
+ .pdata_size = sizeof(ocores_platform_data),
.resources = tqmx_i2c_soft_resources,
.num_resources = ARRAY_SIZE(tqmx_i2c_soft_resources),
},
@@ -209,7 +209,7 @@ static int tqmx86_probe(struct platform_device *pdev)
tqmx_gpio_resources[0].flags = 0;
}

- ocores_platfom_data.clock_khz = tqmx86_board_id_to_clk_rate(board_id);
+ ocores_platform_data.clock_khz = tqmx86_board_id_to_clk_rate(board_id);

if (i2c_det == TQMX86_REG_I2C_DETECT_SOFT) {
err = devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE,
--
2.17.1

2021-07-02 12:26:54

by Matthias Schiffer

[permalink] [raw]
Subject: [PATCH v2 5/7] mfd: tqmx86: add support for TQMx110EB and TQMxE40x

Add the board IDs for the TQMx110EB and the TQMxE40x family. All use a
24MHz LPC clock.

Signed-off-by: Matthias Schiffer <[email protected]>
---

v2:
- add more new modules
- explicitly list each module for LPC clock

drivers/mfd/tqmx86.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c
index ff1bdb742e3f..9eb05b3ef573 100644
--- a/drivers/mfd/tqmx86.c
+++ b/drivers/mfd/tqmx86.c
@@ -35,6 +35,11 @@
#define TQMX86_REG_BOARD_ID_E39x 7
#define TQMX86_REG_BOARD_ID_70EB 8
#define TQMX86_REG_BOARD_ID_80UC 9
+#define TQMX86_REG_BOARD_ID_110EB 11
+#define TQMX86_REG_BOARD_ID_E40M 12
+#define TQMX86_REG_BOARD_ID_E40S 13
+#define TQMX86_REG_BOARD_ID_E40C1 14
+#define TQMX86_REG_BOARD_ID_E40C2 15
#define TQMX86_REG_BOARD_REV 0x21
#define TQMX86_REG_IO_EXT_INT 0x26
#define TQMX86_REG_IO_EXT_INT_NONE 0
@@ -127,6 +132,16 @@ static const char *tqmx86_board_id_to_name(u8 board_id)
return "TQMx70EB";
case TQMX86_REG_BOARD_ID_80UC:
return "TQMx80UC";
+ case TQMX86_REG_BOARD_ID_110EB:
+ return "TQMx110EB";
+ case TQMX86_REG_BOARD_ID_E40M:
+ return "TQMxE40M";
+ case TQMX86_REG_BOARD_ID_E40S:
+ return "TQMxE40S";
+ case TQMX86_REG_BOARD_ID_E40C1:
+ return "TQMxE40C1";
+ case TQMX86_REG_BOARD_ID_E40C2:
+ return "TQMxE40C2";
default:
return "Unknown";
}
@@ -139,6 +154,11 @@ static int tqmx86_board_id_to_clk_rate(u8 board_id)
case TQMX86_REG_BOARD_ID_60EB:
case TQMX86_REG_BOARD_ID_70EB:
case TQMX86_REG_BOARD_ID_80UC:
+ case TQMX86_REG_BOARD_ID_110EB:
+ case TQMX86_REG_BOARD_ID_E40M:
+ case TQMX86_REG_BOARD_ID_E40S:
+ case TQMX86_REG_BOARD_ID_E40C1:
+ case TQMX86_REG_BOARD_ID_E40C2:
return 24000;
case TQMX86_REG_BOARD_ID_E39M:
case TQMX86_REG_BOARD_ID_E39C:
--
2.17.1

2021-07-02 12:27:01

by Matthias Schiffer

[permalink] [raw]
Subject: [PATCH v2 7/7] mfd: tqmx86: assume 24MHz LPC clock for unknown boards

All future TQMx86 modules should use a 24MHz LPC clock. Warn about
unknown boards, but assume this is the case.

Signed-off-by: Matthias Schiffer <[email protected]>
---

v2:
- Separated from TQMxE40M support patch
- Add warning for unknown boards


drivers/mfd/tqmx86.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c
index 58f35c8b5a45..7ae906ff8e35 100644
--- a/drivers/mfd/tqmx86.c
+++ b/drivers/mfd/tqmx86.c
@@ -147,7 +147,7 @@ static const char *tqmx86_board_id_to_name(u8 board_id)
}
}

-static int tqmx86_board_id_to_clk_rate(u8 board_id)
+static int tqmx86_board_id_to_clk_rate(struct device *dev, u8 board_id)
{
switch (board_id) {
case TQMX86_REG_BOARD_ID_50UC:
@@ -168,7 +168,9 @@ static int tqmx86_board_id_to_clk_rate(u8 board_id)
case TQMX86_REG_BOARD_ID_E38C:
return 33000;
default:
- return 0;
+ dev_warn(dev, "unknown board %d, assuming 24MHz LPC clock\n",
+ board_id);
+ return 24000;
}
}

@@ -229,7 +231,7 @@ static int tqmx86_probe(struct platform_device *pdev)
tqmx_gpio_resources[0].flags = 0;
}

- ocores_platform_data.clock_khz = tqmx86_board_id_to_clk_rate(board_id);
+ ocores_platform_data.clock_khz = tqmx86_board_id_to_clk_rate(dev, board_id);

if (i2c_det == TQMX86_REG_I2C_DETECT_SOFT) {
err = devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE,
--
2.17.1

2021-07-02 13:43:28

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support

On Fri, Jul 02, 2021 at 02:23:46PM +0200, Matthias Schiffer wrote:
> Updated patch series:
>
> - A number of new patches (more hardware support and a few fixes)
> - Patches 1-3 have gained Fixes tags
> - Patch 2 depends on 1, so maybe we can push the GPIO patch through the
> MFD tree to keep them together?
> - The change in patch 7 was somewhat controversial. I've added a
> warning, but it is the last patch of the series, so it doesn't affect
> the rest of the series if it is rejected.

Hi Matthias

Nice to see the vendor involved. That does not happen enough.

Please split these into fixes and new features. They go into different
trees, so splitting them makes it easier for the maintainers.

I would also suggest splitting the patches per subsystem, and send
them to the specific subsystem maintainer. The exception would be when
there is cross subsystem dependencies.

Andrew

2021-07-02 13:57:55

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH v2 3/7] mfd: tqmx86: remove incorrect TQMx90UC board ID

On Fri, Jul 02, 2021 at 02:23:49PM +0200, Matthias Schiffer wrote:
> No TQMx90UC exists at the moment, and it is undecided whether ID 10 will
> be used eventually (and if it is, how that SoM will be named).

This was in the vendor code i was given. I just blindly kept it, since
i don't know anything except about the one system i had.

> Fixes: 2f17dd34ffed ("mfd: tqmx86: IO controller with I2C, Wachdog and GPIO")

I'm not sure this meets the stable requirements:

https://www.kernel.org/doc/html/v4.10/process/stable-kernel-rules.html

Reviewed-by: Andrew Lunn <[email protected]>

Andrew

2021-07-02 14:01:57

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH v2 4/7] mfd: tqmx86: fix typo in "platform"

On Fri, Jul 02, 2021 at 02:23:50PM +0200, Matthias Schiffer wrote:
> Rename variable from "ocores_platfom_data" to "ocores_platform_data".
>
> Signed-off-by: Matthias Schiffer <[email protected]>
> ---
>
> v2: new patch
>
> drivers/mfd/tqmx86.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c
> index 9b65dbedc1bb..ff1bdb742e3f 100644
> --- a/drivers/mfd/tqmx86.c
> +++ b/drivers/mfd/tqmx86.c
> @@ -76,7 +76,7 @@ static struct i2c_board_info tqmx86_i2c_devices[] = {
> },
> };
>
> -static struct ocores_i2c_platform_data ocores_platfom_data = {
> +static struct ocores_i2c_platform_data ocores_platform_data = {

Ah. Missed that in the vendor code :-(

FYI: I used tqmx86-drivers_1.3. If you have any fixes in later
versions, you might want to submit patches.

Reviewed-by: Andrew Lunn <[email protected]>

Andrew

2021-07-02 14:02:56

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH v2 5/7] mfd: tqmx86: add support for TQMx110EB and TQMxE40x

On Fri, Jul 02, 2021 at 02:23:51PM +0200, Matthias Schiffer wrote:
> Add the board IDs for the TQMx110EB and the TQMxE40x family. All use a
> 24MHz LPC clock.
>
> Signed-off-by: Matthias Schiffer <[email protected]>

Reviewed-by: Andrew Lunn <[email protected]>

Andrew

2021-07-02 14:04:39

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH v2 6/7] mfd: tqmx86: add support for TQ-Systems DMI IDs

On Fri, Jul 02, 2021 at 02:23:52PM +0200, Matthias Schiffer wrote:
> Newer TQMx86 modules use TQ-Systems instead of TQ-Group as their vendor
> ID.
>
> Signed-off-by: Matthias Schiffer <[email protected]>

Reviewed-by: Andrew Lunn <[email protected]>

Andrew

2021-07-02 14:08:16

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH v2 7/7] mfd: tqmx86: assume 24MHz LPC clock for unknown boards

On Fri, Jul 02, 2021 at 02:23:53PM +0200, Matthias Schiffer wrote:
> All future TQMx86 modules should use a 24MHz LPC clock. Warn about
> unknown boards, but assume this is the case.
>
> Signed-off-by: Matthias Schiffer <[email protected]>

Reviewed-by: Andrew Lunn <[email protected]>

Andrew

2021-07-05 07:14:11

by Matthias Schiffer

[permalink] [raw]
Subject: Re: [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support

On Fri, 2021-07-02 at 15:41 +0200, Andrew Lunn wrote:
> On Fri, Jul 02, 2021 at 02:23:46PM +0200, Matthias Schiffer wrote:
> > Updated patch series:
> >
> > - A number of new patches (more hardware support and a few fixes)
> > - Patches 1-3 have gained Fixes tags
> > - Patch 2 depends on 1, so maybe we can push the GPIO patch through the
> > MFD tree to keep them together?
> > - The change in patch 7 was somewhat controversial. I've added a
> > warning, but it is the last patch of the series, so it doesn't affect
> > the rest of the series if it is rejected.
>
> Hi Matthias
>
> Nice to see the vendor involved. That does not happen enough.
>
> Please split these into fixes and new features. They go into different
> trees, so splitting them makes it easier for the maintainers.
>
> I would also suggest splitting the patches per subsystem, and send
> them to the specific subsystem maintainer. The exception would be when
> there is cross subsystem dependencies.
>
> Andrew

Hi Andrew,

thanks for the quick review.

As mentioned in the cover letter, patch 2 depends on 1, so I think it
would make sense to push all through the MFD tree, including the GPIO
fix.

I guess patches 5 and 6 would be covered by the "new device IDs and
quirks" rule of the stable kernel rules. Does that mean they should
also go through the "fixes" rather than the "next" branch, making 4 and
7 the only ones for "next"?

Should I add "Cc: [email protected]" to all patches for the
"fixes" tree?

Kind regards,
Matthias

2021-07-16 09:22:19

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support

On Fri, 02 Jul 2021, Matthias Schiffer wrote:

> Updated patch series:
>
> - A number of new patches (more hardware support and a few fixes)
> - Patches 1-3 have gained Fixes tags
> - Patch 2 depends on 1, so maybe we can push the GPIO patch through the
> MFD tree to keep them together?
> - The change in patch 7 was somewhat controversial. I've added a
> warning, but it is the last patch of the series, so it doesn't affect
> the rest of the series if it is rejected.
>
>
> Matthias Schiffer (7):
> gpio: tqmx86: really make IRQ optional
> mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set
> mfd: tqmx86: remove incorrect TQMx90UC board ID
> mfd: tqmx86: fix typo in "platform"
> mfd: tqmx86: add support for TQMx110EB and TQMxE40x
> mfd: tqmx86: add support for TQ-Systems DMI IDs
> mfd: tqmx86: assume 24MHz LPC clock for unknown boards
>
> drivers/gpio/gpio-tqmx86.c | 6 ++---
> drivers/mfd/tqmx86.c | 48 ++++++++++++++++++++++++++++++--------
> 2 files changed, 41 insertions(+), 13 deletions(-)

Patches look good.

Could you please collect up Andrew's acks, remove the suggested Fixes:
lines and resubmit please?

I'll quickly apply them once resent (probably Monday - if you get them
out today).

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2021-07-16 09:26:13

by Matthias Schiffer

[permalink] [raw]
Subject: Re: [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support

On Fri, 2021-07-16 at 10:20 +0100, Lee Jones wrote:
> On Fri, 02 Jul 2021, Matthias Schiffer wrote:
>
> > Updated patch series:
> >
> > - A number of new patches (more hardware support and a few fixes)
> > - Patches 1-3 have gained Fixes tags
> > - Patch 2 depends on 1, so maybe we can push the GPIO patch through the
> > MFD tree to keep them together?
> > - The change in patch 7 was somewhat controversial. I've added a
> > warning, but it is the last patch of the series, so it doesn't affect
> > the rest of the series if it is rejected.
> >
> >
> > Matthias Schiffer (7):
> > gpio: tqmx86: really make IRQ optional
> > mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set
> > mfd: tqmx86: remove incorrect TQMx90UC board ID
> > mfd: tqmx86: fix typo in "platform"
> > mfd: tqmx86: add support for TQMx110EB and TQMxE40x
> > mfd: tqmx86: add support for TQ-Systems DMI IDs
> > mfd: tqmx86: assume 24MHz LPC clock for unknown boards
> >
> > drivers/gpio/gpio-tqmx86.c | 6 ++---
> > drivers/mfd/tqmx86.c | 48 ++++++++++++++++++++++++++++++--------
> > 2 files changed, 41 insertions(+), 13 deletions(-)
>
> Patches look good.
>
> Could you please collect up Andrew's acks, remove the suggested Fixes:
> lines and resubmit please?

Are you referring to the Fixes: line in "[PATCH v2 3/7] mfd: tqmx86:
remove incorrect TQMx90UC board ID"?

>
> I'll quickly apply them once resent (probably Monday - if you get them
> out today).
>

Thanks, I'll try to get it done today.

2021-07-16 09:46:37

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support

On Fri, 16 Jul 2021, Matthias Schiffer wrote:

> On Fri, 2021-07-16 at 10:20 +0100, Lee Jones wrote:
> > On Fri, 02 Jul 2021, Matthias Schiffer wrote:
> >
> > > Updated patch series:
> > >
> > > - A number of new patches (more hardware support and a few fixes)
> > > - Patches 1-3 have gained Fixes tags
> > > - Patch 2 depends on 1, so maybe we can push the GPIO patch through the
> > > MFD tree to keep them together?
> > > - The change in patch 7 was somewhat controversial. I've added a
> > > warning, but it is the last patch of the series, so it doesn't affect
> > > the rest of the series if it is rejected.
> > >
> > >
> > > Matthias Schiffer (7):
> > > gpio: tqmx86: really make IRQ optional
> > > mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set
> > > mfd: tqmx86: remove incorrect TQMx90UC board ID
> > > mfd: tqmx86: fix typo in "platform"
> > > mfd: tqmx86: add support for TQMx110EB and TQMxE40x
> > > mfd: tqmx86: add support for TQ-Systems DMI IDs
> > > mfd: tqmx86: assume 24MHz LPC clock for unknown boards
> > >
> > > drivers/gpio/gpio-tqmx86.c | 6 ++---
> > > drivers/mfd/tqmx86.c | 48 ++++++++++++++++++++++++++++++--------
> > > 2 files changed, 41 insertions(+), 13 deletions(-)
> >
> > Patches look good.
> >
> > Could you please collect up Andrew's acks, remove the suggested Fixes:
> > lines and resubmit please?
>
> Are you referring to the Fixes: line in "[PATCH v2 3/7] mfd: tqmx86:
> remove incorrect TQMx90UC board ID"?

I'm referring to the lines that Andrew said did not qualify.

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog