Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2003918lqb; Mon, 27 May 2024 05:03:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVcOLSMyr8g5i2MuFQfen13axwJIfvyRylnu7StoNh8QBuPgaTPmUWOdXoyTgvVoQIv4kZMHzFPrZNn4nkHrbMvLVTtbDSDAP/7p20vaQ== X-Google-Smtp-Source: AGHT+IH4K+dzciN5ccqgtcViemJcrIPX8v1793xWXAMGoG6renyyF2lBeqzfL5TtzRS218XTCNM6 X-Received: by 2002:a17:902:d2c2:b0:1f4:7d47:b88b with SMTP id d9443c01a7336-1f47d47bdafmr59045495ad.11.1716811426255; Mon, 27 May 2024 05:03:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716811426; cv=pass; d=google.com; s=arc-20160816; b=zHwoeL+HOPjCYXajnI0cQeSssaqo2Mk/1u4ldZdO7/UwfgDE05CuAXm4MGMKcGEDAk Vs9p3v0YPLBc3/sAjVp2MQVjuUyN8WRPqhFEHWDaCagwitKeU4bv33gkmddOB4N6tuAo SQZYSyAfoh2A8Ck7tqVG7OAbN0Ms0ABXKkrG5A99Ts2Ll92Lx3rhiaFePlPWL4P2Kmnx auJ3a4Hwv712CBevv8WHKUweXwkycFQnxhpa9hS8Bmjv240Q9Wi8uVTBLdvfyFWkSB8+ xUOxL9Z82eG4Ap0RGBug6Wbv9U6Bx52A93+DGGXMxSozk/w2/awOPu+Gh/0wk+iVaWyr NoSg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=HdRZ8PJH5vkD9TGX7r4B8NiG3gmtbnkvy1NOwKAXBr8=; fh=ePjxTwTKzWvxlvjPcJkViHq4ygdMXlrXo6bsxJ/c1zE=; b=tLUQRYbZtf2q9Ht09mjAwueRv7Qc9Z7dR2mesfBHeseq1+izy8WtqFIpj3uNxB4vsY ZqDSALU2w3zn0M0EI76wp6NPKAPFKVXaYp5QN0esu/LT6/zMUgCF5pYij3SBtzo50L8p iyxO46VJm18hRQ1NxFlVBDcqAyGxzo8VPm7+N0IKM/ia0Ei7xrW2DyKUQ9YpeLBdt9ur MR8171wcXc6Nf3WKBD4mnkFi1zrQQ5kZ+m0GcTdBD/PCjYe8WFoIbgjc5gwiqdr/C5RW J9qXV0n4N7StW403u9ngXqFSV4xtC/Od0zI2wFCBwA/2lHd1nsSl7/9ytz6imcNGfVm1 BxEQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Yte9w9Zj; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-190513-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190513-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f4993c36ccsi17511965ad.272.2024.05.27.05.03.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 05:03:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190513-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Yte9w9Zj; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-190513-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190513-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 1BDC9B2419E for ; Mon, 27 May 2024 11:52:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 23F0215E5CE; Mon, 27 May 2024 11:50:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Yte9w9Zj" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D331B15D5CC for ; Mon, 27 May 2024 11:49:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716810600; cv=none; b=j7rFTIjQH9GwTgQnWZB1uMekEXMutOTYPJjMhtM1UyTxwDz2rLkRVjV0KTQvhBjuNdFfeMHeXHJjBO3J3gW0xFyw4EYIk3JgnKZ6hK/fZk2NrrhrSj9AMBvDDp/HpWi0ZSXlvoUeWhLcX536MtavFXRNAk6IvSC63dMNCZlAMYA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716810600; c=relaxed/simple; bh=sRmVMUWEsGd3JiARjxDS9+4xUJi2FEDCmK4BeqEOf/I=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=VGxLtnSxaa1kCo3q6aLAiLcQr/M2AsBoESK8bwl6VtUOOEmUWDomqb0WXZLepIyuQIzRQJy1OciwMHxqnNVncpE23P3/E9WgLD/Qzseihhpx/Vh7xwJibXJyl+w1j0BGD8HWbc53O9PBTg2leyGX7VEjMuyTN2hsuUpoWIPgZXY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Yte9w9Zj; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716810597; 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; bh=HdRZ8PJH5vkD9TGX7r4B8NiG3gmtbnkvy1NOwKAXBr8=; b=Yte9w9ZjMnqc922d1AtddtDloupnfpNArSgnFw7KnxyXFbGr5q4zvRUEGc6nsYlBpfMQd5 njwKScQmgMWO1md9HxCLW86yLWt69dTl1o/qS+PPvw2STFiSNX+MEKjrr2mgErepxL0iPb rsqOvOxmZVovrg0sDVqbvN310KltEjE= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-394-NF8o59KrPkyA8BluyXJZ7g-1; Mon, 27 May 2024 07:49:52 -0400 X-MC-Unique: NF8o59KrPkyA8BluyXJZ7g-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DAB963C025BE; Mon, 27 May 2024 11:49:51 +0000 (UTC) Received: from x1.localdomain.com (unknown [10.39.194.78]) by smtp.corp.redhat.com (Postfix) with ESMTP id 09B331C00A8E; Mon, 27 May 2024 11:49:50 +0000 (UTC) From: Hans de Goede To: Andy Shevchenko , Lee Jones Cc: Hans de Goede , Jani Nikula , linux-kernel@vger.kernel.org Subject: [PATCH v2] mfd: intel_soc_pmic_crc: Use PWM_LOOKUP_WITH_MODULE() for the PWM lookup Date: Mon, 27 May 2024 13:49:50 +0200 Message-ID: <20240527114950.326659-1-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 The primary use of the CRC PMIC's PWM is for LCD panel backlight control by the i915 driver. Due to its complexity the probe() function of the i915 driver does not support -EPROBE_DEFER handling. So far the pwm-crc driver must be built into the kernel to ensure that the pwm_get() done by the i915 driver succeeds at once (rather then returning -EPROBE_DEFER). But the PWM core can load the module from pwm_get() if a module-name is provided in the pwm_lookup associated with the consumer device. Switch to using PWM_LOOKUP_WITH_MODULE() for the lookup added for the Intel integrated GPU, so that the PWM core can load the module from pwm_get() as needed allowing the pwm-crc driver to be safely built as module. This has been successfully tested on an Asus T100TAM with pwm-crc build as a module. Link: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11081 Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v2: - Some small commit message tweaks - Add Andy's Reviewed-by --- drivers/mfd/intel_soc_pmic_crc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/intel_soc_pmic_crc.c b/drivers/mfd/intel_soc_pmic_crc.c index 581f81cbaa24..876d017f74fe 100644 --- a/drivers/mfd/intel_soc_pmic_crc.c +++ b/drivers/mfd/intel_soc_pmic_crc.c @@ -137,7 +137,9 @@ static const struct regmap_irq_chip crystal_cove_irq_chip = { /* PWM consumed by the Intel GFX */ static struct pwm_lookup crc_pwm_lookup[] = { - PWM_LOOKUP("crystal_cove_pwm", 0, "0000:00:02.0", "pwm_pmic_backlight", 0, PWM_POLARITY_NORMAL), + PWM_LOOKUP_WITH_MODULE("crystal_cove_pwm", 0, "0000:00:02.0", + "pwm_pmic_backlight", 0, PWM_POLARITY_NORMAL, + "pwm-crc"), }; struct crystal_cove_config { -- 2.45.1