Re: [PATCH v5 2/4] reset: toshiba: introduce a TC9564 reset driver
From: Alex Elder
Date: Fri Dec 04 2026 - 08:37:25 EST
On 12/4/26 3:42 AM, Lorenzo Bianconi wrote:
Define a new auxiliary device driver that manages resets implemented
by the Toshiba TC9564 SoC. The TC9564 clock driver will create the
reset device, which will bind to this driver.
The reset controller uses two registers to control a set of 13 resets
that can be asserted or deasserted. Only a subset of the resets can
currently be managed.
The MMIO region containing the two control registers is mapped by
the clock controller driver, and passed via the auxiliary device's
platform data.
Some common definitions are added to <linux/soc/qcom/tc9563.h> to
specify the interface between the clock and reset drivers.
Reviewed-by: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>
Reviewed-by: Lorenzo Bianconi <lorenzo.bianconi@xxxxxxxxxxxxxxxx>
Co-developed-by: Daniel Thompson <daniel@xxxxxxxxxxxx>
Signed-off-by: Daniel Thompson <daniel@xxxxxxxxxxxx>
Signed-off-by: Alex Elder <elder@xxxxxxxxxxxx>
---
v5: - Code related to the I2C and PCIE resets (including code that
warned if they were used) has been removed.
- The Kconfig now selects AUXILIARY_BUS
- Philipp's Reviewed-by tag has been added.
MAINTAINERS | 1 +
drivers/reset/Kconfig | 8 ++
drivers/reset/Makefile | 1 +
drivers/reset/reset-tc9564.c | 165 ++++++++++++++++++++++++++++++++
include/linux/soc/qcom/tc9563.h | 9 ++
5 files changed, 184 insertions(+)
create mode 100644 drivers/reset/reset-tc9564.c
. . .
diff --git a/include/linux/soc/qcom/tc9563.h b/include/linux/soc/qcom/tc9563.h
index 086f37a40d801..f778ce9ae2e7c 100644
--- a/include/linux/soc/qcom/tc9563.h
+++ b/include/linux/soc/qcom/tc9563.h
@@ -16,4 +16,13 @@
#define TC9563_GPIO_CONFIG TC9563_GPIO_EN0_OFFSET
#define TC9563_RESET_GPIO TC9563_GPIO_OUT0_OFFSET
+/* Name of the clock driver and the reset auxiliary device it creates */
+#define TC9564_CLK_MODNAME "clk_tc9564"
+#define TC9564_RESET_DEV_NAME "tc9564-reset"
+
+/* Platform data passed to the TC9564 reset auxiliary driver */
+struct tc9564_aux_data {
+ void __iomem *regs;
nit: I guess we do not really need it.
I'm not sure what you mean here. The mapped registers pointer
is required by the auxiliary reset driver, so we need to pass
it via platform data.
If what you're saying is that we could just pass the pointer
alone, rather than a structure that *contains* the pointer,
that is technically true. (And I think that's what you're
saying.)
The reason I did it this way is that assigning an __iomem
tagged pointer to a simple void pointer (like the platform
data) produces a "sparse" warning:
warning: incorrect type in assignment (different address spaces)
That happens in the clock driver (when setting the platform
data) and in the auxiliary reset driver (when getting it
from the platform data). I didn't like that, so I enclosed
it in a structure to avoid the problem.
I *would* prefer to just pass the mapped pointer. But even if
I try to cast away the warning with (void *) we get a different
warning from "sparse":
warning: cast removes address space '__iomem' of expression
I think the __iomem tag has value and putting it inside a
structure preserves it (and avoids these warnings). So
that's how I did it.
Unless there are other objections I'd like to keep it this way.
Thanks.
-Ales
Regards,
Lorenzo
+};
+
#endif /* __QCOM_TC9563_H */
--
2.53.0