From: Guenter Roeck <guenter.roeck@ericsson.com>
To: Matthew Garrett <mjg@redhat.com>
Cc: "rydberg@euromail.se" <rydberg@euromail.se>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"lm-sensors@lm-sensors.org" <lm-sensors@lm-sensors.org>
Subject: Re: [PATCH 1/2] applesmc: Use PnP rather than hardcoding resources and devices
Date: Fri, 17 Dec 2010 14:16:18 -0800 [thread overview]
Message-ID: <20101217221618.GA13207@ericsson.com> (raw)
In-Reply-To: <1292623106-31684-1-git-send-email-mjg@redhat.com>
On Fri, Dec 17, 2010 at 04:58:25PM -0500, Matthew Garrett wrote:
> The AppleSMC device is described in ACPI, including a list of its resources.
> We should use those rather than hardcoding the ports. A side-effect is that
> we can then remove the DMI matching, since there's a unique identifier to
> indicate that the machine has one of these devices.
>
> Signed-off-by: Matthew Garrett <mjg@redhat.com>
> ---
> drivers/hwmon/applesmc.c | 182 ++++++++++++++++++++++------------------------
> 1 files changed, 86 insertions(+), 96 deletions(-)
>
> diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
> index ce0372f..6c98b60 100644
> --- a/drivers/hwmon/applesmc.c
> +++ b/drivers/hwmon/applesmc.c
> @@ -30,7 +30,6 @@
> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>
> #include <linux/delay.h>
> -#include <linux/platform_device.h>
> #include <linux/input-polldev.h>
> #include <linux/kernel.h>
> #include <linux/slab.h>
> @@ -43,11 +42,13 @@
> #include <linux/leds.h>
> #include <linux/hwmon.h>
> #include <linux/workqueue.h>
> +#include <linux/slab.h>
> +#include <linux/pnp.h>
>
> /* data port used by Apple SMC */
> -#define APPLESMC_DATA_PORT 0x300
> +#define APPLESMC_DATA_PORT 0x0
> /* command/status port used by Apple SMC */
> -#define APPLESMC_CMD_PORT 0x304
> +#define APPLESMC_CMD_PORT 0x4
>
> #define APPLESMC_NR_PORTS 32 /* 0x300-0x31f */
>
> @@ -76,6 +77,8 @@
> #define MOTION_SENSOR_Z_KEY "MO_Z" /* r-o sp78 (2 bytes) */
> #define MOTION_SENSOR_KEY "MOCN" /* r/w ui16 */
>
> +#define NOTIFICATION_KEY "NTOK"
> +
> #define FANS_COUNT "FNum" /* r-o ui8 */
> #define FANS_MANUAL "FS! " /* r-w ui16 */
> #define FAN_ID_FMT "F%dID" /* r-o char[16] */
> @@ -103,6 +106,14 @@ static const char *const fan_speed_fmt[] = {
> #define to_index(attr) (to_sensor_dev_attr(attr)->index & 0xffff)
> #define to_option(attr) (to_sensor_dev_attr(attr)->index >> 16)
>
> +struct applesmc_pnp_device {
> + int iobase;
> + int iolen;
> +};
> +
> +struct pnp_dev *pdev;
> +struct applesmc_pnp_device *apple_pnp_device;
> +
Those variables are still global.
Guenter
next prev parent reply other threads:[~2010-12-17 22:17 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-16 15:33 [PATCH 1/2] applesmc: Use PnP rather than hardcoding resources and devices Matthew Garrett
2010-12-16 15:33 ` [PATCH 2/2] applesmc: Perform some more sanity checking on temperatures Matthew Garrett
2010-12-16 16:48 ` [PATCH 1/2] applesmc: Use PnP rather than hardcoding resources and devices Henrik Rydberg
2010-12-16 17:00 ` Matthew Garrett
2010-12-16 17:00 ` [lm-sensors] " Guenter Roeck
2010-12-17 21:57 ` Matthew Garrett
2010-12-17 21:58 ` Matthew Garrett
2010-12-17 22:16 ` Guenter Roeck [this message]
2010-12-17 22:22 ` Matthew Garrett
2010-12-17 22:24 ` [PATCH 1/2 V3] " Matthew Garrett
2010-12-18 4:23 ` Guenter Roeck
2010-12-18 9:07 ` Henrik Rydberg
2010-12-18 14:40 ` Matthew Garrett
2010-12-18 15:31 ` Henrik Rydberg
2010-12-18 9:37 ` Henrik Rydberg
2010-12-18 10:09 ` [lm-sensors] " Jean Delvare
2010-12-18 10:31 ` Henrik Rydberg
2010-12-18 11:29 ` Julien BLACHE
2010-12-18 11:57 ` Henrik Rydberg
2010-12-20 13:44 ` Mikael Ström
2010-12-20 13:57 ` Jean Delvare
2010-12-20 14:23 ` Henrik Rydberg
2010-12-20 14:28 ` Matthew Garrett
2010-12-20 15:06 ` Henrik Rydberg
2010-12-20 15:12 ` Matthew Garrett
2010-12-20 15:37 ` Henrik Rydberg
2010-12-20 14:00 ` Matthew Garrett
2010-12-21 6:04 ` Mikael Ström
2010-12-21 11:09 ` Julien BLACHE
2010-12-18 14:43 ` Matthew Garrett
2010-12-18 15:30 ` Henrik Rydberg
2010-12-18 15:39 ` Matthew Garrett
2010-12-17 22:24 ` [PATCH 2/2 V3] applesmc: Perform some more sanity checking on temperatures Matthew Garrett
2010-12-17 21:58 ` [PATCH 2/2] " Matthew Garrett
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=20101217221618.GA13207@ericsson.com \
--to=guenter.roeck@ericsson.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lm-sensors@lm-sensors.org \
--cc=mjg@redhat.com \
--cc=rydberg@euromail.se \
/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