Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2525714pxb; Fri, 8 Oct 2021 09:29:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytLLwTWgIHKonGKVpoqcjUgFN+FmQgmOGIxm1J2tC7IL1LQGY4xAEMe5cAGIE1bi98Yw1j X-Received: by 2002:a17:906:7810:: with SMTP id u16mr5140323ejm.516.1633710568872; Fri, 08 Oct 2021 09:29:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633710568; cv=none; d=google.com; s=arc-20160816; b=qIJWPNU11oGlE9qwbZLH2imEtxQ+bDI8nyFGqs69zLgS/kbXkPC3CZjWTlmtkrWTSE 3I+NDkGcmg1SS6p5e7VSxz2Cefan7O5ZP4FslsrH0CT8T2lFoWb5o4ac0zgJP8dd6zOl CEr3oAAaPiV3EPQMmeWwBlJgtDc7dZAFBkfFKDZV2kVxaj3FoHFNsYpFeto4zdjHBY7f +yBypSCg0mSWoTEPVtM4aMNxd6/vF/5RYaZHaJRoi5ocF1r2pwqXgVZ/a4r0tDY0bJdH fr1J0duDN8k8A1pspv9Df5yFnTVV0ImaP4f2ilHwBA6Ld3Vme0nla5hagKS22I7fEHos dYMQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TARDfeMsRqg/3JhoEm/6776uxW1K8VdCuI/7/bMxpsE=; b=g12far2iXRAKhOl+udKert4BKl4/BNBHxkIJFzHa3eBU2ljCjUCLtFc7+Pbe3moAuY gpAw5G5f1fVetfoSSm5NRaLXUNsazSB9C95JGl1sfcjFnFzM50j1ZQvxvka6d5ZffLYD VqyTOwLPNFJK6ZyjK6i92MT7oZV27UgW+oCtylIF5tIps3Xwqe5D2Pg1vghiqVhXcJd6 ctQFlk9LX4khNV9JFk+ME9WqzdMsBYLy4Z89vZJyIbJf7GTCX/oQmVOxucZ748cKQKs7 UPy8lEYSceoLmWP7QLMRwL6WWFGNWvnhw/wQrQ9s/xWvfuzqS1Yy7d5bUjWX2PHH7n1N sXwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="QX/c167u"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id eb13si2483932edb.334.2021.10.08.09.29.04; Fri, 08 Oct 2021 09:29:28 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="QX/c167u"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238705AbhJHQ13 (ORCPT + 99 others); Fri, 8 Oct 2021 12:27:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:20450 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232000AbhJHQ1V (ORCPT ); Fri, 8 Oct 2021 12:27:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633710325; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TARDfeMsRqg/3JhoEm/6776uxW1K8VdCuI/7/bMxpsE=; b=QX/c167uOJU6Th+uTcPE+4qjofbuUoHtlHRT8wjYrn+LuYBlwHTpwtGA5K4FxjpIxTWkgJ 7G6u4ItXXNUwd4Ymm38tNO7C3t1jV/G42zNklASjqnZEfdNh5L0KuOQ+mu3FzVf6QZFSMN 4SHRaOdjkunTiZEuunpyAN8oOBQLbUE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-558-kIc4rRLjOv6f4TuZDnxzkg-1; Fri, 08 Oct 2021 12:25:24 -0400 X-MC-Unique: kIc4rRLjOv6f4TuZDnxzkg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2F6EF8464BA; Fri, 8 Oct 2021 16:23:18 +0000 (UTC) Received: from x1.localdomain (unknown [10.39.192.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id D46DA60BF1; Fri, 8 Oct 2021 16:23:13 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" , Mark Gross , Andy Shevchenko , Daniel Scally , Laurent Pinchart , Mauro Carvalho Chehab , Liam Girdwood , Mark Brown , Michael Turquette , Stephen Boyd Cc: Hans de Goede , Len Brown , linux-acpi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Sakari Ailus , Kate Hsuan , linux-media@vger.kernel.org, linux-clk@vger.kernel.org Subject: [PATCH 10/12] platform/x86: int3472: Pass tps68470_clk_platform_data to the tps68470-regulator MFD-cell Date: Fri, 8 Oct 2021 18:21:19 +0200 Message-Id: <20211008162121.6628-11-hdegoede@redhat.com> In-Reply-To: <20211008162121.6628-1-hdegoede@redhat.com> References: <20211008162121.6628-1-hdegoede@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pass tps68470_clk_platform_data to the tps68470-clk MFD-cell, so that sensors which use the TPS68470 can find their clock. Signed-off-by: Hans de Goede --- drivers/platform/x86/intel/int3472/tps68470.c | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/drivers/platform/x86/intel/int3472/tps68470.c b/drivers/platform/x86/intel/int3472/tps68470.c index e95b0f50b384..bd01acb177c4 100644 --- a/drivers/platform/x86/intel/int3472/tps68470.c +++ b/drivers/platform/x86/intel/int3472/tps68470.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include "common.h" @@ -17,12 +18,6 @@ static const struct mfd_cell tps68470_cros[] = { { .name = "tps68470_pmic_opregion" }, }; -static const struct mfd_cell tps68470_win[] = { - { .name = "tps68470-gpio" }, - { .name = "tps68470-clk" }, - { .name = "tps68470-regulator" }, -}; - static const struct regmap_config tps68470_regmap_config = { .reg_bits = 8, .val_bits = 8, @@ -105,10 +100,17 @@ static int skl_int3472_tps68470_calc_type(struct acpi_device *adev) static int skl_int3472_tps68470_probe(struct i2c_client *client) { struct acpi_device *adev = ACPI_COMPANION(&client->dev); + struct tps68470_clk_platform_data clk_pdata = {}; + struct mfd_cell *cells; struct regmap *regmap; int device_type; int ret; + ret = skl_int3472_get_sensor_adev_and_name(&client->dev, NULL, + &clk_pdata.consumer_dev_name); + if (ret) + return ret; + regmap = devm_regmap_init_i2c(client, &tps68470_regmap_config); if (IS_ERR(regmap)) { dev_err(&client->dev, "Failed to create regmap: %ld\n", PTR_ERR(regmap)); @@ -126,9 +128,19 @@ static int skl_int3472_tps68470_probe(struct i2c_client *client) device_type = skl_int3472_tps68470_calc_type(adev); switch (device_type) { case DESIGNED_FOR_WINDOWS: - ret = devm_mfd_add_devices(&client->dev, PLATFORM_DEVID_NONE, - tps68470_win, ARRAY_SIZE(tps68470_win), + cells = kcalloc(3, sizeof(*cells), GFP_KERNEL); + if (!cells) + return -ENOMEM; + + cells[0].name = "tps68470-gpio"; + cells[1].name = "tps68470-clk"; + cells[1].platform_data = &clk_pdata; + cells[1].pdata_size = sizeof(clk_pdata); + cells[2].name = "tps68470-regulator"; + + ret = devm_mfd_add_devices(&client->dev, PLATFORM_DEVID_NONE, cells, 3, NULL, 0, NULL); + kfree(cells); break; case DESIGNED_FOR_CHROMEOS: ret = devm_mfd_add_devices(&client->dev, PLATFORM_DEVID_NONE, -- 2.31.1