|
@@ -241,21 +241,53 @@ static int rvin_digital_graph_init(struct rvin_dev *vin)
|
|
|
* Platform Device Driver
|
|
|
*/
|
|
|
|
|
|
+static const struct rvin_info rcar_info_h1 = {
|
|
|
+ .model = RCAR_H1,
|
|
|
+};
|
|
|
+
|
|
|
+static const struct rvin_info rcar_info_m1 = {
|
|
|
+ .model = RCAR_M1,
|
|
|
+};
|
|
|
+
|
|
|
+static const struct rvin_info rcar_info_gen2 = {
|
|
|
+ .model = RCAR_GEN2,
|
|
|
+};
|
|
|
+
|
|
|
static const struct of_device_id rvin_of_id_table[] = {
|
|
|
- { .compatible = "renesas,vin-r8a7794", .data = (void *)RCAR_GEN2 },
|
|
|
- { .compatible = "renesas,vin-r8a7793", .data = (void *)RCAR_GEN2 },
|
|
|
- { .compatible = "renesas,vin-r8a7791", .data = (void *)RCAR_GEN2 },
|
|
|
- { .compatible = "renesas,vin-r8a7790", .data = (void *)RCAR_GEN2 },
|
|
|
- { .compatible = "renesas,vin-r8a7779", .data = (void *)RCAR_H1 },
|
|
|
- { .compatible = "renesas,vin-r8a7778", .data = (void *)RCAR_M1 },
|
|
|
- { .compatible = "renesas,rcar-gen2-vin", .data = (void *)RCAR_GEN2 },
|
|
|
- { },
|
|
|
+ {
|
|
|
+ .compatible = "renesas,vin-r8a7778",
|
|
|
+ .data = &rcar_info_m1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ .compatible = "renesas,vin-r8a7779",
|
|
|
+ .data = &rcar_info_h1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ .compatible = "renesas,vin-r8a7790",
|
|
|
+ .data = &rcar_info_gen2,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ .compatible = "renesas,vin-r8a7791",
|
|
|
+ .data = &rcar_info_gen2,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ .compatible = "renesas,vin-r8a7793",
|
|
|
+ .data = &rcar_info_gen2,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ .compatible = "renesas,vin-r8a7794",
|
|
|
+ .data = &rcar_info_gen2,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ .compatible = "renesas,rcar-gen2-vin",
|
|
|
+ .data = &rcar_info_gen2,
|
|
|
+ },
|
|
|
+ { /* Sentinel */ },
|
|
|
};
|
|
|
MODULE_DEVICE_TABLE(of, rvin_of_id_table);
|
|
|
|
|
|
static int rcar_vin_probe(struct platform_device *pdev)
|
|
|
{
|
|
|
- const struct of_device_id *match;
|
|
|
struct rvin_dev *vin;
|
|
|
struct resource *mem;
|
|
|
int irq, ret;
|
|
@@ -264,12 +296,8 @@ static int rcar_vin_probe(struct platform_device *pdev)
|
|
|
if (!vin)
|
|
|
return -ENOMEM;
|
|
|
|
|
|
- match = of_match_device(of_match_ptr(rvin_of_id_table), &pdev->dev);
|
|
|
- if (!match)
|
|
|
- return -ENODEV;
|
|
|
-
|
|
|
vin->dev = &pdev->dev;
|
|
|
- vin->chip = (enum chip_id)match->data;
|
|
|
+ vin->info = of_device_get_match_data(&pdev->dev);
|
|
|
|
|
|
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
|
|
if (mem == NULL)
|