lkml.org 
[lkml]   [2020]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFT PATCH v2 7/8] gpio: exar: switch to using regmap
On Wed, Nov 04, 2020 at 08:30:50PM +0100, Bartosz Golaszewski wrote:

> @@ -119,21 +81,39 @@ static void exar_set_value(struct gpio_chip *chip, unsigned int offset,
> unsigned int addr = exar_offset_to_lvl_addr(exar_gpio, offset);
> unsigned int bit = exar_offset_to_bit(exar_gpio, offset);
>
> - exar_update(chip, addr, value, bit);
> + regmap_assign_bits(exar_gpio->regs, addr, BIT(bit), value);
> }

This appears to be the use of _assign_bits() and TBH I'm still both
having a hard time understanding the motivation for it and liking the
name, especially since AFAICT it's only setting a single bit here. The
above is just

regmap_update_bits(exar_gpio->regs, addr, 1 << bit, value << bit);

AFAICT (and indeed now I dig around assign_bit() only works on a single
bit and does both shifts which makes the correspondance with that
interface super unclear, we're not mirroring that interface here). If
you're trying to clone the bitops function it should probably be an
actual clone of the bitops function not something different, that would
be clearer and it'd be easier to understand why someone would want the
API in the first place. But perhaps I'm missing something here?
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2020-11-05 18:42    [W:0.453 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site