Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3900274pxv; Mon, 19 Jul 2021 11:29:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqByxVgD+IlXIQUDeiBm2VdMZAzXCxL3K5AoYQCcJydnLoFHPddl8662jCOI/xoC6o3i3x X-Received: by 2002:a05:6402:d63:: with SMTP id ec35mr36495242edb.347.1626719371627; Mon, 19 Jul 2021 11:29:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626719371; cv=none; d=google.com; s=arc-20160816; b=E/c50dNfdfllNUsaIXtOqTXN/+b9MgKJRgoTZSg6dWEqc/iltSvODa+joHUYRcq/IZ 3iX5S0Z/wCWdddG9ndLDIRNq257BSXpaOJKE7BYsqDuUjgv6SnGt53MnfzDEgKW4qZFy Hww533xyGb10lL3COLV62fIxZ0Q8N3hC17aua+JdaJv4KMw2zt+6dWg3sTuxULPJfmC3 J9OYB17KZWezSS3X+sfpq2wc70ktkuXd4Bn/4b3hj9KtKmOUQVE34mb9JiOAbXysnGCO j/hCtfU2egIjzJ3jK0Odj4It/ciMW3goHCGsrt3z6tyjDY2kAN/kUm+fDI9xpK3C+dJS CKWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:to:from:subject:message-id; bh=uAlhiCqpdode2zszSv9zFwmEbn3Cw52HugT7OF03G/k=; b=pG31jrb4j3c9J///gwF8vIB2H2U6gafpR+HwF5D6OgpGSzM6LEV3SULsRfEss67G9Y jY8zGJF/lq0YTzHDd60nRUbnE3X96v5hdZLYREaXXzIWMK3K8RWURFmQeIRylkmlCBp5 /v58CvsqM+hc0OM3twivcRjQd8xrJ277IbcJmdpI0qJ/dy7n8UjYunPddMG5arvcvgYu T2t7NTeACLyeLRnpeBig5/3qGhQPVz/IRXyP/qHR+apLht3a+yk0/DtlFKmfdEEFKSRK 3u627Jdcd73QkCqNBgzXIcy9gG4k6zk994l2EPi1tGH2Yt9f6K8LvIHE0WfKCAEdrJsW ptEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j24si13829327eja.261.2021.07.19.11.29.08; Mon, 19 Jul 2021 11:29:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349215AbhGSRkT (ORCPT + 99 others); Mon, 19 Jul 2021 13:40:19 -0400 Received: from mga09.intel.com ([134.134.136.24]:45252 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350553AbhGSQgs (ORCPT ); Mon, 19 Jul 2021 12:36:48 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10050"; a="211095874" X-IronPort-AV: E=Sophos;i="5.84,252,1620716400"; d="scan'208";a="211095874" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2021 10:17:26 -0700 X-IronPort-AV: E=Sophos;i="5.84,252,1620716400"; d="scan'208";a="431764310" Received: from spandruv-desk.jf.intel.com ([10.54.75.21]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2021 10:17:26 -0700 Message-ID: <7f190f203061539642e4f1f9afe0edfeaeaf559b.camel@linux.intel.com> Subject: Re: [PATCH] thermal: int340x: Use IMOK independently From: srinivas pandruvada To: Sumeet Pawnikar , rui.zhang@intel.com, daniel.lezcano@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 19 Jul 2021 10:16:54 -0700 In-Reply-To: <20210716163946.3142-1-sumeet.r.pawnikar@intel.com> References: <20210716163946.3142-1-sumeet.r.pawnikar@intel.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2021-07-16 at 22:09 +0530, Sumeet Pawnikar wrote: > Some chrome platform requires IMOK method in coreboot. But these > platforms > don't use GDDV data vault in coreboot. As per current code flow, to > enable > and use IMOK only, we need to have GDDV support as well in coreboot. > This > patch removes the dependency for IMOK from GDDV to enable and use IMOK > independently. > > Signed-off-by: Sumeet Pawnikar Acked-by: Srinivas Pandruvada > --- >  .../intel/int340x_thermal/int3400_thermal.c        | 14 +++++++++++++- >  1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c > b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c > index 823354a1a91a..19926beeb3b7 100644 > --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c > +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c > @@ -108,9 +108,12 @@ static struct attribute *imok_attr[] = { >         NULL >  }; >   > +static const struct attribute_group imok_attribute_group = { > +       .attrs = imok_attr, > +}; > + >  static const struct attribute_group data_attribute_group = { >         .bin_attrs = data_attributes, > -       .attrs = imok_attr, >  }; >   >  static ssize_t available_uuids_show(struct device *dev, > @@ -522,6 +525,12 @@ static int int3400_thermal_probe(struct > platform_device *pdev) >         if (result) >                 goto free_rel_misc; >   > +       if (acpi_has_method(priv->adev->handle, "IMOK")) { > +               result = sysfs_create_group(&pdev->dev.kobj, > &imok_attribute_group); > +               if (result) > +                       goto free_imok; > +       } > + >         if (priv->data_vault) { >                 result = sysfs_create_group(&pdev->dev.kobj, >                                             &data_attribute_group); > @@ -545,6 +554,8 @@ static int int3400_thermal_probe(struct > platform_device *pdev) >         } >  free_uuid: >         sysfs_remove_group(&pdev->dev.kobj, &uuid_attribute_group); > +free_imok: > +       sysfs_remove_group(&pdev->dev.kobj, &imok_attribute_group); >  free_rel_misc: >         if (!priv->rel_misc_dev_res) >                 acpi_thermal_rel_misc_device_remove(priv->adev- > >handle); > @@ -573,6 +584,7 @@ static int int3400_thermal_remove(struct > platform_device *pdev) >         if (priv->data_vault) >                 sysfs_remove_group(&pdev->dev.kobj, > &data_attribute_group); >         sysfs_remove_group(&pdev->dev.kobj, &uuid_attribute_group); > +       sysfs_remove_group(&pdev->dev.kobj, &imok_attribute_group); >         thermal_zone_device_unregister(priv->thermal); >         kfree(priv->data_vault); >         kfree(priv->trts);