From: Dave Jones <davej@redhat.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] I2C: automatic VRM detection part1
Date: Tue, 24 Aug 2004 11:43:25 +0100 [thread overview]
Message-ID: <20040824104325.GA28237@redhat.com> (raw)
In-Reply-To: <200408232328.i7NNSSkW027208@hera.kernel.org>
On Thu, Aug 05, 2004 at 11:38:57PM +0000, Linux Kernel wrote:
> diff -Nru a/drivers/i2c/i2c-sensor-vid.c b/drivers/i2c/i2c-sensor-vid.c
> --- /dev/null Wed Dec 31 16:00:00 196900
> +++ b/drivers/i2c/i2c-sensor-vid.c 2004-08-23 16:28:37 -07:00
> @@ -0,0 +1,99 @@
....
> +#ifdef CONFIG_X86
> +
> +static struct vrm_model vrm_models[] = {
> + {X86_VENDOR_AMD, 0x6, ANY, 90}, /* Athlon Duron etc */
This is insufficient afaics. Mobile Athlon's/Durons will have
a different VRM to the desktop parts.
> + {X86_VENDOR_AMD, 0xF, 0x4, 90}, /* Athlon 64 */
possible the same here.
> + {X86_VENDOR_INTEL, 0x6, 0xB, 85}, /* 0xB Tualatin */
again, mobile parts may match this.
> + {X86_VENDOR_INTEL, 0x6, ANY, 82}, /* any P6 */
definitly here.
> + {X86_VENDOR_INTEL, 0x7, ANY, 0}, /* Itanium */
huh? Under ifdef CONFIG_X86 ?
> + {X86_VENDOR_INTEL, 0x10,ANY, 0}, /* Itanium 2 */
ditto.
> +
> +int i2c_which_vrm(void)
> +{
> + struct cpuinfo_x86 *c = cpu_data;
> + u32 eax;
> + u8 eff_family, eff_model;
> + int vrm_ret;
> +
> + if (c->x86 < 6) return 0; /* any CPU with familly lower than 6
> + dont have VID and/or CPUID */
1. CodingStyle dictates
if (c->x86 < 6)
return 0;
2. Typo in 'familly'
> + eax = cpuid_eax(1);
> + eff_family = ((eax & 0x00000F00)>>8);
> + eff_model = ((eax & 0x000000F0)>>4);
> + if (eff_family == 0xF) { /* use extended model & family */
> + eff_family += ((eax & 0x00F00000)>>20);
> + eff_model += ((eax & 0x000F0000)>>16)<<4;
> + }
Is this guaranteed safe on all vendors ?
> +/* and now something completely different for Non-x86 world*/
> +#else
> +int i2c_which_vrm(void)
> +{
> + printk(KERN_INFO "i2c-sensor.o: Unknown VRM version of your CPU\n");
> + return 0;
> +}
> +#endif
why build this at all on non-x86 if its useless ?
Dave
parent reply other threads:[~2004-08-24 10:43 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <200408232328.i7NNSSkW027208@hera.kernel.org>]
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=20040824104325.GA28237@redhat.com \
--to=davej@redhat.com \
--cc=linux-kernel@vger.kernel.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