pwm: qpnp: Add support to read the LPG LUT size from device tree
Add support to read the qcom,lpg-lut-size property from the device tree instead of using the value returned by the of_get_address API. CRs-Fixed: 1060896 Change-Id: I0f84baf29a141719dd44dabb67e9d599d9646d49 Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
This commit is contained in:
parent
8ec8b328f3
commit
1124870d66
2 changed files with 10 additions and 2 deletions
|
@ -15,6 +15,7 @@ Required device bindings:
|
||||||
- reg-names: Name for the above register.
|
- reg-names: Name for the above register.
|
||||||
"qpnp-lpg-channel-base" = physical base address of the
|
"qpnp-lpg-channel-base" = physical base address of the
|
||||||
controller's LPG channel register.
|
controller's LPG channel register.
|
||||||
|
- qcom,lpg-lut-size: LPG LUT size.
|
||||||
- qcom,channel-id: channel Id for the PWM.
|
- qcom,channel-id: channel Id for the PWM.
|
||||||
- qcom,supported-sizes: Supported PWM sizes.
|
- qcom,supported-sizes: Supported PWM sizes.
|
||||||
Following three pwm sizes lists are supported by PWM/LPG controllers.
|
Following three pwm sizes lists are supported by PWM/LPG controllers.
|
||||||
|
|
|
@ -1879,7 +1879,7 @@ static int qpnp_parse_dt_config(struct platform_device *pdev,
|
||||||
int rc, enable, lut_entry_size, list_size, i;
|
int rc, enable, lut_entry_size, list_size, i;
|
||||||
const char *lable;
|
const char *lable;
|
||||||
const __be32 *prop;
|
const __be32 *prop;
|
||||||
u64 size;
|
u32 size;
|
||||||
struct device_node *node;
|
struct device_node *node;
|
||||||
int found_pwm_subnode = 0;
|
int found_pwm_subnode = 0;
|
||||||
int found_lpg_subnode = 0;
|
int found_lpg_subnode = 0;
|
||||||
|
@ -1968,11 +1968,18 @@ static int qpnp_parse_dt_config(struct platform_device *pdev,
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
prop = of_get_address_by_name(pdev->dev.of_node, QPNP_LPG_LUT_BASE,
|
prop = of_get_address_by_name(pdev->dev.of_node, QPNP_LPG_LUT_BASE,
|
||||||
&size, 0);
|
0, 0);
|
||||||
if (!prop) {
|
if (!prop) {
|
||||||
chip->flags |= QPNP_PWM_LUT_NOT_SUPPORTED;
|
chip->flags |= QPNP_PWM_LUT_NOT_SUPPORTED;
|
||||||
} else {
|
} else {
|
||||||
lpg_config->lut_base_addr = be32_to_cpu(*prop);
|
lpg_config->lut_base_addr = be32_to_cpu(*prop);
|
||||||
|
rc = of_property_read_u32(of_node, "qcom,lpg-lut-size", &size);
|
||||||
|
if (rc < 0) {
|
||||||
|
dev_err(&pdev->dev, "Error reading qcom,lpg-lut-size, rc=%d\n",
|
||||||
|
rc);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Each entry of LUT is of 2 bytes for generic LUT and of 1 byte
|
* Each entry of LUT is of 2 bytes for generic LUT and of 1 byte
|
||||||
* for KPDBL/GLED LUT.
|
* for KPDBL/GLED LUT.
|
||||||
|
|
Loading…
Add table
Reference in a new issue