Lines Matching +full:i2c +full:- +full:compatible
1 // SPDX-License-Identifier: GPL-2.0-only
3 * ST Microelectronics MFD: stmpe's i2c client specific driver
5 * Copyright (C) ST-Ericsson SA 2010
8 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
12 #include <linux/i2c.h>
22 struct i2c_client *i2c = stmpe->client; in i2c_reg_read() local
24 return i2c_smbus_read_byte_data(i2c, reg); in i2c_reg_read()
29 struct i2c_client *i2c = stmpe->client; in i2c_reg_write() local
31 return i2c_smbus_write_byte_data(i2c, reg, val); in i2c_reg_write()
36 struct i2c_client *i2c = stmpe->client; in i2c_block_read() local
38 return i2c_smbus_read_i2c_block_data(i2c, reg, length, values); in i2c_block_read()
44 struct i2c_client *i2c = stmpe->client; in i2c_block_write() local
46 return i2c_smbus_write_i2c_block_data(i2c, reg, length, values); in i2c_block_write()
57 { .compatible = "st,stmpe610", .data = (void *)STMPE610, },
58 { .compatible = "st,stmpe801", .data = (void *)STMPE801, },
59 { .compatible = "st,stmpe811", .data = (void *)STMPE811, },
60 { .compatible = "st,stmpe1600", .data = (void *)STMPE1600, },
61 { .compatible = "st,stmpe1601", .data = (void *)STMPE1601, },
62 { .compatible = "st,stmpe1801", .data = (void *)STMPE1801, },
63 { .compatible = "st,stmpe2401", .data = (void *)STMPE2401, },
64 { .compatible = "st,stmpe2403", .data = (void *)STMPE2403, },
70 stmpe_i2c_probe(struct i2c_client *i2c) in stmpe_i2c_probe() argument
72 const struct i2c_device_id *id = i2c_client_get_device_id(i2c); in stmpe_i2c_probe()
77 i2c_ci.irq = i2c->irq; in stmpe_i2c_probe()
78 i2c_ci.client = i2c; in stmpe_i2c_probe()
79 i2c_ci.dev = &i2c->dev; in stmpe_i2c_probe()
81 of_id = of_match_device(stmpe_of_match, &i2c->dev); in stmpe_i2c_probe()
84 * This happens when the I2C ID matches the node name in stmpe_i2c_probe()
85 * but no real compatible string has been given. in stmpe_i2c_probe()
87 dev_info(&i2c->dev, "matching on node name, compatible is preferred\n"); in stmpe_i2c_probe()
88 partnum = id->driver_data; in stmpe_i2c_probe()
90 partnum = (uintptr_t)of_id->data; in stmpe_i2c_probe()
95 static void stmpe_i2c_remove(struct i2c_client *i2c) in stmpe_i2c_remove() argument
97 struct stmpe *stmpe = dev_get_drvdata(&i2c->dev); in stmpe_i2c_remove()
113 MODULE_DEVICE_TABLE(i2c, stmpe_i2c_id);
117 .name = "stmpe-i2c",
138 MODULE_DESCRIPTION("STMPE MFD I2C Interface Driver");