[Letux-kernel] Pyra display driver once again broken in v5.2-rc1

Andreas Kemnade andreas at kemnade.info
Wed May 29 19:51:21 CEST 2019


On Wed, 29 May 2019 02:12:27 -0700
Tony Lindgren <tony at atomide.com> wrote:

> Hi,
> 
> * H. Nikolaus Schaller <hns at goldelico.com> [190529 08:57]:
> > > [    7.524125] pca953x 4-0022: failed writing register
> > > [    7.529444] pca953x: probe of 4-0022 failed with error -22  
> 
> I saw something similar with a BBB cape (early Baylibre
> ACME cape) and it was device_pca95xx_init() somehow trying to
> write to a read-only register causing an error.
> 
> I did not debug further and I do not have it handy, and I
> could not easily figure out what caused the regression..
> But maybe take a look and see if commenting out the register
> write device_pca95xx_init() helps.
> 


root at letux:/sys/bus/i2c/drivers/pca953x# echo 4-0022 >bind 
[  176.917013] pca953x 4-0022: writing reg 02 -> 88 = 00
-> apparently inversion register

[  176.922460] pca953x 4-0022: failed writing register: 02
[  176.929805] pca953x: probe of 4-0022 failed with error -22
-bash: echo: write error: No such device
root at letux:/sys/bus/i2c/drivers/pca953x# i2cset -y 4 0x22 0x88 0
root at letux:/sys/bus/i2c/drivers/pca953x# i2cset -y 4 0x22 0x2 0                                                                                                                               
root at letux:/sys/bus/i2c/drivers/pca953x# 

debug output by this patch:
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index b7ef33f63392..161c5d5ee8c8 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -338,10 +338,11 @@ static int pca953x_write_regs(struct pca953x_chip *chip, int reg, u8 *val)
 {
        u8 regaddr = pca953x_recalc_addr(chip, reg, 0, true, true);
        int ret;
-
+       
+       dev_info(&chip->client->dev, "writing reg %02x -> %02x = %02x", reg, regaddr, *val);
        ret = regmap_bulk_write(chip->regmap, regaddr, val, NBANK(chip));
        if (ret < 0) {
-               dev_err(&chip->client->dev, "failed writing register\n");
+               dev_err(&chip->client->dev, "failed writing register: %02x\n", reg);
                return ret;
        }
 
perhaps this rings a bell for someone.

Regards,
Andreas


More information about the Letux-kernel mailing list