Commit 5789837c authored by Biju Das's avatar Biju Das Committed by Alexandre Belloni

rtc: pcf85063: Drop enum pcf85063_type and split pcf85063_cfg[]

Drop enum pcf85063_type and split the array pcf85063_cfg[] as individual
variables, and make lines shorter by referring to e.g. &pcf85063_cfg
instead of &pcf85063_cfg[PCF85063].
Suggested-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarBiju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230717124059.196244-3-biju.das.jz@bp.renesas.comSigned-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 68c624f8
...@@ -514,46 +514,39 @@ static struct clk *pcf85063_clkout_register_clk(struct pcf85063 *pcf85063) ...@@ -514,46 +514,39 @@ static struct clk *pcf85063_clkout_register_clk(struct pcf85063 *pcf85063)
} }
#endif #endif
enum pcf85063_type { static const struct pcf85063_config config_pcf85063 = {
PCF85063, .regmap = {
PCF85063TP, .reg_bits = 8,
PCF85063A, .val_bits = 8,
RV8263, .max_register = 0x0a,
PCF85063_LAST_ID },
}; };
static struct pcf85063_config pcf85063_cfg[] = { static const struct pcf85063_config config_pcf85063tp = {
[PCF85063] = { .regmap = {
.regmap = { .reg_bits = 8,
.reg_bits = 8, .val_bits = 8,
.val_bits = 8, .max_register = 0x0a,
.max_register = 0x0a,
},
},
[PCF85063TP] = {
.regmap = {
.reg_bits = 8,
.val_bits = 8,
.max_register = 0x0a,
},
}, },
[PCF85063A] = { };
.regmap = {
.reg_bits = 8, static const struct pcf85063_config config_pcf85063a = {
.val_bits = 8, .regmap = {
.max_register = 0x11, .reg_bits = 8,
}, .val_bits = 8,
.has_alarms = 1, .max_register = 0x11,
}, },
[RV8263] = { .has_alarms = 1,
.regmap = { };
.reg_bits = 8,
.val_bits = 8, static const struct pcf85063_config config_rv8263 = {
.max_register = 0x11, .regmap = {
}, .reg_bits = 8,
.has_alarms = 1, .val_bits = 8,
.force_cap_7000 = 1, .max_register = 0x11,
}, },
.has_alarms = 1,
.force_cap_7000 = 1,
}; };
static int pcf85063_probe(struct i2c_client *client) static int pcf85063_probe(struct i2c_client *client)
...@@ -645,22 +638,22 @@ static int pcf85063_probe(struct i2c_client *client) ...@@ -645,22 +638,22 @@ static int pcf85063_probe(struct i2c_client *client)
} }
static const struct i2c_device_id pcf85063_ids[] = { static const struct i2c_device_id pcf85063_ids[] = {
{ "pca85073a", .driver_data = (kernel_ulong_t)&pcf85063_cfg[PCF85063A] }, { "pca85073a", .driver_data = (kernel_ulong_t)&config_pcf85063a },
{ "pcf85063", .driver_data = (kernel_ulong_t)&pcf85063_cfg[PCF85063] }, { "pcf85063", .driver_data = (kernel_ulong_t)&config_pcf85063 },
{ "pcf85063tp", .driver_data = (kernel_ulong_t)&pcf85063_cfg[PCF85063TP] }, { "pcf85063tp", .driver_data = (kernel_ulong_t)&config_pcf85063tp },
{ "pcf85063a", .driver_data = (kernel_ulong_t)&pcf85063_cfg[PCF85063A] }, { "pcf85063a", .driver_data = (kernel_ulong_t)&config_pcf85063a },
{ "rv8263", .driver_data = (kernel_ulong_t)&pcf85063_cfg[RV8263] }, { "rv8263", .driver_data = (kernel_ulong_t)&config_rv8263 },
{} {}
}; };
MODULE_DEVICE_TABLE(i2c, pcf85063_ids); MODULE_DEVICE_TABLE(i2c, pcf85063_ids);
#ifdef CONFIG_OF #ifdef CONFIG_OF
static const struct of_device_id pcf85063_of_match[] = { static const struct of_device_id pcf85063_of_match[] = {
{ .compatible = "nxp,pca85073a", .data = &pcf85063_cfg[PCF85063A] }, { .compatible = "nxp,pca85073a", .data = &config_pcf85063a },
{ .compatible = "nxp,pcf85063", .data = &pcf85063_cfg[PCF85063] }, { .compatible = "nxp,pcf85063", .data = &config_pcf85063 },
{ .compatible = "nxp,pcf85063tp", .data = &pcf85063_cfg[PCF85063TP] }, { .compatible = "nxp,pcf85063tp", .data = &config_pcf85063tp },
{ .compatible = "nxp,pcf85063a", .data = &pcf85063_cfg[PCF85063A] }, { .compatible = "nxp,pcf85063a", .data = &config_pcf85063a },
{ .compatible = "microcrystal,rv8263", .data = &pcf85063_cfg[RV8263] }, { .compatible = "microcrystal,rv8263", .data = &config_rv8263 },
{} {}
}; };
MODULE_DEVICE_TABLE(of, pcf85063_of_match); MODULE_DEVICE_TABLE(of, pcf85063_of_match);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment