From: Takashi Iwai <tiwai@suse.de>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, Lee Jones <lee.jones@linaro.org>,
Darren Hart <dvhart@infradead.org>,
Andy Shevchenko <andy@infradead.org>,
"Rafael J . Wysocki" <rjw@rjwysocki.net>,
Johannes Stezenbach <js@sig21.net>,
platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: [PATCH v2 3/3] ACPI / PMIC: Add opregion driver for Intel Dollar Cove TI PMIC
Date: Thu, 24 Aug 2017 12:03:14 +0200 [thread overview]
Message-ID: <s5hefs1l1ul.wl-tiwai@suse.de> (raw)
In-Reply-To: <s5hk21tl2w4.wl-tiwai@suse.de>
On Thu, 24 Aug 2017 11:40:43 +0200,
Takashi Iwai wrote:
>
> On Thu, 24 Aug 2017 11:14:53 +0200,
> Mika Westerberg wrote:
> >
> > On Thu, Aug 24, 2017 at 10:11:41AM +0200, Takashi Iwai wrote:
> > > This patch adds the opregion driver for Dollar Cove TI PMIC on Intel
> > > Cherry Trail devices. The patch is based on the original work by
> > > Intel, found at:
> > > https://github.com/01org/ProductionKernelQuilts
> > > with many cleanups and rewrites.
> > >
> > > The driver is currently provided only as built-in to follow other
> > > PMIC opregion drivers convention.
> > >
> > > The re-enumeration of devices at probe is required for fixing the
> > > issues on HP x2 210 G2. See bug#195689.
> > >
> > > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=193891
> > > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=195689
> > > Signed-off-by: Takashi Iwai <tiwai@suse.de>
> > > ---
> > > v1->v2:
> > > * get_raw_temp cleanup in opregion driver, mention about register
> > > endianess
> > >
> > > drivers/acpi/Kconfig | 6 ++
> > > drivers/acpi/Makefile | 1 +
> > > drivers/acpi/pmic/intel_pmic_dc_ti.c | 139 +++++++++++++++++++++++++++++++++++
> > > 3 files changed, 146 insertions(+)
> > > create mode 100644 drivers/acpi/pmic/intel_pmic_dc_ti.c
> > >
> > > diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
> > > index 1ce52f84dc23..9da8dcefde7b 100644
> > > --- a/drivers/acpi/Kconfig
> > > +++ b/drivers/acpi/Kconfig
> > > @@ -521,6 +521,12 @@ config CHT_WC_PMIC_OPREGION
> > > help
> > > This config adds ACPI operation region support for CHT Whiskey Cove PMIC.
> > >
> > > +config DC_TI_PMIC_OPREGION
> > > + bool "ACPI operation region support for Dollar Cove TI PMIC"
> > > + depends on INTEL_SOC_PMIC_DC_TI
> > > + help
> > > + This config adds ACPI operation region support for Dollar Cove TI PMIC.
> > > +
> > > endif
> > >
> > > config ACPI_CONFIGFS
> > > diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
> > > index b1aacfc62b1f..0a9008b971af 100644
> > > --- a/drivers/acpi/Makefile
> > > +++ b/drivers/acpi/Makefile
> > > @@ -103,6 +103,7 @@ obj-$(CONFIG_CRC_PMIC_OPREGION) += pmic/intel_pmic_crc.o
> > > obj-$(CONFIG_XPOWER_PMIC_OPREGION) += pmic/intel_pmic_xpower.o
> > > obj-$(CONFIG_BXT_WC_PMIC_OPREGION) += pmic/intel_pmic_bxtwc.o
> > > obj-$(CONFIG_CHT_WC_PMIC_OPREGION) += pmic/intel_pmic_chtwc.o
> > > +obj-$(CONFIG_DC_TI_PMIC_OPREGION) += pmic/intel_pmic_dc_ti.o
> > >
> > > obj-$(CONFIG_ACPI_CONFIGFS) += acpi_configfs.o
> > >
> > > diff --git a/drivers/acpi/pmic/intel_pmic_dc_ti.c b/drivers/acpi/pmic/intel_pmic_dc_ti.c
> > > new file mode 100644
> > > index 000000000000..a2be1270eeeb
> > > --- /dev/null
> > > +++ b/drivers/acpi/pmic/intel_pmic_dc_ti.c
> > > @@ -0,0 +1,139 @@
> > > +/*
> > > + * Dollar Cove TI PMIC operation region driver
> > > + * Copyright (C) 2014 Intel Corporation. All rights reserved.
> > > + *
> > > + * Rewritten and cleaned up
> > > + * Copyright (C) 2017 Takashi Iwai <tiwai@suse.de>
> > > + */
> > > +
> > > +#include <linux/acpi.h>
> > > +#include <linux/init.h>
> > > +#include <linux/mfd/intel_soc_pmic.h>
> > > +#include <linux/platform_device.h>
> > > +#include "intel_pmic.h"
> > > +
> > > +/* registers stored in 16bit BE (high:low, total 10bit) */
> > > +#define DC_TI_VBAT 0x54
> > > +#define DC_TI_DIETEMP 0x56
> > > +#define DC_TI_BPTHERM 0x58
> > > +#define DC_TI_GPADC 0x5a
> > > +
> > > +static struct pmic_table dc_ti_power_table[] = {
> >
> > const?
> >
> > > + { .address = 0x00, .reg = 0x41 },
> > > + { .address = 0x04, .reg = 0x42 },
> > > + { .address = 0x08, .reg = 0x43 },
> > > + { .address = 0x0c, .reg = 0x45 },
> > > + { .address = 0x10, .reg = 0x46 },
> > > + { .address = 0x14, .reg = 0x47 },
> > > + { .address = 0x18, .reg = 0x48 },
> > > + { .address = 0x1c, .reg = 0x49 },
> > > + { .address = 0x20, .reg = 0x4a },
> > > + { .address = 0x24, .reg = 0x4b },
> > > + { .address = 0x28, .reg = 0x4c },
> > > + { .address = 0x2c, .reg = 0x4d },
> > > + { .address = 0x30, .reg = 0x4e },
> > > +};
> > > +
> > > +static struct pmic_table dc_ti_thermal_table[] = {
> >
> > const?
>
> Oh yeah, I was too lazy. Will cover up in the next round.
It seems that power_table and thermal_table are non-const in the
definition. Also opregion_data is also passed as non-const to
intel_pmic_install_opregion_handler().
So only id_table[] can be const, so far.
(It's a good hint for further cleanup patches ;)
thanks,
Takashi
next prev parent reply other threads:[~2017-08-24 10:03 UTC|newest]
Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-24 8:11 [PATCH v2 0/3] Dollar Cove TI PMIC support for Intel Cherry Trail Takashi Iwai
2017-08-24 8:11 ` [PATCH v2 1/3] mfd: Add support for Cherry Trail Dollar Cove TI PMIC Takashi Iwai
2017-08-24 9:03 ` Mika Westerberg
2017-08-24 9:17 ` Andy Shevchenko
2017-09-04 13:37 ` Lee Jones
2017-09-04 13:50 ` Takashi Iwai
2017-09-05 7:25 ` Lee Jones
2017-09-05 7:41 ` Takashi Iwai
2017-09-05 8:14 ` Lee Jones
2017-08-24 8:11 ` [PATCH v2 2/3] platform/x86: Add support for Dollar Cove TI power button Takashi Iwai
2017-08-24 9:07 ` Mika Westerberg
2017-08-24 9:20 ` Andy Shevchenko
2017-08-24 9:45 ` Takashi Iwai
2017-08-24 11:47 ` Andy Shevchenko
2017-09-07 11:41 ` [PATCH v5 1/3] mfd: Add support for Cherry Trail Dollar Cove TI PMIC Takashi Iwai
2017-09-07 12:28 ` Lee Jones
2017-09-07 12:48 ` Takashi Iwai
2017-09-07 13:00 ` Lee Jones
2017-09-07 13:30 ` Takashi Iwai
2017-09-07 14:13 ` Lee Jones
2017-08-24 8:11 ` [PATCH v2 3/3] ACPI / PMIC: Add opregion driver for Intel " Takashi Iwai
2017-08-24 9:14 ` Mika Westerberg
2017-08-24 9:40 ` Takashi Iwai
2017-08-24 10:03 ` Takashi Iwai [this message]
2017-08-24 9:23 ` Andy Shevchenko
2017-08-24 9:43 ` Takashi Iwai
2017-08-24 9:27 ` [PATCH v2 0/3] Dollar Cove TI PMIC support for Intel Cherry Trail Andy Shevchenko
2017-08-24 9:38 ` Takashi Iwai
2017-09-04 14:43 [PATCH v5 " Takashi Iwai
2017-09-04 14:43 ` [PATCH v5 1/3] mfd: Add support for Cherry Trail Dollar Cove TI PMIC Takashi Iwai
2017-09-05 7:24 ` Lee Jones
2017-09-05 7:46 ` Takashi Iwai
2017-09-05 8:00 ` Hans de Goede
2017-09-05 8:11 ` Lee Jones
2017-09-05 8:12 ` Takashi Iwai
2017-09-05 8:10 ` Lee Jones
2017-09-05 8:20 ` Takashi Iwai
2017-09-05 8:53 ` Lee Jones
2017-09-05 9:38 ` Takashi Iwai
2017-09-05 10:31 ` Rafael J. Wysocki
2017-09-06 7:58 ` Lee Jones
2017-09-06 10:09 ` Rafael J. Wysocki
2017-09-06 10:47 ` Lee Jones
2017-09-06 10:52 ` Lee Jones
2017-09-06 22:19 ` Rafael J. Wysocki
2017-09-07 7:39 ` Lee Jones
2017-09-07 10:52 ` Rafael J. Wysocki
2017-09-07 11:07 ` Mika Westerberg
2017-09-07 10:59 ` Rafael J. Wysocki
2017-09-07 11:13 ` Lee Jones
2017-09-06 7:54 ` Lee Jones
2017-09-06 8:23 ` Takashi Iwai
2017-09-06 9:05 ` Lee Jones
2017-09-06 10:06 ` Takashi Iwai
2017-09-06 10:21 ` Rafael J. Wysocki
2017-09-06 10:50 ` Lee Jones
2017-09-06 10:40 ` Lee Jones
2017-09-06 10:58 ` Takashi Iwai
2017-09-06 11:01 ` Rafael J. Wysocki
2017-09-06 13:51 ` Lee Jones
2017-09-06 14:34 ` Takashi Iwai
2017-09-06 14:54 ` Lee Jones
2017-09-06 15:02 ` Takashi Iwai
2017-09-05 8:54 ` Lee Jones
2017-09-07 9:32 ` Takashi Iwai
2017-09-07 10:53 ` Lee Jones
2017-09-07 10:59 ` Rafael J. Wysocki
2017-09-07 11:17 ` Lee Jones
2017-09-07 11:44 ` Takashi Iwai
2017-09-07 12:24 ` Lee Jones
2017-09-07 13:11 ` Takashi Iwai
2017-09-07 13:22 ` Lee Jones
2017-09-07 8:00 ` Lee Jones
2017-09-04 14:43 ` [PATCH v5 2/3] platform/x86: Add support for Dollar Cove TI power button Takashi Iwai
2017-09-04 14:43 ` [PATCH v5 3/3] ACPI / PMIC: Add opregion driver for Intel Dollar Cove TI PMIC Takashi Iwai
2017-09-07 8:00 ` Lee Jones
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=s5hefs1l1ul.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=andy@infradead.org \
--cc=dvhart@infradead.org \
--cc=js@sig21.net \
--cc=lee.jones@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rjw@rjwysocki.net \
/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;
as well as URLs for NNTP newsgroup(s).