Re: [PATCH v8 3/3] input: pm8xxx-vibrator: add new SPMI vibrator support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Konrad,

On 4/11/2024 2:10 AM, Konrad Dybcio wrote:


+    if (regs->drv2_mask) {
+        if (on)
+            val = (vib->level << regs->drv2_shift) & regs->drv2_mask;
+        else
+            val = 0;
+        rc = regmap_write(vib->regmap, vib->drv2_addr, val);

Are you purposefuly zeroing out the other bits?

If yes, consider regmap_write_bits here
If not, consider regmap_update_bits here

+        if (rc < 0)
+            return rc;

Ignore regmap_r/w errors, these mean a complete failure of the API and
we don't generally assume MMIO accesses can fail

Unless SPMI is known to have issues here

Sorry, forgot to reply on this comment. Yes, SPMI transaction would fail (even with very low odds) on some boards if the layout of SPMI lines is not good enough. I'd like to keep the consistence since the whole driver also checks the regmap_r/w errors.






[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux