15 #include <linux/device.h>
16 #include <linux/module.h>
17 #include <linux/input.h>
19 #include <linux/i2c.h>
30 static int da9052_i2c_enable_multiwrite(
struct da9052 *
da9052)
39 reg_val &= ~DA9052_CONTROL_B_WRITEMODE;
59 { .
compatible =
"dlg,da9052", .data = &da9052_i2c_id[0] },
60 { .compatible =
"dlg,da9053-aa", .data = &da9052_i2c_id[1] },
61 { .compatible =
"dlg,da9053-ab", .data = &da9052_i2c_id[2] },
62 { .compatible =
"dlg,da9053-bb", .data = &da9052_i2c_id[3] },
70 struct da9052 *da9052;
77 if (!i2c_check_functionality(client->
adapter,
79 dev_info(&client->
dev,
"Error in %s:i2c_check_functionality\n",
84 da9052->
dev = &client->
dev;
87 i2c_set_clientdata(client, da9052);
90 if (IS_ERR(da9052->
regmap)) {
91 ret = PTR_ERR(da9052->
regmap);
92 dev_err(&client->
dev,
"Failed to allocate register map: %d\n",
97 ret = da9052_i2c_enable_multiwrite(da9052);
126 struct da9052 *da9052 = i2c_get_clientdata(client);
132 static struct i2c_driver da9052_i2c_driver = {
133 .probe = da9052_i2c_probe,
135 .id_table = da9052_i2c_id,
140 .of_match_table = dialog_dt_ids,
145 static int __init da9052_i2c_init(
void)
149 ret = i2c_add_driver(&da9052_i2c_driver);
151 pr_err(
"DA9052 I2C registration failed %d\n", ret);
159 static void __exit da9052_i2c_exit(
void)