2020-11-22 22:57:47

by J. Neuschäfer

[permalink] [raw]
Subject: [PATCH v4 0/7] Netronix embedded controller driver for Kobo and Tolino ebook readers

This patchset adds basic support for the embedded controller found on
older ebook reader boards designed by/with the ODM Netronix Inc.[1] and
sold by Kobo or Tolino, for example the Kobo Aura and the Tolino Shine.
These drivers are based on information contained in the vendor kernel
sources, but in order to all information in a single place, I documented
the register interface of the EC on GitHub[2].

[1]: http://www.netronixinc.com/products.aspx?ID=1
[2]: https://github.com/neuschaefer/linux/wiki/Netronix-MSP430-embedded-controller

v4:
- Spell out ODM (original design manufacturer)
- Solve corner cases in the RTC driver
- Clean up use of log levels vs. error codes
- Add more comments explaining some peculiarities
- Add missing MODULE_ALIAS lines
- Various other cleanups


v3:
- https://lore.kernel.org/lkml/[email protected]/
- A few code cleanups
- A few devicetree related cleanups
- PWM and RTC functionality were moved from subnodes in the devicetree to
the main node. This also means that the subdrivers no longer need DT
compatible strings, but are instead loaded via the mfd_cell mechanism.
- The drivers are now published under GPLv2-or-later rather than GPLv2-only.


v2:
- https://lore.kernel.org/lkml/[email protected]/
- Moved txt DT bindings to patch descriptions and removed patch 1/10
"DT bindings in plain text format"
- New patch 7/10 "rtc: Introduce RTC_TIMESTAMP_END_2255"
- Rebased on 5.9-rc3
- Various other changes which are documented in each patch

v1:
- https://lore.kernel.org/lkml/[email protected]/

Jonathan Neuschäfer (7):
dt-bindings: Add vendor prefix for Netronix, Inc.
dt-bindings: mfd: Add binding for Netronix embedded controller
mfd: Add base driver for Netronix embedded controller
pwm: ntxec: Add driver for PWM function in Netronix EC
rtc: New driver for RTC in Netronix embedded controller
MAINTAINERS: Add entry for Netronix embedded controller
ARM: dts: imx50-kobo-aura: Add Netronix embedded controller

.../bindings/mfd/netronix,ntxec.yaml | 76 ++++++
.../devicetree/bindings/vendor-prefixes.yaml | 2 +
MAINTAINERS | 9 +
arch/arm/boot/dts/imx50-kobo-aura.dts | 16 +-
drivers/mfd/Kconfig | 11 +
drivers/mfd/Makefile | 1 +
drivers/mfd/ntxec.c | 216 ++++++++++++++++++
drivers/pwm/Kconfig | 8 +
drivers/pwm/Makefile | 1 +
drivers/pwm/pwm-ntxec.c | 166 ++++++++++++++
drivers/rtc/Kconfig | 8 +
drivers/rtc/Makefile | 1 +
drivers/rtc/rtc-ntxec.c | 158 +++++++++++++
include/linux/mfd/ntxec.h | 34 +++
14 files changed, 706 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml
create mode 100644 drivers/mfd/ntxec.c
create mode 100644 drivers/pwm/pwm-ntxec.c
create mode 100644 drivers/rtc/rtc-ntxec.c
create mode 100644 include/linux/mfd/ntxec.h

--
2.29.2


2020-11-22 23:56:00

by J. Neuschäfer

[permalink] [raw]
Subject: [PATCH v4 1/7] dt-bindings: Add vendor prefix for Netronix, Inc.

Netronix, Inc. (http://www.netronixinc.com/) makes ebook reader board
designs, which are for example used in Kobo and Tolino devices.

An alternative prefix for Netronix would be "ntx", which is already used
in code released by Netronix. It is shorter, but perhaps less clear.

Signed-off-by: Jonathan Neuschäfer <[email protected]>
Acked-by: Rob Herring <[email protected]>
---
v4:
- No changes

v3:
- https://lore.kernel.org/lkml/[email protected]/
- Add Acked-by tag

v2:
- No changes
---
Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 2735be1a84709..cbf28f992b71e 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -726,6 +726,8 @@ patternProperties:
description: Broadcom Corporation (formerly NetLogic Microsystems)
"^netron-dy,.*":
description: Netron DY
+ "^netronix,.*":
+ description: Netronix, Inc.
"^netxeon,.*":
description: Shenzhen Netxeon Technology CO., LTD
"^neweast,.*":
--
2.29.2

2020-11-23 00:35:04

by J. Neuschäfer

[permalink] [raw]
Subject: [PATCH v4 7/7] ARM: dts: imx50-kobo-aura: Add Netronix embedded controller

Enable the Netronix EC on the Kobo Aura ebook reader.

Several features are still missing:
- Frontlight/backlight. The vendor kernel drives the frontlight LED
using the PWM output of the EC and an additional boost pin that
increases the brightness.
- Battery monitoring
- Interrupts for RTC alarm and low-battery events

Signed-off-by: Jonathan Neuschäfer <[email protected]>
---
v4:
- Add 'grp' suffix to pinctrl node

v3:
- https://lore.kernel.org/lkml/[email protected]/
- Remove interrupt-controller property from embedded-controller node
- subnodes of embedded-controller node in to the main node

v2:
- https://lore.kernel.org/lkml/[email protected]/
- Fix pwm-cells property (should be 2, not 1)
---
arch/arm/boot/dts/imx50-kobo-aura.dts | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/imx50-kobo-aura.dts b/arch/arm/boot/dts/imx50-kobo-aura.dts
index 97cfd970fe742..82ce8c43be867 100644
--- a/arch/arm/boot/dts/imx50-kobo-aura.dts
+++ b/arch/arm/boot/dts/imx50-kobo-aura.dts
@@ -143,10 +143,24 @@ &i2c3 {
pinctrl-0 = <&pinctrl_i2c3>;
status = "okay";

- /* TODO: embedded controller at 0x43 */
+ embedded-controller@43 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_ec>;
+ compatible = "netronix,ntxec";
+ reg = <0x43>;
+ system-power-controller;
+ interrupts-extended = <&gpio4 11 IRQ_TYPE_EDGE_FALLING>;
+ #pwm-cells = <2>;
+ };
};

&iomuxc {
+ pinctrl_ec: ecgrp {
+ fsl,pins = <
+ MX50_PAD_CSPI_SS0__GPIO4_11 0x0 /* INT */
+ >;
+ };
+
pinctrl_gpiokeys: gpiokeysgrp {
fsl,pins = <
MX50_PAD_CSPI_MISO__GPIO4_10 0x0
--
2.29.2