public inbox for linux-hwmon@vger.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: davidwang <davidwang@zhaoxin.com>
Cc: jdelvare@suse.com, tglx@linutronix.de, mingo@redhat.com,
	rafel.j.wysocki@intel.com, linux-hwmon@vger.kernel.org,
	linux-kernel@vger.kernel.org, brucechang@via-alliance.com,
	cooperyan@zhaoxin.com, qiyuanwang@zhaoxin.com,
	benjaminpan@viatech.com, lukelin@viacpu.com, timguo@zhaoxin.com
Subject: Re: [v3] hwmon, via-cputem: support new centaur CPUs
Date: Fri, 30 Mar 2018 07:55:40 -0700	[thread overview]
Message-ID: <20180330145540.GA13899@roeck-us.net> (raw)
In-Reply-To: <1522371888-30013-1-git-send-email-davidwang@zhaoxin.com>

On Fri, Mar 30, 2018 at 09:04:48AM +0800, davidwang wrote:
> New centaur CPUs(Familiy == 7) also support this cpu temperature sensor.
> 
> Change from v2 to v3:
> *replace "goto" with "if...else.." according to suggestion from Guenter
>  
> Change from v1 to v2:
> *fixed the wrong if condition in patch v1.
> 	
> Signed-off-by: David Wang <davidwang@zhaoxin.com>

Applied to hwmon-next.

Thanks,
Guenter

> ---
>  drivers/hwmon/via-cputemp.c | 31 ++++++++++++++++++-------------
>  1 file changed, 18 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/hwmon/via-cputemp.c b/drivers/hwmon/via-cputemp.c
> index 07a0cb0..0e81f28 100644
> --- a/drivers/hwmon/via-cputemp.c
> +++ b/drivers/hwmon/via-cputemp.c
> @@ -136,20 +136,24 @@ static int via_cputemp_probe(struct platform_device *pdev)
>  	data->id = pdev->id;
>  	data->name = "via_cputemp";
>  
> -	switch (c->x86_model) {
> -	case 0xA:
> -		/* C7 A */
> -	case 0xD:
> -		/* C7 D */
> -		data->msr_temp = 0x1169;
> -		data->msr_vid = 0x198;
> -		break;
> -	case 0xF:
> -		/* Nano */
> +	if (c->x86 == 7) {
>  		data->msr_temp = 0x1423;
> -		break;
> -	default:
> -		return -ENODEV;
> +	} else {
> +		switch (c->x86_model) {
> +		case 0xA:
> +			/* C7 A */
> +		case 0xD:
> +			/* C7 D */
> +			data->msr_temp = 0x1169;
> +			data->msr_vid = 0x198;
> +			break;
> +		case 0xF:
> +			/* Nano */
> +			data->msr_temp = 0x1423;
> +			break;
> +		default:
> +			return -ENODEV;
> +		}
>  	}
>  
>  	/* test if we can access the TEMPERATURE MSR */
> @@ -283,6 +287,7 @@ static int via_cputemp_down_prep(unsigned int cpu)
>  	{ X86_VENDOR_CENTAUR, 6, 0xa, }, /* C7 A */
>  	{ X86_VENDOR_CENTAUR, 6, 0xd, }, /* C7 D */
>  	{ X86_VENDOR_CENTAUR, 6, 0xf, }, /* Nano */
> +	{ X86_VENDOR_CENTAUR, 7, X86_MODEL_ANY, },
>  	{}
>  };
>  MODULE_DEVICE_TABLE(x86cpu, cputemp_ids);

      reply	other threads:[~2018-03-30 15:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-30  1:04 [PATCH v3] hwmon, via-cputem: support new centaur CPUs David Wang
2018-03-30 14:55 ` Guenter Roeck [this message]

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=20180330145540.GA13899@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=benjaminpan@viatech.com \
    --cc=brucechang@via-alliance.com \
    --cc=cooperyan@zhaoxin.com \
    --cc=davidwang@zhaoxin.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukelin@viacpu.com \
    --cc=mingo@redhat.com \
    --cc=qiyuanwang@zhaoxin.com \
    --cc=rafel.j.wysocki@intel.com \
    --cc=tglx@linutronix.de \
    --cc=timguo@zhaoxin.com \
    /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