mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 07:03:03 +02:00
Renesas driver updates for v6.18
- Add syscon/regmap support to the RZ System Controller driver. -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCaLGQ/AAKCRCKwlD9ZEnx cCEfAP0cCBtmmxyYxpYqulgek1YG3qVwlxQEvPh6bN88oxY9AAEAp5hEU/gZH5eR YX7F1+ZRA67VOZkth8GsKntf89H11gc= =Tj4E -----END PGP SIGNATURE----- gpgsig -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmi1cPEACgkQmmx57+YA GNlKUg/9GBpVQ4IRk3DwKOe14dnkj8lp1aOh6iVKONqV4wEYBXSCcmJoHLxuNRdJ iXWlxzzFtz53cguuyKDgaNoosnosqv2ZVqEpEIXxq5XqoDwQ9b6F5HgXk9OypLiT yiiniVH9ylE9RJ0MBolmk4aG8HnbL3fIaBwLCd7+6yui+WauQPdT2/+s0Ns63hA3 tS8xt3GCr2h0oydv9KztUPdekQGWtxP/5MYq1jhICZfdGJ5pUk2P0TWBoFnZZGsG f8Ed4lOt3HDyAku1otvS0yhjBrVguSGdXnFJcEgc3kfqLn/aq3ZqtXzUh+eTbTD2 UCoaY1CdEAvkVR1aRn4yfZSMZBnUKzP8H7H3lULQTrfGxgk/8DcR9tS/+hWZPiU1 EMt5cfGl8g+PLObZVaHIJXiFkCqMzHH1D8qh9FPPCwUTZc89P9aM7yA7NoIcrxLG Ua7yjIZzrWyw0YofvfAZ4TdrgEue9TRbrm27RSh/QoIJDrBxz71dJr2gHbBNkKL6 JfeVafeaayBJtr5IDSKv9P0xEr77EdUHwqvh2o50OTo5Ogzp5zYw9iWf1DquII/q z8jRlTgORf4sYI5KPK5khns7LQWmeYeMrb94dbbgmlp426XUcOKnZ0umpneWw4DT Hr7n62kyD6YQ95NpCK36oLtvZ1nWaITGEY7c9PEU1irW9P8OpGQ= =UhA2 -----END PGP SIGNATURE----- Merge tag 'renesas-drivers-for-v6.18-tag1' of https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into soc/drivers Renesas driver updates for v6.18 - Add syscon/regmap support to the RZ System Controller driver. * tag 'renesas-drivers-for-v6.18-tag1' of https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: soc: renesas: rz-sysc: Add syscon/regmap support Link: https://lore.kernel.org/r/cover.1756468046.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
commit
cc309f9793
|
|
@ -449,6 +449,7 @@ config RST_RCAR
|
|||
|
||||
config SYSC_RZ
|
||||
bool "System controller for RZ SoCs" if COMPILE_TEST
|
||||
select MFD_SYSCON
|
||||
|
||||
config SYSC_R9A08G045
|
||||
bool "Renesas System controller support for R9A08G045 (RZ/G3S)" if COMPILE_TEST
|
||||
|
|
|
|||
|
|
@ -20,4 +20,5 @@ static const struct rz_sysc_soc_id_init_data rzg3s_sysc_soc_id_init_data __initc
|
|||
|
||||
const struct rz_sysc_init_data rzg3s_sysc_init_data __initconst = {
|
||||
.soc_id_init_data = &rzg3s_sysc_soc_id_init_data,
|
||||
.max_register = 0xe20,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -64,4 +64,5 @@ static const struct rz_sysc_soc_id_init_data rzg3e_sys_soc_id_init_data __initco
|
|||
|
||||
const struct rz_sysc_init_data rzg3e_sys_init_data = {
|
||||
.soc_id_init_data = &rzg3e_sys_soc_id_init_data,
|
||||
.max_register = 0x170c,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -64,4 +64,5 @@ static const struct rz_sysc_soc_id_init_data rzv2h_sys_soc_id_init_data __initco
|
|||
|
||||
const struct rz_sysc_init_data rzv2h_sys_init_data = {
|
||||
.soc_id_init_data = &rzv2h_sys_soc_id_init_data,
|
||||
.max_register = 0x170c,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,9 +5,13 @@
|
|||
* Copyright (C) 2024 Renesas Electronics Corp.
|
||||
*/
|
||||
|
||||
#include <linux/cleanup.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/mfd/syscon.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/sys_soc.h>
|
||||
|
||||
#include "rz-sysc.h"
|
||||
|
|
@ -100,14 +104,23 @@ MODULE_DEVICE_TABLE(of, rz_sysc_match);
|
|||
|
||||
static int rz_sysc_probe(struct platform_device *pdev)
|
||||
{
|
||||
const struct rz_sysc_init_data *data;
|
||||
const struct of_device_id *match;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct regmap *regmap;
|
||||
struct rz_sysc *sysc;
|
||||
int ret;
|
||||
|
||||
struct regmap_config *regmap_cfg __free(kfree) = kzalloc(sizeof(*regmap_cfg), GFP_KERNEL);
|
||||
if (!regmap_cfg)
|
||||
return -ENOMEM;
|
||||
|
||||
match = of_match_node(rz_sysc_match, dev->of_node);
|
||||
if (!match)
|
||||
return -ENODEV;
|
||||
|
||||
data = match->data;
|
||||
|
||||
sysc = devm_kzalloc(dev, sizeof(*sysc), GFP_KERNEL);
|
||||
if (!sysc)
|
||||
return -ENOMEM;
|
||||
|
|
@ -117,7 +130,22 @@ static int rz_sysc_probe(struct platform_device *pdev)
|
|||
return PTR_ERR(sysc->base);
|
||||
|
||||
sysc->dev = dev;
|
||||
return rz_sysc_soc_init(sysc, match);
|
||||
ret = rz_sysc_soc_init(sysc, match);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
regmap_cfg->name = "rz_sysc_regs";
|
||||
regmap_cfg->reg_bits = 32;
|
||||
regmap_cfg->reg_stride = 4;
|
||||
regmap_cfg->val_bits = 32;
|
||||
regmap_cfg->fast_io = true;
|
||||
regmap_cfg->max_register = data->max_register;
|
||||
|
||||
regmap = devm_regmap_init_mmio(dev, sysc->base, regmap_cfg);
|
||||
if (IS_ERR(regmap))
|
||||
return PTR_ERR(regmap);
|
||||
|
||||
return of_syscon_register_regmap(dev->of_node, regmap);
|
||||
}
|
||||
|
||||
static struct platform_driver rz_sysc_driver = {
|
||||
|
|
|
|||
|
|
@ -34,9 +34,11 @@ struct rz_sysc_soc_id_init_data {
|
|||
/**
|
||||
* struct rz_sysc_init_data - RZ SYSC initialization data
|
||||
* @soc_id_init_data: RZ SYSC SoC ID initialization data
|
||||
* @max_register: Maximum SYSC register offset to be used by the regmap config
|
||||
*/
|
||||
struct rz_sysc_init_data {
|
||||
const struct rz_sysc_soc_id_init_data *soc_id_init_data;
|
||||
u32 max_register;
|
||||
};
|
||||
|
||||
extern const struct rz_sysc_init_data rzg3e_sys_init_data;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user