Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4454298imm; Mon, 30 Jul 2018 15:12:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdVJl+wglPtUG8fWdnpdKn/6veJPCWA8ZvqU+cCdDBfYdQiCxCLwYK9GDFT2mBWWg7ecI3A X-Received: by 2002:a63:27c1:: with SMTP id n184-v6mr17366582pgn.29.1532988746096; Mon, 30 Jul 2018 15:12:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532988746; cv=none; d=google.com; s=arc-20160816; b=aoBUd+Cq/2jiJjrKH+f8Ba33js45lteSRY1qMoHXoxADKeWDnRt3+aPXy0jF+HsHoK 5S36D6mZEjC5XSBBkrrr1sv09QvUsG5e3+CRLWh8KnicS/2iFRFBixN3HYz7aIxUIOwh DHbI5cBtsOzX+LzJeznJxrUzp+anhWUN7Qi6ssQK74CAVhzElSVdE0yRvsNzuqPNV/Wi NwSeckXOfYCR+uxl9fXGjl8/w68ldBc1R9cMYWuHV5PpAURWUSbXqPVZx6IlQdblWAyT XXFOnYciy5n8SlKsJPFZdgNixRAmdrAAvVmBMuCh17VnzNtS6EN5Ptxh7VXoqQAw2YpE MjSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=NXfhK1zDPQvlrWB0Lc/1/A28Y4UJ9venq69JP4YcqAI=; b=OxYe1YZ0eZ2nw1PBfN1bP0dWj5pUPmm9/7+ahZ3/3UBifpFEYpsKADeIQy8kJ2TFB3 L8ARrXiBK6qKL4B3Rc/uB2alF3vcf/QPjmwgaVn2FURN9Npu9ggk8Kux0iEpVaCzHFZ8 gWlyIqNRz4r++6MmbA0aUVtwf1YL/I3ZaKTTZklosY2C9vnlbmxnlv4wQnoc6OLL4k7f UQ4ky7akRvWzs0G5zJaM/sqGVWbc+Rj7ST+QRFSSqnyFM8mc+8+ddwuTZwFPYq2wqXhy /SLb4V4sfgL01iKh4QprvYLLI6R/9RfI609XizDoSQ9pczj7ssyP8cYVnmUbcYI4y+Yg sRhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OFXelQkA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6-v6si12048415pfu.143.2018.07.30.15.12.11; Mon, 30 Jul 2018 15:12:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OFXelQkA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731906AbeG3Xr3 (ORCPT + 99 others); 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-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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