Commit e436ddff authored by Lee Jones's avatar Lee Jones

mfd: ab8500-debugfs: Add tests for ab8540 based platform initialisations

Signed-off-by: default avatarAlexandre Torgue <alexandre.torgue@stericsson.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Reviewed-by: default avatarMarcus COOPER <marcus.xm.cooper@stericsson.com>
Reviewed-by: default avatarMattias WALLIN <mattias.wallin@stericsson.com>
Tested-by: default avatarMaxime COQUELIN <maxime.coquelin@stericsson.com>
Acked-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 2377e52f
...@@ -1346,6 +1346,7 @@ static ssize_t show_chip_id(struct device *dev, ...@@ -1346,6 +1346,7 @@ static ssize_t show_chip_id(struct device *dev,
struct ab8500 *ab8500; struct ab8500 *ab8500;
ab8500 = dev_get_drvdata(dev); ab8500 = dev_get_drvdata(dev);
return sprintf(buf, "%#x\n", ab8500 ? ab8500->chip_id : -EINVAL); return sprintf(buf, "%#x\n", ab8500 ? ab8500->chip_id : -EINVAL);
} }
...@@ -1676,7 +1677,7 @@ static int ab8500_probe(struct platform_device *pdev) ...@@ -1676,7 +1677,7 @@ static int ab8500_probe(struct platform_device *pdev)
/* Activate this feature only in ab9540 */ /* Activate this feature only in ab9540 */
/* till tests are done on ab8500 1p2 or later*/ /* till tests are done on ab8500 1p2 or later*/
if (is_ab9540(ab8500)) { if (is_ab9540(ab8500) || is_ab8540(ab8500))
ret = devm_request_threaded_irq(&pdev->dev, ab8500->irq, NULL, ret = devm_request_threaded_irq(&pdev->dev, ab8500->irq, NULL,
ab8500_hierarchical_irq, ab8500_hierarchical_irq,
IRQF_ONESHOT | IRQF_NO_SUSPEND, IRQF_ONESHOT | IRQF_NO_SUSPEND,
...@@ -1719,7 +1720,8 @@ static int ab8500_probe(struct platform_device *pdev) ...@@ -1719,7 +1720,8 @@ static int ab8500_probe(struct platform_device *pdev)
dev_err(ab8500->dev, "error adding bm devices\n"); dev_err(ab8500->dev, "error adding bm devices\n");
} }
if (is_ab9540(ab8500)) if (((is_ab8505(ab8500) || is_ab9540(ab8500)) &&
ab8500->chip_id >= AB8500_CUT2P0) || is_ab8540(ab8500))
ret = sysfs_create_group(&ab8500->dev->kobj, ret = sysfs_create_group(&ab8500->dev->kobj,
&ab9540_attr_group); &ab9540_attr_group);
else else
...@@ -1735,7 +1737,8 @@ static int ab8500_remove(struct platform_device *pdev) ...@@ -1735,7 +1737,8 @@ static int ab8500_remove(struct platform_device *pdev)
{ {
struct ab8500 *ab8500 = platform_get_drvdata(pdev); struct ab8500 *ab8500 = platform_get_drvdata(pdev);
if (is_ab9540(ab8500)) if (((is_ab8505(ab8500) || is_ab9540(ab8500)) &&
ab8500->chip_id >= AB8500_CUT2P0) || is_ab8540(ab8500))
sysfs_remove_group(&ab8500->dev->kobj, &ab9540_attr_group); sysfs_remove_group(&ab8500->dev->kobj, &ab9540_attr_group);
else else
sysfs_remove_group(&ab8500->dev->kobj, &ab8500_attr_group); sysfs_remove_group(&ab8500->dev->kobj, &ab8500_attr_group);
......
...@@ -1943,6 +1943,8 @@ static int ab8500_debug_probe(struct platform_device *plf) ...@@ -1943,6 +1943,8 @@ static int ab8500_debug_probe(struct platform_device *plf)
num_interrupt_lines = AB8505_NR_IRQS; num_interrupt_lines = AB8505_NR_IRQS;
else if (is_ab9540(ab8500)) else if (is_ab9540(ab8500))
num_interrupt_lines = AB9540_NR_IRQS; num_interrupt_lines = AB9540_NR_IRQS;
else if (is_ab8540(ab8500))
num_interrupt_lines = AB8540_NR_IRQS;
file = debugfs_create_file("interrupts", (S_IRUGO), file = debugfs_create_file("interrupts", (S_IRUGO),
ab8500_dir, &plf->dev, &ab8500_interrupts_fops); ab8500_dir, &plf->dev, &ab8500_interrupts_fops);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment