]> Git Repo - linux.git/blobdiff - drivers/misc/atmel_tclib.c
selinux: Remove security_ops extern
[linux.git] / drivers / misc / atmel_tclib.c
index de6dea7c5d52e791f720df30dced9d4b8ec279b8..c8d8e38d0d8ae6dc47cc0d85b581388896ae5361 100644 (file)
@@ -114,9 +114,21 @@ void atmel_tc_free(struct atmel_tc *tc)
 EXPORT_SYMBOL_GPL(atmel_tc_free);
 
 #if defined(CONFIG_OF)
+static struct atmel_tcb_config tcb_rm9200_config = {
+       .counter_width = 16,
+};
+
+static struct atmel_tcb_config tcb_sam9x5_config = {
+       .counter_width = 32,
+};
+
 static const struct of_device_id atmel_tcb_dt_ids[] = {
        {
                .compatible = "atmel,at91rm9200-tcb",
+               .data = &tcb_rm9200_config,
+       }, {
+               .compatible = "atmel,at91sam9x5-tcb",
+               .data = &tcb_sam9x5_config,
        }, {
                /* sentinel */
        }
@@ -150,6 +162,14 @@ static int __init tc_probe(struct platform_device *pdev)
                return -EINVAL;
        }
 
+       /* Now take SoC information if available */
+       if (pdev->dev.of_node) {
+               const struct of_device_id *match;
+               match = of_match_node(atmel_tcb_dt_ids, pdev->dev.of_node);
+               if (match)
+                       tc->tcb_config = match->data;
+       }
+
        tc->clk[0] = clk;
        tc->clk[1] = clk_get(&pdev->dev, "t1_clk");
        if (IS_ERR(tc->clk[1]))
This page took 0.032861 seconds and 4 git commands to generate.