Thanks Linus. Hi Tobias, few observations on code: 1. Copy-paste error; please change set to get in comments for struct mcp_get_sram_settings. 2. If mcp_configure_gp() fails, we have invalid copy of mcp->gp_runtime_settings (new value is not set actually but we have updated this array with new value).. Regards, Rishi On Fri, Sep 17, 2021 at 4:44 AM Linus Walleij <linus.walleij@xxxxxxxxxx> wrote: > > On Wed, Aug 18, 2021 at 5:28 PM Tobias Junghans > <tobias.junghans@xxxxxxxx> wrote: > > > Per default the GP pins of an MCP2221 are designated to a certain > > dedicated or alternate function. While it's possible to change these > > defaults by manually updating the internal flash, it's much more > > convenient and safe to configure the GP pins as GPIOs automatically > > at runtime whenever the corresponding GPIO line is requested. The > > previous setting is restored as soon as the GPIO line is freed again. > > > > Signed-off-by: Tobias Junghans <tobias.junghans@xxxxxxxx> > > My sympathies are usually on the side of users trying to make > use of their hardware and they should be able to. > > For other wrong configured GPIO expanders such as FTDI > a publicly available firmware reflash tool exists, and if that does > not exist for this hardware, I think this approach is legitimate. > > Acked-by: Linus Walleij <linus.walleij@xxxxxxxxxx> > > Yours, > Linus Walleij