Skip to content

Commit 6e4380f

Browse files
valpackettAndré Apitzsch
authored andcommitted
media: i2c: dw9719: Add driver_data matching
In preparation for adding models with different register sets, start assigning the model based on the i2c match data. Signed-off-by: Val Packett <[email protected]> Signed-off-by: André Apitzsch <[email protected]>
1 parent 6919831 commit 6e4380f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/media/i2c/dw9719.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,8 @@ static int dw9719_probe(struct i2c_client *client)
282282
if (!dw9719)
283283
return -ENOMEM;
284284

285+
dw9719->model = (enum dw9719_model)(uintptr_t)i2c_get_match_data(client);
286+
285287
dw9719->regmap = devm_cci_regmap_init_i2c(client, 8);
286288
if (IS_ERR(dw9719->regmap))
287289
return PTR_ERR(dw9719->regmap);
@@ -361,8 +363,8 @@ static void dw9719_remove(struct i2c_client *client)
361363
}
362364

363365
static const struct of_device_id dw9719_of_table[] = {
364-
{ .compatible = "dongwoon,dw9719" },
365-
{ .compatible = "dongwoon,dw9761" },
366+
{ .compatible = "dongwoon,dw9719", .data = (const void *)DW9719 },
367+
{ .compatible = "dongwoon,dw9761", .data = (const void *)DW9761 },
366368
{ }
367369
};
368370
MODULE_DEVICE_TABLE(of, dw9719_of_table);

0 commit comments

Comments
 (0)