public inbox for linux-input@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Marcus Folkesson <marcus.folkesson@gmail.com>
Cc: Simon Shields <simon@lineageos.org>,
	Andi Shyti <andi.shyti@samsung.com>,
	Rob Herring <robh@kernel.org>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] Input: mms114 - add support for mms152
Date: Wed, 24 Jan 2018 13:27:34 -0800	[thread overview]
Message-ID: <20180124212734.qeud4pv2i6jqjb34@dtor-ws> (raw)
In-Reply-To: <20180124200408.GB705@gmail.com>

On Wed, Jan 24, 2018 at 09:04:08PM +0100, Marcus Folkesson wrote:
> Hello Dmitry,
> 
> On Wed, Jan 24, 2018 at 11:38:04AM -0800, Dmitry Torokhov wrote:
> > From: Simon Shields <simon@lineageos.org>
> > 
> > @@ -241,12 +251,28 @@ static int mms114_get_version(struct mms114_data *data)
> >  	u8 buf[6];
> >  	int error;
> >  
> > -	error = __mms114_read_reg(data, MMS114_TSP_REV, 6, buf);
> > -	if (error < 0)
> > -		return error;
> > +	switch (data->type) {
> > +	case TYPE_MMS152:
> > +		error = __mms114_read_reg(data, MMS152_FW_REV, 3, buf);
> > +		if (error)
> > +			return error;
> > +		buf[3] = i2c_smbus_read_byte_data(data->client,
> > +						  MMS152_COMPAT_GROUP);
> > +		if (buf[3] < 0)
> > +			return buf[3];
> 
> buf is unsigned.
> 
> Maybe
> 		error = i2c_smbus_read_byte_data(data->client,
> 						  MMS152_COMPAT_GROUP);
> 		if (error < 0)
> 			return error;
> Instead?

Good catch. I think I'd rather have a separate variable "group" for
this.

Thank you.

> 
> 
> > +		dev_info(dev, "TSP FW Rev: bootloader 0x%x / core 0x%x / config 0x%x, Compat group: %c\n",
> > +			 buf[0], buf[1], buf[2], buf[3]);
> > +		break;
> > +
> > +	case TYPE_MMS114:
> > +		error = __mms114_read_reg(data, MMS114_TSP_REV, 6, buf);
> > +		if (error)
> > +			return error;
> >  
> > -	dev_info(dev, "TSP Rev: 0x%x, HW Rev: 0x%x, Firmware Ver: 0x%x\n",
> > -		 buf[0], buf[1], buf[3]);
> > +		dev_info(dev, "TSP Rev: 0x%x, HW Rev: 0x%x, Firmware Ver: 0x%x\n",
> > +			 buf[0], buf[1], buf[3]);
> > +		break;
> > +	}
> >  
> >  	return 0;
> >  }
> 
> 
> Best regards
> Marcus Folkesson



-- 
Dmitry

  reply	other threads:[~2018-01-24 21:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24 19:38 [PATCH 0/4] MMS114 touchscreen patches Dmitry Torokhov
2018-01-24 19:38 ` [PATCH 1/4] Input: mms114 - do not clobber interrupt trigger Dmitry Torokhov
2018-01-26  4:54   ` Andi Shyti
2018-01-24 19:38 ` [PATCH 2/4] Input: mms114 - mark as direct input device Dmitry Torokhov
2018-01-26  4:55   ` Andi Shyti
2018-01-24 19:38 ` [PATCH 3/4] Input: mms114 - drop platform data and use generic APIs Dmitry Torokhov
2018-01-26  5:06   ` Andi Shyti
2018-01-24 19:38 ` [PATCH 4/4] Input: mms114 - add support for mms152 Dmitry Torokhov
2018-01-24 20:04   ` Marcus Folkesson
2018-01-24 21:27     ` Dmitry Torokhov [this message]
2018-01-24 21:32     ` [PATCH 4/4 v2] " Dmitry Torokhov
2018-01-26  5:14       ` Andi Shyti
2018-01-26 19:25         ` Dmitry Torokhov
2018-01-25 13:01 ` [PATCH 0/4] MMS114 touchscreen patches Simon Shields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180124212734.qeud4pv2i6jqjb34@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=andi.shyti@samsung.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcus.folkesson@gmail.com \
    --cc=robh@kernel.org \
    --cc=simon@lineageos.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox