wlan-ap-Telecominfraproject/feeds/ipq95xx/ipq53xx/patches/300-pwm.patch
John Crispin c95b91c399 ipq95xx: various updates
* finalize CIG WF198 support
* add Sercomm AP72tip support
* update BDF files
* improve firmware package

Signed-off-by: John Crispin <john@phrozen.org>
2024-02-28 18:56:21 +01:00

41 lines
1.5 KiB
Diff

Index: linux-5.4.213-qsdk-b2d40c94fad765a48c03f492d669aeecbbb9b617/drivers/pwm/pwm-ipq.c
===================================================================
--- linux-5.4.213-qsdk-b2d40c94fad765a48c03f492d669aeecbbb9b617.orig/drivers/pwm/pwm-ipq.c
+++ linux-5.4.213-qsdk-b2d40c94fad765a48c03f492d669aeecbbb9b617/drivers/pwm/pwm-ipq.c
@@ -110,6 +110,7 @@ struct ipq_pwm_chip {
static ssize_t count;
static uint32_t used_pwm[MAX_PWM_DEVICES];
+//static uint32_t dft_pwm[MAX_PWM_DEVICES];
static const uint32_t pwm_ctrl_register[] = {
ADSS_GLB_PWM0_CTRL_REG,
@@ -330,6 +331,7 @@ static int ipq_pwm_probe(struct platform
struct device *dev;
unsigned int base_index;
int ret;
+ //unsigned int i;
const void *dev_data;
unsigned long src_freq = SRC_FREQ;
struct resource *res = NULL;
@@ -387,6 +389,19 @@ static int ipq_pwm_probe(struct platform
dev_err(dev, "pwmchip_add() failed: %d\n", ret);
return ret;
}
+
+ /*count = of_property_count_u32_elems(dev->of_node, "dft-pwm-status");
+ if (!of_property_read_u32_array(dev->of_node, "dft-pwm-status",
+ dft_pwm, count)) {
+ for(i = 0; i < count; i++) {
+ if(dft_pwm[i] > 0) {
+ ipq_pwm_request(&(pwm->chip), &(pwm->chip.pwms[i]));
+ ipq_pwm_config(&(pwm->chip), &(pwm->chip.pwms[i]), 500000000, 1000000000);
+ }
+ }
+ }*/
+ ipq_pwm_request(&(pwm->chip), &(pwm->chip.pwms[1]));
+ ipq_pwm_config(&(pwm->chip), &(pwm->chip.pwms[1]), 500000000, 1000000000);
return 0;
}