summaryrefslogtreecommitdiff
path: root/drivers/pwm
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pwm')
-rw-r--r--drivers/pwm/core.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 821ee1959816..c165c5822703 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -158,8 +158,14 @@ static void of_pwmchip_add(struct pwm_chip *chip)
return;
if (!chip->of_xlate) {
+ u32 pwm_cells;
+
+ if (of_property_read_u32(chip->dev->of_node, "#pwm-cells",
+ &pwm_cells))
+ pwm_cells = 2;
+
chip->of_xlate = of_pwm_xlate_with_flags;
- chip->of_pwm_n_cells = 2;
+ chip->of_pwm_n_cells = pwm_cells;
}
of_node_get(chip->dev->of_node);