Messages in this thread Patch in this message | | | Date | Sat, 12 Nov 2022 02:37:38 +0530 | Subject | Re: [PATCH v4 1/3] dt-bindings: hwmon: fan: Add fan binding to schema | From | Naresh Solanki <> |
| |
Hi Rob,
On 02-11-2022 12:14 am, Rob Herring wrote: > On Mon, Oct 31, 2022 at 01:35:09PM +0530, Naresh Solanki wrote: >> Hi Rob, >> >> On 26-10-2022 07:07 pm, Rob Herring wrote: >>> fanc: fan-controller { >>> #pwm-cells = <3>; >>> ... >>> >>> fan { >>> pwms = <&fanc 0 500000 PWM_POLARITY_INVERTED>; >>> ... >>> }; >>> }; >>> >>> 0 is PWM number and 500000 is the PWM frequency. The 3rd cell are per >>> consumer flags. See pwm.txt for more details. >> >> Did the implementation & while testing getting the below err: >> [63.626505] max6639 166-002e: failed to create device link to 166-002e > > Does turning off fw_devlink help (fw_devlink=off)?
Will supplier == consumer, device link creation fails. Not sure what is best approach but not creating device link in this scenario help & for that below additional changes needed in pwm core.
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 4527f09a5c50..afea51c49138 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -730,6 +730,12 @@ static struct device_link *pwm_device_link_add(struct device *dev, return NULL; }
+ /* + * Do not attempt to create link if consumer itself is supplier. + */ + if (dev == pwm->chip->dev) + return 0; + dl = device_link_add(dev, pwm->chip->dev, DL_FLAG_AUTOREMOVE_CONSUMER); if (!dl) { dev_err(dev, "failed to create device link to %s\n",
Regards, Naresh
| |