On Thu, Apr 7, 2022 at 10:43 PM Eddie James <eajames@xxxxxxxxxxxxx> wrote:
Support blinking using the PCA955x chip. Use PWM0 for blinking...
instead of LED_HALF brightness. Since there is only one frequency
and brightness register for any blinking LED, track the blink state
of each LED and only support one HW blinking frequency. If another
frequency is requested, fallback to software blinking.
+#define PCA955X_BLINK_DEFAULT 1000What's the unit of this number?
...
* Write to frequency prescaler register, used to program theUsing <> in formulas a bit confusing, what about
- * period of the PWM output. period = (PSCx + 1) / 38
+ * period of the PWM output. period = (PSCx + 1) / <38 or 44, chip dependent>
* period of the PWM output. period = (PSCx + 1) / coeff
* where for ... chips coeff = 38, for ... chips coeff = 44.
?
...
+ dev_err(&pca955x->client->dev, "%s: reg 0x%x, err %d\n",Can be indented better. But I would rather see regmap, where this kind
+ __func__, n, ret);
of debugging is for free and already present in the regmap core/.
...
+static u8 pca955x_period_to_psc(struct pca955x *pca955x, unsigned long p)Why casting?
+{
+ p *= (unsigned long)pca955x->chipdef->blink_div;