Re: [PATCH] max310x: max3109_detect should use indirect addressing in SPI mode for REVID register

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 05, 2014 at 06:07:36PM +0200, Gregory Hermant wrote:
> This patch allows to read the REV_ID register in SPI mode and consequently
> to properly detect the max3109. Indeed in SPI mode, this register is only
> accessible by using indirect addressing.
> 
> Signed-off-by: Gregory Hermant <gregory.hermant@xxxxxxxxxxxxxxxxx>
> ---
>  drivers/tty/serial/max310x.c |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
> index 5183643..2d911f6 100644
> --- a/drivers/tty/serial/max310x.c
> +++ b/drivers/tty/serial/max310x.c
> @@ -369,10 +369,13 @@ static int max3109_detect(struct device *dev)
>  	unsigned int val = 0;
>  	int ret;
>  
> -	ret = regmap_read(s->regmap, MAX310X_REVID_REG, &val);
> +	ret = regmap_write(s->regmap, MAX310X_GLOBALCMD_REG,
> +			   MAX310X_EXTREG_ENBL);
>  	if (ret)
>  		return ret;
> -
> +	

Always run your patches through checkpatch.pl and never add new problems
to the existing codebase :(

--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux