rtc: isl1208: Drop enum isl1208_id and split isl1208_configs[]
Drop enum isl1208_id and split the array isl1208_configs[] as individual variables, and make lines shorter by referring to e.g. &config_isl1219 instead of &isl1208_configs[TYPE_ISL1219]. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20230623140948.384762-9-biju.das.jz@bp.renesas.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
fbc06a5356
commit
5923fc75d0
|
@ -68,41 +68,51 @@
|
||||||
|
|
||||||
static struct i2c_driver isl1208_driver;
|
static struct i2c_driver isl1208_driver;
|
||||||
|
|
||||||
/* ISL1208 various variants */
|
|
||||||
enum isl1208_id {
|
|
||||||
TYPE_ISL1208 = 0,
|
|
||||||
TYPE_ISL1209,
|
|
||||||
TYPE_ISL1218,
|
|
||||||
TYPE_ISL1219,
|
|
||||||
ISL_LAST_ID
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Chip capabilities table */
|
/* Chip capabilities table */
|
||||||
static const struct isl1208_config {
|
struct isl1208_config {
|
||||||
unsigned int nvmem_length;
|
unsigned int nvmem_length;
|
||||||
unsigned has_tamper:1;
|
unsigned has_tamper:1;
|
||||||
unsigned has_timestamp:1;
|
unsigned has_timestamp:1;
|
||||||
} isl1208_configs[] = {
|
};
|
||||||
[TYPE_ISL1208] = { 2, false, false },
|
|
||||||
[TYPE_ISL1209] = { 2, true, false },
|
static const struct isl1208_config config_isl1208 = {
|
||||||
[TYPE_ISL1218] = { 8, false, false },
|
.nvmem_length = 2,
|
||||||
[TYPE_ISL1219] = { 2, true, true },
|
.has_tamper = false,
|
||||||
|
.has_timestamp = false
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct isl1208_config config_isl1209 = {
|
||||||
|
.nvmem_length = 2,
|
||||||
|
.has_tamper = true,
|
||||||
|
.has_timestamp = false
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct isl1208_config config_isl1218 = {
|
||||||
|
.nvmem_length = 8,
|
||||||
|
.has_tamper = false,
|
||||||
|
.has_timestamp = false
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct isl1208_config config_isl1219 = {
|
||||||
|
.nvmem_length = 2,
|
||||||
|
.has_tamper = true,
|
||||||
|
.has_timestamp = true
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct i2c_device_id isl1208_id[] = {
|
static const struct i2c_device_id isl1208_id[] = {
|
||||||
{ "isl1208", .driver_data = (kernel_ulong_t)&isl1208_configs[TYPE_ISL1208] },
|
{ "isl1208", .driver_data = (kernel_ulong_t)&config_isl1208 },
|
||||||
{ "isl1209", .driver_data = (kernel_ulong_t)&isl1208_configs[TYPE_ISL1209] },
|
{ "isl1209", .driver_data = (kernel_ulong_t)&config_isl1209 },
|
||||||
{ "isl1218", .driver_data = (kernel_ulong_t)&isl1208_configs[TYPE_ISL1218] },
|
{ "isl1218", .driver_data = (kernel_ulong_t)&config_isl1218 },
|
||||||
{ "isl1219", .driver_data = (kernel_ulong_t)&isl1208_configs[TYPE_ISL1219] },
|
{ "isl1219", .driver_data = (kernel_ulong_t)&config_isl1219 },
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(i2c, isl1208_id);
|
MODULE_DEVICE_TABLE(i2c, isl1208_id);
|
||||||
|
|
||||||
static const __maybe_unused struct of_device_id isl1208_of_match[] = {
|
static const __maybe_unused struct of_device_id isl1208_of_match[] = {
|
||||||
{ .compatible = "isil,isl1208", .data = &isl1208_configs[TYPE_ISL1208] },
|
{ .compatible = "isil,isl1208", .data = &config_isl1208 },
|
||||||
{ .compatible = "isil,isl1209", .data = &isl1208_configs[TYPE_ISL1209] },
|
{ .compatible = "isil,isl1209", .data = &config_isl1209 },
|
||||||
{ .compatible = "isil,isl1218", .data = &isl1208_configs[TYPE_ISL1218] },
|
{ .compatible = "isil,isl1218", .data = &config_isl1218 },
|
||||||
{ .compatible = "isil,isl1219", .data = &isl1208_configs[TYPE_ISL1219] },
|
{ .compatible = "isil,isl1219", .data = &config_isl1219 },
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(of, isl1208_of_match);
|
MODULE_DEVICE_TABLE(of, isl1208_of_match);
|
||||||
|
|
Loading…
Reference in New Issue