From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org ([198.145.29.99]:58420 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726622AbeG3Xr3 (ORCPT ); Mon, 30 Jul 2018 19:47:29 -0400 MIME-Version: 1.0 References: <20180723214751.1733-1-jae.hyun.yoo@linux.intel.com> <20180723214751.1733-9-jae.hyun.yoo@linux.intel.com> <20180727082611.GE4628@dell> In-Reply-To: From: Rob Herring Date: Mon, 30 Jul 2018 16:10:13 -0600 Message-ID: Subject: Re: [PATCH v7 08/12] mfd: intel-peci-client: Add PECI client MFD driver To: Jae Hyun Yoo Cc: Lee Jones , Jean Delvare , Guenter Roeck , Mark Rutland , Joel Stanley , Andrew Jeffery , Jonathan Corbet , Greg Kroah-Hartman , Gustavo Pimentel , Kishon Vijay Abraham I , Lorenzo Pieralisi , darrick.wong@oracle.com, sandeen@redhat.com, Arnd Bergmann , Wu Hao , kusumi.tomohiro@gmail.com, bryantly@linux.vnet.ibm.com, fbarrat@linux.vnet.ibm.com, David Miller , Mauro Carvalho Chehab , Andrew Morton , Randy Dunlap , Philippe Ombredanne , Vinod , Stephen Boyd , david.kershner@unisys.com, =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Sagar Dharia , Johan Hovold , Thomas Gleixner , jgross@suse.com, Cyrille Pitchen , Linux HWMON List , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , linux-aspeed@lists.ozlabs.org, Linux Doc Mailing List , OpenBMC Maillist , James Feist , Jason M Biils , Vernon Mauery Content-Type: text/plain; charset="UTF-8" Sender: linux-hwmon-owner@vger.kernel.org List-Id: linux-hwmon@vger.kernel.org On Fri, Jul 27, 2018 at 11:36 AM Jae Hyun Yoo wrote: > > Hi Lee, > > On 7/27/2018 1:26 AM, Lee Jones wrote: > > On Mon, 23 Jul 2018, Jae Hyun Yoo wrote: > > > >> This commit adds PECI client MFD driver. > >> > >> Signed-off-by: Jae Hyun Yoo > >> Cc: Lee Jones > >> Cc: Rob Herring > >> Cc: Andrew Jeffery > >> Cc: James Feist > >> Cc: Jason M Biils > >> Cc: Joel Stanley > >> Cc: Vernon Mauery > >> --- > >> drivers/mfd/Kconfig | 14 ++ > >> drivers/mfd/Makefile | 1 + > >> drivers/mfd/intel-peci-client.c | 182 ++++++++++++++++++++++++++ > >> include/linux/mfd/intel-peci-client.h | 81 ++++++++++++ > >> 4 files changed, 278 insertions(+) > >> create mode 100644 drivers/mfd/intel-peci-client.c > >> create mode 100644 include/linux/mfd/intel-peci-client.h > >> > >> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig > >> index f3fa516011ec..e38b591479d4 100644 > >> --- a/drivers/mfd/Kconfig > >> +++ b/drivers/mfd/Kconfig > >> @@ -595,6 +595,20 @@ config MFD_INTEL_MSIC > >> Passage) chip. This chip embeds audio, battery, GPIO, etc. > >> devices used in Intel Medfield platforms. > >> > >> +config MFD_INTEL_PECI_CLIENT > >> + bool "Intel PECI client" > >> + depends on (PECI || COMPILE_TEST) > >> + select MFD_CORE > >> + help > >> + If you say yes to this option, support will be included for the > >> + multi-funtional Intel PECI (Platform Environment Control Interface) > >> + client. PECI is a one-wire bus interface that provides a communication > >> + channel from PECI clients in Intel processors and chipset components > >> + to external monitoring or control devices. > >> + > >> + Additional drivers must be enabled in order to use the functionality > >> + of the device. > >> + > >> config MFD_IPAQ_MICRO > >> bool "Atmel Micro ASIC (iPAQ h3100/h3600/h3700) Support" > >> depends on SA1100_H3100 || SA1100_H3600 > >> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile > >> index 2852a6042ecf..29e2cacc58bd 100644 > >> --- a/drivers/mfd/Makefile > >> +++ b/drivers/mfd/Makefile > >> @@ -203,6 +203,7 @@ obj-$(CONFIG_MFD_INTEL_LPSS) += intel-lpss.o > >> obj-$(CONFIG_MFD_INTEL_LPSS_PCI) += intel-lpss-pci.o > >> obj-$(CONFIG_MFD_INTEL_LPSS_ACPI) += intel-lpss-acpi.o > >> obj-$(CONFIG_MFD_INTEL_MSIC) += intel_msic.o > >> +obj-$(CONFIG_MFD_INTEL_PECI_CLIENT) += intel-peci-client.o > >> obj-$(CONFIG_MFD_PALMAS) += palmas.o > >> obj-$(CONFIG_MFD_VIPERBOARD) += viperboard.o > >> obj-$(CONFIG_MFD_RC5T583) += rc5t583.o rc5t583-irq.o > >> diff --git a/drivers/mfd/intel-peci-client.c b/drivers/mfd/intel-peci-client.c > >> new file mode 100644 > >> index 000000000000..d7702cf1ea50 > >> --- /dev/null > >> +++ b/drivers/mfd/intel-peci-client.c > >> @@ -0,0 +1,182 @@ > >> +// SPDX-License-Identifier: GPL-2.0 > >> +// Copyright (c) 2018 Intel Corporation > >> + > >> +#include > >> +#include > >> +#include > >> +#include > >> +#include > >> +#include > >> + > >> +enum cpu_gens { > >> + CPU_GEN_HSX = 0, /* Haswell Xeon */ > >> + CPU_GEN_BRX, /* Broadwell Xeon */ > >> + CPU_GEN_SKX, /* Skylake Xeon */ > >> +}; > >> + > >> +static struct mfd_cell peci_functions[] = { > >> + { > >> + .name = "peci-cputemp", > >> + .of_compatible = "intel,peci-cputemp", > >> + }, > >> + { > >> + .name = "peci-dimmtemp", > >> + .of_compatible = "intel,peci-dimmtemp", > >> + }, > >> +}; > > > > The more I look at this driver, the less I think it fits into MFD. > > > > What's stopping you from registering these devices directly from DT? > > > > Because DT doesn't allow 2 nodes at the same address so Rob suggested > MFD for this case. Only after I first suggested you create cpu and dimm sensors from a single hwmon driver. Perhaps you should figure out how to fix the problem with delayed registration. Perhaps you can register the sensor, but just delay returning actual data until it is ready. Rob From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rob Herring Subject: Re: [PATCH v7 08/12] mfd: intel-peci-client: Add PECI client MFD driver Date: Mon, 30 Jul 2018 16:10:13 -0600 Message-ID: References: <20180723214751.1733-1-jae.hyun.yoo@linux.intel.com> <20180723214751.1733-9-jae.hyun.yoo@linux.intel.com> <20180727082611.GE4628@dell> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Jae Hyun Yoo Cc: Lee Jones , Jean Delvare , Guenter Roeck , Mark Rutland , Joel Stanley , Andrew Jeffery , Jonathan Corbet , Greg Kroah-Hartman , Gustavo Pimentel , Kishon Vijay Abraham I , Lorenzo Pieralisi , darrick.wong@oracle.com, sandeen@redhat.com, Arnd Bergmann , Wu Hao , kusumi.tomohiro@gmail.com, bryantly@linux.vnet.ibm.com, fbarrat@linux.vnet.ibm.com, David Miller , Mauro Carvalho Chehab , Andrew Morton , Randy Dunlap List-Id: devicetree@vger.kernel.org On Fri, Jul 27, 2018 at 11:36 AM Jae Hyun Yoo wrote: > > Hi Lee, > > On 7/27/2018 1:26 AM, Lee Jones wrote: > > On Mon, 23 Jul 2018, Jae Hyun Yoo wrote: > > > >> This commit adds PECI client MFD driver. > >> > >> Signed-off-by: Jae Hyun Yoo > >> Cc: Lee Jones > >> Cc: Rob Herring > >> Cc: Andrew Jeffery > >> Cc: James Feist > >> Cc: Jason M Biils > >> Cc: Joel Stanley > >> Cc: Vernon Mauery > >> --- > >> drivers/mfd/Kconfig | 14 ++ > >> drivers/mfd/Makefile | 1 + > >> drivers/mfd/intel-peci-client.c | 182 ++++++++++++++++++++++++++ > >> include/linux/mfd/intel-peci-client.h | 81 ++++++++++++ > >> 4 files changed, 278 insertions(+) > >> create mode 100644 drivers/mfd/intel-peci-client.c > >> create mode 100644 include/linux/mfd/intel-peci-client.h > >> > >> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig > >> index f3fa516011ec..e38b591479d4 100644 > >> --- a/drivers/mfd/Kconfig > >> +++ b/drivers/mfd/Kconfig > >> @@ -595,6 +595,20 @@ config MFD_INTEL_MSIC > >> Passage) chip. This chip embeds audio, battery, GPIO, etc. > >> devices used in Intel Medfield platforms. > >> > >> +config MFD_INTEL_PECI_CLIENT > >> + bool "Intel PECI client" > >> + depends on (PECI || COMPILE_TEST) > >> + select MFD_CORE > >> + help > >> + If you say yes to this option, support will be included for the > >> + multi-funtional Intel PECI (Platform Environment Control Interface) > >> + client. PECI is a one-wire bus interface that provides a communication > >> + channel from PECI clients in Intel processors and chipset components > >> + to external monitoring or control devices. > >> + > >> + Additional drivers must be enabled in order to use the functionality > >> + of the device. > >> + > >> config MFD_IPAQ_MICRO > >> bool "Atmel Micro ASIC (iPAQ h3100/h3600/h3700) Support" > >> depends on SA1100_H3100 || SA1100_H3600 > >> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile > >> index 2852a6042ecf..29e2cacc58bd 100644 > >> --- a/drivers/mfd/Makefile > >> +++ b/drivers/mfd/Makefile > >> @@ -203,6 +203,7 @@ obj-$(CONFIG_MFD_INTEL_LPSS) += intel-lpss.o > >> obj-$(CONFIG_MFD_INTEL_LPSS_PCI) += intel-lpss-pci.o > >> obj-$(CONFIG_MFD_INTEL_LPSS_ACPI) += intel-lpss-acpi.o > >> obj-$(CONFIG_MFD_INTEL_MSIC) += intel_msic.o > >> +obj-$(CONFIG_MFD_INTEL_PECI_CLIENT) += intel-peci-client.o > >> obj-$(CONFIG_MFD_PALMAS) += palmas.o > >> obj-$(CONFIG_MFD_VIPERBOARD) += viperboard.o > >> obj-$(CONFIG_MFD_RC5T583) += rc5t583.o rc5t583-irq.o > >> diff --git a/drivers/mfd/intel-peci-client.c b/drivers/mfd/intel-peci-client.c > >> new file mode 100644 > >> index 000000000000..d7702cf1ea50 > >> --- /dev/null > >> +++ b/drivers/mfd/intel-peci-client.c > >> @@ -0,0 +1,182 @@ > >> +// SPDX-License-Identifier: GPL-2.0 > >> +// Copyright (c) 2018 Intel Corporation > >> + > >> +#include > >> +#include > >> +#include > >> +#include > >> +#include > >> +#include > >> + > >> +enum cpu_gens { > >> + CPU_GEN_HSX = 0, /* Haswell Xeon */ > >> + CPU_GEN_BRX, /* Broadwell Xeon */ > >> + CPU_GEN_SKX, /* Skylake Xeon */ > >> +}; > >> + > >> +static struct mfd_cell peci_functions[] = { > >> + { > >> + .name = "peci-cputemp", > >> + .of_compatible = "intel,peci-cputemp", > >> + }, > >> + { > >> + .name = "peci-dimmtemp", > >> + .of_compatible = "intel,peci-dimmtemp", > >> + }, > >> +}; > > > > The more I look at this driver, the less I think it fits into MFD. > > > > What's stopping you from registering these devices directly from DT? > > > > Because DT doesn't allow 2 nodes at the same address so Rob suggested > MFD for this case. Only after I first suggested you create cpu and dimm sensors from a single hwmon driver. Perhaps you should figure out how to fix the problem with delayed registration. Perhaps you can register the sensor, but just delay returning actual data until it is ready. Rob From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on archive.lwn.net X-Spam-Level: X-Spam-Status: No, score=-5.9 required=5.0 tests=DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by archive.lwn.net (Postfix) with ESMTP id C9F187D071 for ; Mon, 30 Jul 2018 22:10:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731542AbeG3Xr3 (ORCPT ); Mon, 30 Jul 2018 19:47:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:58420 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726622AbeG3Xr3 (ORCPT ); Mon, 30 Jul 2018 19:47:29 -0400 Received: from mail-qk0-f177.google.com (mail-qk0-f177.google.com [209.85.220.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 85ADD208B3; Mon, 30 Jul 2018 22:10:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532988626; bh=tOc1jQB1NfdDC3H4hkPBtE7+My8ugLd7mfpE6xEzx+U=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=OFXelQkAz5e8E1joTvYAMPAZxAO2mGj1mHrjGaQ3TJqQkQ4bNx38Agba799mY5j/F nFTGuJm4loy2rPlh9/zPXXReZIbNoU6wZmrxwYduFHUgasSE7+QpQ6rzKHYbrHp82e P3iS9LsjpqnENfXhxMuvWw6cRR5Jy4575/AUbTYc= Received: by mail-qk0-f177.google.com with SMTP id v17-v6so8924279qkb.11; Mon, 30 Jul 2018 15:10:26 -0700 (PDT) X-Gm-Message-State: AOUpUlEqeMAJBvJGI6HrByDV0bZ/O7lxXiTemSbXw5nKJua3tQM3L4S9 pyCeuE2NvU9T/HfeCqFH+MEBnta37CQiBVHgEg== X-Google-Smtp-Source: AAOMgpd0iyV4T8Vw4gs3LBL7lY12sMqXqqfcieS6jG0s3zcyAeWJv46+/8uBZdK7PsK4yZh7KGxPZWormVdJMrCwORg= X-Received: by 2002:ae9:e817:: with SMTP id a23-v6mr17520793qkg.213.1532988624453; Mon, 30 Jul 2018 15:10:24 -0700 (PDT) MIME-Version: 1.0 References: <20180723214751.1733-1-jae.hyun.yoo@linux.intel.com> <20180723214751.1733-9-jae.hyun.yoo@linux.intel.com> <20180727082611.GE4628@dell> In-Reply-To: From: Rob Herring Date: Mon, 30 Jul 2018 16:10:13 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v7 08/12] mfd: intel-peci-client: Add PECI client MFD driver To: Jae Hyun Yoo Cc: Lee Jones , Jean Delvare , Guenter Roeck , Mark Rutland , Joel Stanley , Andrew Jeffery , Jonathan Corbet , Greg Kroah-Hartman , Gustavo Pimentel , Kishon Vijay Abraham I , Lorenzo Pieralisi , darrick.wong@oracle.com, sandeen@redhat.com, Arnd Bergmann , Wu Hao , kusumi.tomohiro@gmail.com, bryantly@linux.vnet.ibm.com, fbarrat@linux.vnet.ibm.com, David Miller , Mauro Carvalho Chehab , Andrew Morton , Randy Dunlap , Philippe Ombredanne , Vinod , Stephen Boyd , david.kershner@unisys.com, =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Sagar Dharia , Johan Hovold , Thomas Gleixner , jgross@suse.com, Cyrille Pitchen , Linux HWMON List , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , linux-aspeed@lists.ozlabs.org, Linux Doc Mailing List , OpenBMC Maillist , James Feist , Jason M Biils , Vernon Mauery Content-Type: text/plain; charset="UTF-8" Sender: linux-doc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Fri, Jul 27, 2018 at 11:36 AM Jae Hyun Yoo wrote: > > Hi Lee, > > On 7/27/2018 1:26 AM, Lee Jones wrote: > > On Mon, 23 Jul 2018, Jae Hyun Yoo wrote: > > > >> This commit adds PECI client MFD driver. > >> > >> Signed-off-by: Jae Hyun Yoo > >> Cc: Lee Jones > >> Cc: Rob Herring > >> Cc: Andrew Jeffery > >> Cc: James Feist > >> Cc: Jason M Biils > >> Cc: Joel Stanley > >> Cc: Vernon Mauery > >> --- > >> drivers/mfd/Kconfig | 14 ++ > >> drivers/mfd/Makefile | 1 + > >> drivers/mfd/intel-peci-client.c | 182 ++++++++++++++++++++++++++ > >> include/linux/mfd/intel-peci-client.h | 81 ++++++++++++ > >> 4 files changed, 278 insertions(+) > >> create mode 100644 drivers/mfd/intel-peci-client.c > >> create mode 100644 include/linux/mfd/intel-peci-client.h > >> > >> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig > >> index f3fa516011ec..e38b591479d4 100644 > >> --- a/drivers/mfd/Kconfig > >> +++ b/drivers/mfd/Kconfig > >> @@ -595,6 +595,20 @@ config MFD_INTEL_MSIC > >> Passage) chip. This chip embeds audio, battery, GPIO, etc. > >> devices used in Intel Medfield platforms. > >> > >> +config MFD_INTEL_PECI_CLIENT > >> + bool "Intel PECI client" > >> + depends on (PECI || COMPILE_TEST) > >> + select MFD_CORE > >> + help > >> + If you say yes to this option, support will be included for the > >> + multi-funtional Intel PECI (Platform Environment Control Interface) > >> + client. PECI is a one-wire bus interface that provides a communication > >> + channel from PECI clients in Intel processors and chipset components > >> + to external monitoring or control devices. > >> + > >> + Additional drivers must be enabled in order to use the functionality > >> + of the device. > >> + > >> config MFD_IPAQ_MICRO > >> bool "Atmel Micro ASIC (iPAQ h3100/h3600/h3700) Support" > >> depends on SA1100_H3100 || SA1100_H3600 > >> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile > >> index 2852a6042ecf..29e2cacc58bd 100644 > >> --- a/drivers/mfd/Makefile > >> +++ b/drivers/mfd/Makefile > >> @@ -203,6 +203,7 @@ obj-$(CONFIG_MFD_INTEL_LPSS) += intel-lpss.o > >> obj-$(CONFIG_MFD_INTEL_LPSS_PCI) += intel-lpss-pci.o > >> obj-$(CONFIG_MFD_INTEL_LPSS_ACPI) += intel-lpss-acpi.o > >> obj-$(CONFIG_MFD_INTEL_MSIC) += intel_msic.o > >> +obj-$(CONFIG_MFD_INTEL_PECI_CLIENT) += intel-peci-client.o > >> obj-$(CONFIG_MFD_PALMAS) += palmas.o > >> obj-$(CONFIG_MFD_VIPERBOARD) += viperboard.o > >> obj-$(CONFIG_MFD_RC5T583) += rc5t583.o rc5t583-irq.o > >> diff --git a/drivers/mfd/intel-peci-client.c b/drivers/mfd/intel-peci-client.c > >> new file mode 100644 > >> index 000000000000..d7702cf1ea50 > >> --- /dev/null > >> +++ b/drivers/mfd/intel-peci-client.c > >> @@ -0,0 +1,182 @@ > >> +// SPDX-License-Identifier: GPL-2.0 > >> +// Copyright (c) 2018 Intel Corporation > >> + > >> +#include > >> +#include > >> +#include > >> +#include > >> +#include > >> +#include > >> + > >> +enum cpu_gens { > >> + CPU_GEN_HSX = 0, /* Haswell Xeon */ > >> + CPU_GEN_BRX, /* Broadwell Xeon */ > >> + CPU_GEN_SKX, /* Skylake Xeon */ > >> +}; > >> + > >> +static struct mfd_cell peci_functions[] = { > >> + { > >> + .name = "peci-cputemp", > >> + .of_compatible = "intel,peci-cputemp", > >> + }, > >> + { > >> + .name = "peci-dimmtemp", > >> + .of_compatible = "intel,peci-dimmtemp", > >> + }, > >> +}; > > > > The more I look at this driver, the less I think it fits into MFD. > > > > What's stopping you from registering these devices directly from DT? > > > > Because DT doesn't allow 2 nodes at the same address so Rob suggested > MFD for this case. Only after I first suggested you create cpu and dimm sensors from a single hwmon driver. Perhaps you should figure out how to fix the problem with delayed registration. Perhaps you can register the sensor, but just delay returning actual data until it is ready. Rob -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: robh+dt@kernel.org (Rob Herring) Date: Mon, 30 Jul 2018 16:10:13 -0600 Subject: [PATCH v7 08/12] mfd: intel-peci-client: Add PECI client MFD driver In-Reply-To: References: <20180723214751.1733-1-jae.hyun.yoo@linux.intel.com> <20180723214751.1733-9-jae.hyun.yoo@linux.intel.com> <20180727082611.GE4628@dell> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Fri, Jul 27, 2018 at 11:36 AM Jae Hyun Yoo wrote: > > Hi Lee, > > On 7/27/2018 1:26 AM, Lee Jones wrote: > > On Mon, 23 Jul 2018, Jae Hyun Yoo wrote: > > > >> This commit adds PECI client MFD driver. > >> > >> Signed-off-by: Jae Hyun Yoo > >> Cc: Lee Jones > >> Cc: Rob Herring > >> Cc: Andrew Jeffery > >> Cc: James Feist > >> Cc: Jason M Biils > >> Cc: Joel Stanley > >> Cc: Vernon Mauery > >> --- > >> drivers/mfd/Kconfig | 14 ++ > >> drivers/mfd/Makefile | 1 + > >> drivers/mfd/intel-peci-client.c | 182 ++++++++++++++++++++++++++ > >> include/linux/mfd/intel-peci-client.h | 81 ++++++++++++ > >> 4 files changed, 278 insertions(+) > >> create mode 100644 drivers/mfd/intel-peci-client.c > >> create mode 100644 include/linux/mfd/intel-peci-client.h > >> > >> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig > >> index f3fa516011ec..e38b591479d4 100644 > >> --- a/drivers/mfd/Kconfig > >> +++ b/drivers/mfd/Kconfig > >> @@ -595,6 +595,20 @@ config MFD_INTEL_MSIC > >> Passage) chip. This chip embeds audio, battery, GPIO, etc. > >> devices used in Intel Medfield platforms. > >> > >> +config MFD_INTEL_PECI_CLIENT > >> + bool "Intel PECI client" > >> + depends on (PECI || COMPILE_TEST) > >> + select MFD_CORE > >> + help > >> + If you say yes to this option, support will be included for the > >> + multi-funtional Intel PECI (Platform Environment Control Interface) > >> + client. PECI is a one-wire bus interface that provides a communication > >> + channel from PECI clients in Intel processors and chipset components > >> + to external monitoring or control devices. > >> + > >> + Additional drivers must be enabled in order to use the functionality > >> + of the device. > >> + > >> config MFD_IPAQ_MICRO > >> bool "Atmel Micro ASIC (iPAQ h3100/h3600/h3700) Support" > >> depends on SA1100_H3100 || SA1100_H3600 > >> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile > >> index 2852a6042ecf..29e2cacc58bd 100644 > >> --- a/drivers/mfd/Makefile > >> +++ b/drivers/mfd/Makefile > >> @@ -203,6 +203,7 @@ obj-$(CONFIG_MFD_INTEL_LPSS) += intel-lpss.o > >> obj-$(CONFIG_MFD_INTEL_LPSS_PCI) += intel-lpss-pci.o > >> obj-$(CONFIG_MFD_INTEL_LPSS_ACPI) += intel-lpss-acpi.o > >> obj-$(CONFIG_MFD_INTEL_MSIC) += intel_msic.o > >> +obj-$(CONFIG_MFD_INTEL_PECI_CLIENT) += intel-peci-client.o > >> obj-$(CONFIG_MFD_PALMAS) += palmas.o > >> obj-$(CONFIG_MFD_VIPERBOARD) += viperboard.o > >> obj-$(CONFIG_MFD_RC5T583) += rc5t583.o rc5t583-irq.o > >> diff --git a/drivers/mfd/intel-peci-client.c b/drivers/mfd/intel-peci-client.c > >> new file mode 100644 > >> index 000000000000..d7702cf1ea50 > >> --- /dev/null > >> +++ b/drivers/mfd/intel-peci-client.c > >> @@ -0,0 +1,182 @@ > >> +// SPDX-License-Identifier: GPL-2.0 > >> +// Copyright (c) 2018 Intel Corporation > >> + > >> +#include > >> +#include > >> +#include > >> +#include > >> +#include > >> +#include > >> + > >> +enum cpu_gens { > >> + CPU_GEN_HSX = 0, /* Haswell Xeon */ > >> + CPU_GEN_BRX, /* Broadwell Xeon */ > >> + CPU_GEN_SKX, /* Skylake Xeon */ > >> +}; > >> + > >> +static struct mfd_cell peci_functions[] = { > >> + { > >> + .name = "peci-cputemp", > >> + .of_compatible = "intel,peci-cputemp", > >> + }, > >> + { > >> + .name = "peci-dimmtemp", > >> + .of_compatible = "intel,peci-dimmtemp", > >> + }, > >> +}; > > > > The more I look at this driver, the less I think it fits into MFD. > > > > What's stopping you from registering these devices directly from DT? > > > > Because DT doesn't allow 2 nodes at the same address so Rob suggested > MFD for this case. Only after I first suggested you create cpu and dimm sensors from a single hwmon driver. Perhaps you should figure out how to fix the problem with delayed registration. Perhaps you can register the sensor, but just delay returning actual data until it is ready. Rob