mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Atharva Tiwari <atharvatiwarilinuxdev@gmail.com>
Cc: "Bjorn Helgaas" <bhelgaas@google.com>,
	"Thomas Gleixner" <tglx@kernel.org>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"Len Brown" <lenb@kernel.org>,
	"Linus Walleij" <linusw@kernel.org>,
	"Bartosz Golaszewski" <brgl@kernel.org>,
	"Sven Peter" <sven@kernel.org>, "Janne Grunau" <j@jannau.net>,
	"Neal Gompa" <neal@gompa.dev>,
	"Guenter Roeck" <linux@roeck-us.net>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>, "Lee Jones" <lee@kernel.org>,
	"Pavel Machek" <pavel@kernel.org>,
	"Griffin Kroah-Hartman" <griffin@kroah.com>,
	"Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Sebastian Reichel" <sre@kernel.org>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Wim Van Sebroeck" <wim@linux-watchdog.org>,
	"Jarkko Sakkinen" <jarkko@kernel.org>,
	"Mimi Zohar" <zohar@linux.ibm.com>,
	"Roberto Sassu" <roberto.sassu@huawei.com>,
	"Dmitry Kasatkin" <dmitry.kasatkin@gmail.com>,
	"Eric Snowberg" <eric.snowberg@oracle.com>,
	"Paul Moore" <paul@paul-moore.com>,
	"James Morris" <jmorris@namei.org>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-acpi@vger.kernel.org, linux-gpio@vger.kernel.org,
	asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-hwmon@vger.kernel.org, linux-iio@vger.kernel.org,
	linux-leds@vger.kernel.org, mfd@lists.linux.dev,
	platform-driver-x86@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-rtc@vger.kernel.org, linux-watchdog@vger.kernel.org,
	linux-integrity@vger.kernel.org, keyrings@vger.kernel.org,
	linux-security-module@vger.kernel.org
Subject: Re: [RFC PATCH 00/14] Add macsmc support for Intel Macs, replacing applesmc
Date: Sun, 1 Nov 2026 01:07:37 +0000	[thread overview]
Message-ID: <20261101010737.203951cd@jic23-hlaptop> (raw)
In-Reply-To: <20261029085504.3547-1-atharvatiwarilinuxdev@gmail.com>

On Thu, 29 Oct 2026 04:51:57 -0400
Atharva Tiwari <atharvatiwarilinuxdev@gmail.com> wrote:

> applesmc is very old, and all of its code is lumped into one
> driver. Fan control, sensors, the light sensor, the motion
> sensor and the keyboard backlight in a single file
> with its own way of talking to the SMC. It is hard to extend
> and to support new machines.
> 
> This series adds Intel Mac support to the macsmc drivers that
> were written for Apple Silicon (the Asahi implementation).
> The SMC works the same way on both platforms, so we share a
> lot of code with Asahi. Only the way of talking to the SMC
> differs.
> 
> To make that work, patch 1 splits the macsmc driver into a
> common core and a backend. The existing RTKit code moves into
> its own backend. Patch 2 adds an ACPI backend for Intel Macs
> with I/O port, MMIO and interrupt support. After that, each
> function gets its own small driver using the standard kernel
> interfaces (hwmon, IIO, LEDs, power supply, RTC, watchdog),
> instead of one large driver doing everything.

Are we looking at ABI changes as a result of this? That
tends to happen with split ups of unified drivers and mapping
them to more standard kernel subsystems.

What is the plan to handle them if so?

Thanks,

Jonathan

> 
> On Intel Macs these drivers replace applesmc (hwmon, light
> sensor, motion sensor and keyboard backlight) and acpi-sbs
> (battery and adapter). They are mutually exclusive with the
> drivers they replace, so only one is used at a time.
> 
> This is an RFC to get early feedback on the design. The macsmc
> split and the Intel Mac backend touch fundamental parts, so I
> would rather change them now if maintainers ask. After that I
> will test the series on more macsand send it upstream as a
> proper series.
> 
> The series is organised as follows:
> 
>   1      Split macsmc into a core and backends
>   2      ACPI backend for Intel Macs
>   3-6    New drivers: watchdog, IIO light and accelerometer,
>          keyboard backlight LED
>   7-9    RTC support for T2 Macs, a T2 detection flag, and
>          disabling the broken ACPI RTCs
>   10-11  Power supply support, replacing acpi-sbs
>   12-13  hwmon support for Intel Macs
>   14     ioctl for userspace access to SMC keys
> 
> 
> Tested-on: MacBookPro16,1 , iMac20,1 , MacBookAir4,2 , MacBookPro12,1 ,
> MacBookPro15,1
> 
> NOTE: Almost all drivers have been tested except the motion sensor
> driver as i was not able to find any device that had one.
> 
> Atharva Tiwari (14):
>   treewide: Add backend for macsmc
>   platform/x86: add backend for macsmc in intel macs
>   watchdog: add driver for apple smc
>   iio/light: add new driver for macsmc
>   iio/accel: add driver for apple SMS
>   leds: add support for macsmc kbl
>   rtc: add support for x86 macs in macsmc-rtc
>   treewide: Add a flag to detect the Apple T2 chip
>   treewide: disable other rtc's in t2 macs
>   power/supply: add support for x86 macs in macsmc-power
>   acpi: disable battery and adapter for x86 apple machines
>   hwmon/macsmc: add more types
>   hwmon: add support for x86 macs in macsmc-hwmon
>   mfd/macsmc: add ioctl to access smc keys
> 
>  MAINTAINERS                                   |    2 +-
>  arch/x86/kernel/quirks.c                      |   37 +
>  drivers/acpi/acpi_tad.c                       |    4 +
>  drivers/acpi/sbs.c                            |   17 +-
>  drivers/acpi/x86/utils.c                      |    4 +
>  drivers/gpio/Kconfig                          |    2 +-
>  drivers/gpio/gpio-macsmc.c                    |   13 +-
>  drivers/hwmon/Kconfig                         |    7 +-
>  drivers/hwmon/macsmc-hwmon.c                  | 1126 ++++++++++++++++-
>  drivers/iio/accel/Kconfig                     |   10 +
>  drivers/iio/accel/Makefile                    |    1 +
>  drivers/iio/accel/macsmc-accel.c              |  248 ++++
>  drivers/iio/light/Kconfig                     |   11 +
>  drivers/iio/light/Makefile                    |    1 +
>  drivers/iio/light/macsmc-light.c              |  189 +++
>  drivers/leds/Kconfig                          |   11 +
>  drivers/leds/Makefile                         |    1 +
>  drivers/leds/leds-macsmc.c                    |   69 +
>  drivers/mfd/Kconfig                           |   15 +-
>  drivers/mfd/Makefile                          |    2 +-
>  drivers/mfd/macsmc-core.c                     |  362 ++++++
>  drivers/platform/x86/Kconfig                  |   10 +
>  drivers/platform/x86/Makefile                 |    1 +
>  drivers/platform/x86/macsmc-acpi.c            |  642 ++++++++++
>  drivers/power/reset/Kconfig                   |    2 +-
>  drivers/power/supply/Kconfig                  |    2 +-
>  drivers/power/supply/macsmc-power.c           |  751 ++++++++---
>  drivers/rtc/Kconfig                           |    2 +-
>  drivers/rtc/rtc-cmos.c                        |    4 +
>  drivers/rtc/rtc-macsmc.c                      |  126 +-
>  drivers/soc/apple/Kconfig                     |   14 +
>  drivers/soc/apple/Makefile                    |    2 +
>  .../macsmc.c => soc/apple/macsmc-rtkit.c}     |  185 ++-
>  drivers/watchdog/Kconfig                      |   11 +
>  drivers/watchdog/Makefile                     |    2 +-
>  drivers/watchdog/macsmc_wdt.c                 |  140 ++
>  include/linux/mfd/macsmc.h                    |  104 +-
>  include/linux/platform_data/x86/apple.h       |    5 +
>  .../platform_certs/keyring_handler.h          |    8 -
>  security/integrity/platform_certs/load_uefi.c |   38 +-
>  40 files changed, 3786 insertions(+), 395 deletions(-)
>  create mode 100644 drivers/iio/accel/macsmc-accel.c
>  create mode 100644 drivers/iio/light/macsmc-light.c
>  create mode 100644 drivers/leds/leds-macsmc.c
>  create mode 100644 drivers/mfd/macsmc-core.c
>  create mode 100644 drivers/platform/x86/macsmc-acpi.c
>  rename drivers/{mfd/macsmc.c => soc/apple/macsmc-rtkit.c} (70%)
>  create mode 100644 drivers/watchdog/macsmc_wdt.c
> 


      parent reply	other threads:[~2026-11-01  1:07 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29  8:51 Atharva Tiwari
2026-10-29  8:51 ` [RFC PATCH 01/14] treewide: Add backend for macsmc Atharva Tiwari
2026-10-29  8:51 ` [RFC PATCH 02/14] platform/x86: add backend for macsmc in intel macs Atharva Tiwari
2026-10-29 12:59   ` Ilpo Järvinen
2026-10-29  8:52 ` [RFC PATCH 03/14] watchdog: add driver for apple smc Atharva Tiwari
2026-10-29 13:30   ` Andy Shevchenko
2026-10-29  8:52 ` [RFC PATCH 04/14] iio/light: add new driver for macsmc Atharva Tiwari
2026-11-01  1:28   ` Jonathan Cameron
2026-10-29  8:52 ` [RFC PATCH 05/14] iio/accel: add driver for apple SMS Atharva Tiwari
2026-11-01  1:35   ` Jonathan Cameron
2026-10-29  8:52 ` [RFC PATCH 06/14] leds: add support for macsmc kbl Atharva Tiwari
2026-10-29  8:52 ` [RFC PATCH 07/14] rtc: add support for x86 macs in macsmc-rtc Atharva Tiwari
2026-10-29  8:52 ` [RFC PATCH 08/14] treewide: Add a flag to detect the Apple T2 chip Atharva Tiwari
2026-10-29  8:52 ` [RFC PATCH 09/14] treewide: disable other rtc's in t2 macs Atharva Tiwari
2026-10-29  8:52 ` [RFC PATCH 10/14] power/supply: add support for x86 macs in macsmc-power Atharva Tiwari
2026-10-29  8:52 ` [RFC PATCH 11/14] acpi: disable battery and adapter for x86 apple machines Atharva Tiwari
2026-10-29  8:52 ` [RFC PATCH 12/14] hwmon/macsmc: add more types Atharva Tiwari
2026-10-29  8:52 ` [RFC PATCH 13/14] hwmon: add support for x86 macs in macsmc-hwmon Atharva Tiwari
2026-10-29  8:52 ` [RFC PATCH 14/14] mfd/macsmc: add ioctl to access smc keys Atharva Tiwari
2026-10-29  9:22   ` Sasha Finkelstein
2026-10-29 14:39     ` Atharva Tiwari
2026-10-29 14:53       ` Sasha Finkelstein
2026-10-29 15:25         ` Aditya Garg
2026-10-29 15:42           ` Sasha Finkelstein
2026-11-01  1:38   ` Jonathan Cameron
2026-11-01  1:07 ` Jonathan Cameron [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=20261101010737.203951cd@jic23-hlaptop \
    --to=jic23@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andy@kernel.org \
    --cc=asahi@lists.linux.dev \
    --cc=atharvatiwarilinuxdev@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=bp@alien8.de \
    --cc=brgl@kernel.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=dlechner@baylibre.com \
    --cc=dmitry.kasatkin@gmail.com \
    --cc=eric.snowberg@oracle.com \
    --cc=griffin@kroah.com \
    --cc=hansg@kernel.org \
    --cc=hpa@zytor.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=j@jannau.net \
    --cc=jarkko@kernel.org \
    --cc=jmorris@namei.org \
    --cc=keyrings@vger.kernel.org \
    --cc=lee@kernel.org \
    --cc=lenb@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mfd@lists.linux.dev \
    --cc=mingo@redhat.com \
    --cc=neal@gompa.dev \
    --cc=nuno.sa@analog.com \
    --cc=paul@paul-moore.com \
    --cc=pavel@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=roberto.sassu@huawei.com \
    --cc=serge@hallyn.com \
    --cc=sre@kernel.org \
    --cc=sven@kernel.org \
    --cc=tglx@kernel.org \
    --cc=wim@linux-watchdog.org \
    --cc=x86@kernel.org \
    --cc=zohar@linux.ibm.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

all inboxes | Powered by JetHome®