lkml.org 
[lkml]   [2021]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH net-next 2/2] drivers: net: dsa: mt7530: MT7530 optional GPIO support
    On Mon, Jan 11, 2021 at 6:46 AM DENG Qingfang <dqfext@gmail.com> wrote:

    > MT7530's LED controller can drive up to 15 LED/GPIOs.
    >
    > Add support for GPIO control and allow users to use its GPIOs by
    > setting gpio-controller property in device tree.
    >
    > Signed-off-by: DENG Qingfang <dqfext@gmail.com>

    Double-check the initial output conditions as indicated by
    Russell, if you really want to be thorough, use an oscilloscope
    but check the specs at least.

    > +static u32
    > +mt7530_gpio_to_bit(unsigned int offset)
    > +{
    > + return BIT(offset + offset / 3);
    > +}

    So for offset 0..14 this becomes bits
    0, 1, 2, 4, 5, 6, 8, 9, 10, 12 ... 18

    What is the logic in this and is it what you intend?
    Please add a comment explaining what the offset is supposed
    to become for offsets 0..14 and why.

    > + gc->ngpio = 15;

    And it really IS 15 not 16? Not that I know network equipment
    very well...

    Yours,
    Linus Walleij

    \
     
     \ /
      Last update: 2021-01-18 15:59    [W:2.315 / U:0.276 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site