• Charles Keepax's avatar
    mfd: arizona: Refactor arizona_poll_reg · ef84f885
    Charles Keepax authored
    Currently, we specify the timeout in terms of the number of polls but it
    is more clear from a user of the functions perspective to specify the
    timeout directly in milliseconds, as such update the function to these new
    semantics.
    
    Additionally, arizona_poll_reg essentially hard-codes
    regmap_read_poll_timeout, update the implementation to use
    regmap_read_poll_timeout. We still keep arizona_poll_reg around as
    regmap_read_poll_timeout is a macro so rather than expand this for each
    caller keep it wrapped in arizona_poll_reg.
    
    Whilst we are doing this make the timeouts a little more generous as
    the previous system had a bit more slack as it was done as a delay per
    iteration of the loop whereas regmap_read_poll_timeout compares ktime's.
    Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
    Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
    ef84f885
arizona-core.c 37.2 KB