lkml.org 
[lkml]   [2018]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] pinctrl: pinctrl-single: Fix pcs_request_gpio() when bits_per_mux != 0
On Mon, Jan 22, 2018 at 1:03 AM, David Lechner <david@lechnology.com> wrote:
> This fixes pcs_request_gpio() in the pinctrl-single driver when
> bits_per_mux != 0. It appears this was overlooked when the multiple
> pins per register feature was added.
>
> Fixes: 4e7e8017a80e ("pinctrl: pinctrl-single: enhance to configure
> multiple pins of different modules")

One line?

> + byte_num = (pcs->bits_per_pin * pin) / BITS_PER_BYTE;
> + offset = (byte_num / mux_bytes) * mux_bytes;
> + pin_shift = pin % (pcs->width / pcs->bits_per_pin) *
> + pcs->bits_per_pin;

Sounds like playing around pretty well defined macro and functions,
e.g. DIV_ROUND_UP(), round_up().

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2018-01-22 15:50    [W:0.367 / U:1.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site