From patchwork Thu Nov 17 11:08:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 21570 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp338560wrr; Thu, 17 Nov 2022 03:10:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf55yrLIBhMIzNJrWoYbRXnFPi6O/X22II36ZCXuc5UrtHMw6UiuzYa+3s9mT/0PkBgUdgcy X-Received: by 2002:a17:90a:9312:b0:218:6f4b:8366 with SMTP id p18-20020a17090a931200b002186f4b8366mr2820271pjo.137.1668683426337; Thu, 17 Nov 2022 03:10:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668683426; cv=none; d=google.com; s=arc-20160816; b=NG1WlLGaPg8UGGq7Bu/91rOZFTIWauo6y4jWCxLTUImJ3QvVM5/BTh1iegSrV0Uy53 trVlPv6S7FdFnwXxxsp94X6p8omMI7L9sYayb8TdsSZhKmNVcDQxqyGIa4RLXuiYVa22 N/0pCIkck8P6m0WQo6TMTTL9SeO+mhXIbJzNVF3bS9cAHHL+VYmIjsX2e5FM1kpOTdaT dBXmH5djG1AGJjzB6kxGKC6zgC7LFMRfK+UPmL4LqUvyxR3W/FQj1Ghd4SeFUxJLYa3W R/EVWyDlA0qzcQdXgTIVLH1yW+skFUE5dXSwscxcugFGAHi04U1fu05FBofPBSr5XsnE jzzQ== 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=4mJHNUNkUb7RaQffjAzU/xeJwrC/qNrnQPj0zB1QRdQ=; b=rcQHE4hGCActgJYHdDcklJgV7cdCfRdJTh1+vVMUWMS9zRhBDhR0mmaedf0X6gVT5V QOhXYgl5BZopxGOEWy/J4Ipi4qhh9cu16cDeBhlpdTuVizU6VCv0Q0zgcei6c6PCRvRE mXIMO1IqnlR6s+jF2+sQV/9BLudoelymEglvpo5KBo/U4uCSK0Kz7MqCbT8x8xfli3uD UUdUt075/bhEvWGmJNp/v38U7V+sMkdLP2wlJB1Sa9OQu9eZI4AfIWsATeRoaTqnDNAJ kVupT3LcHZp/2KiAggSsgiI89K3lHUvyZOy1TVH3Mbv9sL+aglpFWMnwaLbc7WDLX6ZO Rgog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KfIz2r7Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m11-20020a17090a71cb00b00205d0348e7fsi553300pjs.93.2022.11.17.03.10.12; Thu, 17 Nov 2022 03:10:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KfIz2r7Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239869AbiKQLIa (ORCPT + 99 others); Thu, 17 Nov 2022 06:08:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239832AbiKQLIG (ORCPT ); Thu, 17 Nov 2022 06:08:06 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC1F169DD2; Thu, 17 Nov 2022 03:07:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668683277; x=1700219277; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/5ATWhqQrc1DZJ4f0j7ZyUNBHQXbdLiioN7qk5/mljI=; b=KfIz2r7Y75mo5nPtdgO4lOO3Py56jWtwjG2TEC89NqqoTHfpcRZ8cL6C +d2qNTf0KryBnGuI8JmFk/p6yegmn7+4eq7lWwRKHE8d/T1y5h15XxZr6 9k91yQ/bu7BsXnZDDiopml7OwHGAXiOfr5AEg81I9fXawCfYQTUJQ01Fu WXvQeqeav7QtRgX8kDgMjAfXqsnf9juxMRixA3KSTSrgYOK+x8DdXKcVb Zwrna53sDhHAo1HBaJKMSjDO5pekX0iuCKvW5pQCgWL6U7lQGJaqVSlnl ESc7rToaQ8ptCSDIqP5PP37aaKA7KxaFWEbeY/TEpjx0QxPpt+PjLRZv6 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="314638714" X-IronPort-AV: E=Sophos;i="5.96,171,1665471600"; d="scan'208";a="314638714" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2022 03:07:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="617572329" X-IronPort-AV: E=Sophos;i="5.96,171,1665471600"; d="scan'208";a="617572329" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 17 Nov 2022 03:07:54 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 91D9E2F3; Thu, 17 Nov 2022 13:08:19 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Mika Westerberg , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , Hans de Goede , Thierry Reding , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org Cc: Andy Shevchenko , Linus Walleij Subject: [PATCH v5 1/7] pwm: Add a stub for devm_pwmchip_add() Date: Thu, 17 Nov 2022 13:08:00 +0200 Message-Id: <20221117110806.65470-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221117110806.65470-1-andriy.shevchenko@linux.intel.com> References: <20221117110806.65470-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749741392641703360?= X-GMAIL-MSGID: =?utf-8?q?1749741392641703360?= The devm_pwmchip_add() can be called by a module that optionally instantiates PWM chip. In the case of CONFIG_PWM=n, the compilation can't be performed. Hence, add a necessary stub. Signed-off-by: Andy Shevchenko Acked-by: Thierry Reding Reviewed-by: Mika Westerberg Acked-by: Uwe Kleine-König --- include/linux/pwm.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/pwm.h b/include/linux/pwm.h index d70c6e5a839d..bba492eea96c 100644 --- a/include/linux/pwm.h +++ b/include/linux/pwm.h @@ -478,6 +478,11 @@ static inline int pwmchip_remove(struct pwm_chip *chip) return -EINVAL; } +static inline int devm_pwmchip_add(struct device *dev, struct pwm_chip *chip) +{ + return -EINVAL; +} + static inline struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip, unsigned int index, const char *label) From patchwork Thu Nov 17 11:08:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 21569 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp338547wrr; Thu, 17 Nov 2022 03:10:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf4m+Ds8q0WCerXDb5WQx0yLdx8gi3THSb8TsIiL2zM6zbGTJFbFUCmwrZkdYkI7ppyBwn3V X-Received: by 2002:a17:902:a5c6:b0:187:1380:4398 with SMTP id t6-20020a170902a5c600b0018713804398mr2178622plq.134.1668683423082; Thu, 17 Nov 2022 03:10:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668683423; cv=none; d=google.com; s=arc-20160816; b=dAYEY7GY9usFbKSHSRKVToWYyZDwgVz0y4LYG3Y36yoOs79mbB7rOj6eJJJ5Oi7ili GvpJq0UIuOV8Cn0iRdAvIk/Ci+mKX3XJVO/PNrRmrrMgpGfrJolRDRR9Wfyj/vj8SACg l+9Phq4/ZHv/3CIwgOw9o6eoGNkKLmVz4IHsQoZlXf7Yy5omNSdRZWqVWgHMZZFjF+Bx A9/NHRId4wF1QsGXNNWoGEAsnLhhcYNorqRBKrz1IT8WR+vS/WUeuz3//23DKXQH3rOt qE77O4rfw645YVzBvrUbDv5VP/SUf7mY4VdXfwFQsYgAIotY16UeshVVeVBUJoLDW1Hl VJPg== 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=vZZE9Whmb0Eca4vR+lCKP5AXpzYDuF3iwqprX5WYFE8=; b=K6jQtGXj0BrVRHVJeCHVDOQ2gtPi47BWzuVSlu2dYviXxqBf56IUJarPrRLWRkHYc1 YkfsbNPDpsbK2UAAauvADWajku5QQaaNzCCrgRSR2uWf1nwDDV+sTNSzpp1NRNE46U/3 Pl6q3+RKAvLyLFzRqTZRUJRmRC6IEEMWTJjml0dqJwKsFRzzuhMjOqC/UnzyP1eZfN+c B9+imDIQHlV1FevRAJw7F9UDiVfM5TZJFL1uDj3qUOJYTXaQxNQz8YMoQ4ndw6aDj3ls CUKgyDKe1raEjme25Tf19E7hT11T/oiDtlAIgd0qh00vaM/UT5prJLmSaUq44NKcj1XB BgkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=McLzHn0J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x5-20020a17090300c500b00186a4763532si663799plc.28.2022.11.17.03.10.08; Thu, 17 Nov 2022 03:10:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=McLzHn0J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239574AbiKQLIu (ORCPT + 99 others); Thu, 17 Nov 2022 06:08:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239856AbiKQLIM (ORCPT ); Thu, 17 Nov 2022 06:08:12 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29C9D6A763; Thu, 17 Nov 2022 03:08:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668683286; x=1700219286; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gGDtImubOcSLVP60+TzwKMDasoMDqFJiSB9lXa2+0Eg=; b=McLzHn0J+I3KoVlkj3qSMFAcf4T+4UAekLiCoKhaDGG7Jf2BBbu5X1Ir /BFTk5AMaHzhHaTaQbxYEg7+sMn/60LMSATLcOOJoZc+ffXm0PPsBt4Rn sNl1YoreZqxp9dRushQM0kaOhWOiP5LxodFEKo86ow6wVt3WgWeAXiKHY yGKUflFcUqSwuQUvDNffjYsIVlHnk98+yrpPcGP3v24tXh8YJOjSKyXCr uEnTxb1g8K4XDrxZGcQkw4l/RasCLC2lAEmnpeNjma4mI2HztW2cGMoXw tH0FtSBwoYOkjr7JkvgVwUx0CddtiWmhEkbZtrLHY2+EdSBLMN7PEWZYa Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="296186163" X-IronPort-AV: E=Sophos;i="5.96,171,1665471600"; d="scan'208";a="296186163" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2022 03:07:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="639763876" X-IronPort-AV: E=Sophos;i="5.96,171,1665471600"; d="scan'208";a="639763876" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 17 Nov 2022 03:07:55 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 464C82B7; Thu, 17 Nov 2022 13:08:20 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Mika Westerberg , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , Hans de Goede , Thierry Reding , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org Cc: Andy Shevchenko , Linus Walleij Subject: [PATCH v5 2/7] pwm: lpss: Rename MAX_PWMS --> LPSS_MAX_PWMS Date: Thu, 17 Nov 2022 13:08:01 +0200 Message-Id: <20221117110806.65470-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221117110806.65470-1-andriy.shevchenko@linux.intel.com> References: <20221117110806.65470-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749741389002029238?= X-GMAIL-MSGID: =?utf-8?q?1749741389002029238?= The MAX_PWMS definition is already being used by the PWM core. Using the same name in the certain driver confuses people and potentially can clash with it. Hence, rename it by adding LPSS prefix. Reported-by: Uwe Kleine-König Signed-off-by: Andy Shevchenko Acked-by: Thierry Reding Reviewed-by: Mika Westerberg Reviewed-by: Uwe Kleine-König --- drivers/pwm/pwm-lpss.c | 2 +- drivers/pwm/pwm-lpss.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pwm/pwm-lpss.c b/drivers/pwm/pwm-lpss.c index accdef5dd58e..b8739cd2c235 100644 --- a/drivers/pwm/pwm-lpss.c +++ b/drivers/pwm/pwm-lpss.c @@ -252,7 +252,7 @@ struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, void __iomem *base, int i, ret; u32 ctrl; - if (WARN_ON(info->npwm > MAX_PWMS)) + if (WARN_ON(info->npwm > LPSS_MAX_PWMS)) return ERR_PTR(-ENODEV); lpwm = devm_kzalloc(dev, sizeof(*lpwm), GFP_KERNEL); diff --git a/drivers/pwm/pwm-lpss.h b/drivers/pwm/pwm-lpss.h index 8e82eb5a7e00..2c746c51b883 100644 --- a/drivers/pwm/pwm-lpss.h +++ b/drivers/pwm/pwm-lpss.h @@ -13,7 +13,7 @@ #include #include -#define MAX_PWMS 4 +#define LPSS_MAX_PWMS 4 struct pwm_lpss_chip { struct pwm_chip chip; From patchwork Thu Nov 17 11:08:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 21568 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp338507wrr; Thu, 17 Nov 2022 03:10:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf4DqVF0OqPoqalbU98Xaeuh9CjXDR0pGVkmfWS1toew63LBkzbI0C1V5bgR4coAi9C2m0/y X-Received: by 2002:a17:902:e995:b0:186:ceff:f818 with SMTP id f21-20020a170902e99500b00186cefff818mr2379172plb.11.1668683419603; Thu, 17 Nov 2022 03:10:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668683419; cv=none; d=google.com; s=arc-20160816; b=m/15KSJ2T4DMPRRSCpQcQW57cOKY7+XSxH0WsmKk1LHbZBLG4MJKR1i8Wh3Vl3b/Z4 BcpDaRCILgDuykS7RFSzW8MKCzuibedIcUTFKVIhtvS7IUMxUVVCpQ8+ohJEpvrfLNk9 dB/kUUM4OlSFqcC7p2dNNhLhdYKCAfNW9ye/XnI5SHuKBv3lkBAXiohSMmpB15nTUJ2p A+jjkRUzElRc5YqYFhPzy+1WpGZ67IHyjt89uDXkAD/lSOnB56MIGwJ1I9ZtZMQnevaJ iSMAD2dRzbKzPHCGYdjy9uXpCnXuI3tZRqvBwfZbNOiugUSWuYMck7PnIMRdJ3BUdGKy G6ZA== 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=PrrblmvrX+fbz2eYuGDxK3QLINS3XTtGWbdCWhc/99I=; b=zFaAx0CRT5KAnfslEjZpuFxedyCua1Pl+oi77x97b+3MFsyP3GyrgFulBRqhQ7g3vQ MAYOapxh4BvYtBsiIlA/6vuoq6g4puDe+OSuzGgVJHvD8Vs6HAWhhWXFLCKJUQLgLdzn 7c80j8G+KvAuvMa3q4O6741DoYyJl1ZHusfc4ZFcMG0xyVUEpzQ9uodTgOfENixpZXHq 83Uq4fY0PIdxiJl04RNtVz+l2b8zIuMkx9Q3IT4DfpPpm0RFz5Q6abQXZFumecfTwJ+V tPZMlDcCJ5pM6xVzpG3VcB6djuCCBquG4YnRNCQSoKNS5S2hqC6sDpb9ge6HLlzmjPVG dl3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Hr/jsFW2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y24-20020a170902b49800b00186e8c3782esi672705plr.386.2022.11.17.03.10.04; Thu, 17 Nov 2022 03:10:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Hr/jsFW2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239820AbiKQLIZ (ORCPT + 99 others); Thu, 17 Nov 2022 06:08:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239833AbiKQLIG (ORCPT ); Thu, 17 Nov 2022 06:08:06 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1E0E5CD3B; Thu, 17 Nov 2022 03:07:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668683278; x=1700219278; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SenDKLm2OWKWrfbj90zOGSkRIvKF8vhA60ntFVPCAtE=; b=Hr/jsFW2Z9BY1Wa63nSdogE2815KJ3p7viEvIJ/mWr/pmvMK2j4AAUE6 i54GidH3knmwvWBek359c3/IfAFVG/6rZXdW8Zty655e95S6pvENMlbcA inSW5Fv8RnrJ2mNIt4pMG2rlTDY5OzjofKMm2jKHTsWwjusS0hpmgr6th HL9jPBrmYkXuY2PtcTWiINsckCNZoWPjnSl5ve2ZjT/ZOVJkenCzPUeUb 9Iof28iiLtof5aFOKof2W2LBawPb90ktxYhqji60Mfwy7VSSL8wa2w16O NEYgDqSDTT/7K2bS1KBx5n+2gnQJxTmUJKvTJlyKXuzhp5pAdoH63w2n2 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="314638719" X-IronPort-AV: E=Sophos;i="5.96,171,1665471600"; d="scan'208";a="314638719" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2022 03:07:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="617572338" X-IronPort-AV: E=Sophos;i="5.96,171,1665471600"; d="scan'208";a="617572338" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 17 Nov 2022 03:07:55 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id CECD0385; Thu, 17 Nov 2022 13:08:20 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Mika Westerberg , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , Hans de Goede , Thierry Reding , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org Cc: Andy Shevchenko , Linus Walleij Subject: [PATCH v5 3/7] pwm: lpss: Include headers we are the direct user of Date: Thu, 17 Nov 2022 13:08:02 +0200 Message-Id: <20221117110806.65470-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221117110806.65470-1-andriy.shevchenko@linux.intel.com> References: <20221117110806.65470-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749741385252430858?= X-GMAIL-MSGID: =?utf-8?q?1749741385252430858?= For the sake of integrity, include headers we are the direct user of. Replace the inclusion of device.h by a forward declaration of struct device plus a (cheaper) of types.h as device.h is an expensive include (measured in compiler effort). Signed-off-by: Andy Shevchenko Acked-by: Thierry Reding Reviewed-by: Mika Westerberg Reviewed-by: Hans de Goede Acked-by: Uwe Kleine-König --- drivers/pwm/pwm-lpss.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pwm/pwm-lpss.h b/drivers/pwm/pwm-lpss.h index 2c746c51b883..4ce6daa46ca8 100644 --- a/drivers/pwm/pwm-lpss.h +++ b/drivers/pwm/pwm-lpss.h @@ -10,8 +10,10 @@ #ifndef __PWM_LPSS_H #define __PWM_LPSS_H -#include #include +#include + +struct device; #define LPSS_MAX_PWMS 4 From patchwork Thu Nov 17 11:08:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 21575 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp338818wrr; Thu, 17 Nov 2022 03:11:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf6ABl84nhxCNfUi3Gh296nzHFDS5axtwq9kfOUyXheBZ/7aMavgBckwTK5GosAxCLAi5WNx X-Received: by 2002:a17:902:9897:b0:188:dd3d:ca0a with SMTP id s23-20020a170902989700b00188dd3dca0amr2213247plp.115.1668683468707; Thu, 17 Nov 2022 03:11:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668683468; cv=none; d=google.com; s=arc-20160816; b=OkdDzETKYuJH2sfyceJ9wmimXEU+yvW7C/scVg9qPfXZ5nB+M3y5A0PVzqWagLP5Ol B5A2NyAs9v949r9PnxOWpkd51sa43wY9RpxTMNFPaS4PjAlUmdZQVlIWpV2uMuzfdndB reb88GPiOBtpsiYGeR6OYyfCy3a4davwV9tibAlG7Uj7euGUmtkX8sDTKYU+SiqUm2iB CI/psVEpZAgq+vgOlrDwAOLtZzx03mTkcx+7mY6gUoXRbeFlQ6+AqgnMmqXAiCBORolP UW9ejW9gBVPLA7W6vElO2LFsem8pz0E7p+e9N/29vAURWnscPS1kM5T8v4Z+JqbJPZ/f QDkw== 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=Dz0S5niqOXadty6bQP955Zw11y+to8sN0kVc2Ai7LTY=; b=J9b1C9oSoiI8309QB/SBkc+Rwe2YykCqb3+4Vb7b6MEAbdqNe/iAadSaeVE1qYQAql /XztrUriabJqqDo7BAIJhTRQe4KXc4QDOXvyllOarLUIZLSLn2cokpOzaJ/zA28LM6SY eRZ6Qk4vHtYhVHJO0QkervzT8DzfbZJACVa6RGwPvHqf1pTJIj9F1NSkz1bt03ciA5cL qM7HNzMWRKhfbc3wlY+bIFoohhyhKAoaRoSWJJkcEs033pCE8KdgZei1fCloiRlCNYL5 e7vatmWb5Hm15vhglpjbIMTl0rsi58kISQL1V/YhIanYATis4ymuh+7eKH6nzO1+a6DH EdGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KsmephcQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f35-20020a635123000000b00461c9ed73b3si723009pgb.216.2022.11.17.03.10.55; Thu, 17 Nov 2022 03:11:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KsmephcQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239672AbiKQLJ1 (ORCPT + 99 others); Thu, 17 Nov 2022 06:09:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239772AbiKQLIQ (ORCPT ); Thu, 17 Nov 2022 06:08:16 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD7EE69DEA; Thu, 17 Nov 2022 03:08:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668683294; x=1700219294; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ozLU2nu1r74X7A+30A92Kia7Sm7wFG1fM/nv/pGjLco=; b=KsmephcQBHc2JuRbkPzilXlr0ownOD869HdRe1oQQE/bikFHgjxg5LPV W/50bSln3EgBuOOuRWJttOrvqJgNWiPxHW3Ms1A0897wvYutR8sxBAu7X 44GvzDnyeIe6v0VnzU5wKZ7L9x3eHwvTB/WuWEIYeYdcaUuS7P5eHF0Hm jSCGwawsIYZC9AhBPvqFaRBjRftccuP3eq4kcpA9ZNG2L6CG0pxAQO+mH bv/uYiami2ZhJ1a1bn1W20p/TlXknrYKHxV/3e2f3Wwurr4Vc7AigkAm7 TQuzVK/wtqJr2EH44APJ9IqwJ68UBFEGUGbS+vIoNVxkZgtlq9c4/6aJ2 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="313971564" X-IronPort-AV: E=Sophos;i="5.96,171,1665471600"; d="scan'208";a="313971564" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2022 03:08:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="639763983" X-IronPort-AV: E=Sophos;i="5.96,171,1665471600"; d="scan'208";a="639763983" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 17 Nov 2022 03:08:11 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 5E0E83B5; Thu, 17 Nov 2022 13:08:22 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Mika Westerberg , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , Hans de Goede , Thierry Reding , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org Cc: Andy Shevchenko , Linus Walleij Subject: [PATCH v5 4/7] pwm: lpss: Allow other drivers to enable PWM LPSS Date: Thu, 17 Nov 2022 13:08:03 +0200 Message-Id: <20221117110806.65470-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221117110806.65470-1-andriy.shevchenko@linux.intel.com> References: <20221117110806.65470-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749741436711366022?= X-GMAIL-MSGID: =?utf-8?q?1749741436711366022?= The PWM LPSS device can be embedded in another device. In order to enable it, allow that drivers to probe a corresponding device. Signed-off-by: Andy Shevchenko Acked-by: Thierry Reding Reviewed-by: Mika Westerberg Reviewed-by: Hans de Goede Acked-by: Uwe Kleine-König --- drivers/pwm/pwm-lpss.h | 22 +-------------- .../linux/platform_data/x86}/pwm-lpss.h | 28 ++++--------------- 2 files changed, 6 insertions(+), 44 deletions(-) copy {drivers/pwm => include/linux/platform_data/x86}/pwm-lpss.h (53%) diff --git a/drivers/pwm/pwm-lpss.h b/drivers/pwm/pwm-lpss.h index 4ce6daa46ca8..bf841250385f 100644 --- a/drivers/pwm/pwm-lpss.h +++ b/drivers/pwm/pwm-lpss.h @@ -13,7 +13,7 @@ #include #include -struct device; +#include #define LPSS_MAX_PWMS 4 @@ -23,29 +23,9 @@ struct pwm_lpss_chip { const struct pwm_lpss_boardinfo *info; }; -struct pwm_lpss_boardinfo { - unsigned long clk_rate; - unsigned int npwm; - unsigned long base_unit_bits; - /* - * Some versions of the IP may stuck in the state machine if enable - * bit is not set, and hence update bit will show busy status till - * the reset. For the rest it may be otherwise. - */ - bool bypass; - /* - * On some devices the _PS0/_PS3 AML code of the GPU (GFX0) device - * messes with the PWM0 controllers state, - */ - bool other_devices_aml_touches_pwm_regs; -}; - extern const struct pwm_lpss_boardinfo pwm_lpss_byt_info; extern const struct pwm_lpss_boardinfo pwm_lpss_bsw_info; extern const struct pwm_lpss_boardinfo pwm_lpss_bxt_info; extern const struct pwm_lpss_boardinfo pwm_lpss_tng_info; -struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, void __iomem *base, - const struct pwm_lpss_boardinfo *info); - #endif /* __PWM_LPSS_H */ diff --git a/drivers/pwm/pwm-lpss.h b/include/linux/platform_data/x86/pwm-lpss.h similarity index 53% copy from drivers/pwm/pwm-lpss.h copy to include/linux/platform_data/x86/pwm-lpss.h index 4ce6daa46ca8..296bd837ddbb 100644 --- a/drivers/pwm/pwm-lpss.h +++ b/include/linux/platform_data/x86/pwm-lpss.h @@ -1,27 +1,14 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -/* - * Intel Low Power Subsystem PWM controller driver - * - * Copyright (C) 2014, Intel Corporation - * - * Derived from the original pwm-lpss.c - */ +/* Intel Low Power Subsystem PWM controller driver */ -#ifndef __PWM_LPSS_H -#define __PWM_LPSS_H +#ifndef __PLATFORM_DATA_X86_PWM_LPSS_H +#define __PLATFORM_DATA_X86_PWM_LPSS_H -#include #include struct device; -#define LPSS_MAX_PWMS 4 - -struct pwm_lpss_chip { - struct pwm_chip chip; - void __iomem *regs; - const struct pwm_lpss_boardinfo *info; -}; +struct pwm_lpss_chip; struct pwm_lpss_boardinfo { unsigned long clk_rate; @@ -40,12 +27,7 @@ struct pwm_lpss_boardinfo { bool other_devices_aml_touches_pwm_regs; }; -extern const struct pwm_lpss_boardinfo pwm_lpss_byt_info; -extern const struct pwm_lpss_boardinfo pwm_lpss_bsw_info; -extern const struct pwm_lpss_boardinfo pwm_lpss_bxt_info; -extern const struct pwm_lpss_boardinfo pwm_lpss_tng_info; - struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, void __iomem *base, const struct pwm_lpss_boardinfo *info); -#endif /* __PWM_LPSS_H */ +#endif /* __PLATFORM_DATA_X86_PWM_LPSS_H */ From patchwork Thu Nov 17 11:08:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 21574 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp338691wrr; Thu, 17 Nov 2022 03:10:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf5dCI2vOJVlrFdjjgFh6jP5i0Aj8maxFoWRqmW2mMh+IH2UxXu9hi7+t9CU40zbpanqBfAf X-Received: by 2002:aa7:81cb:0:b0:56e:1092:1272 with SMTP id c11-20020aa781cb000000b0056e10921272mr2490507pfn.31.1668683446978; Thu, 17 Nov 2022 03:10:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668683446; cv=none; d=google.com; s=arc-20160816; b=qZxG3be8Eb2/U1t5FlutBrOfS5EtAGNYo1AfQ8DaZS61WBtGyv+tF4mdXKMFAwVtId P9aNtwIZ1mB/R6h7pit+1KK8PjdVupV+HmbMnr9NceUmXvUsR3LZiRXNQIArdN+S+O/t xxYa8vXib26mcUJ6b81ZuPWeCIqgsY0Q/n9JeOE3FSd1yp6vWOA106n9E6iDY944/xbp Xppyg83aqqm4AjyIi7IRM1kE5A2HGS47JHq0fbXA2ddJ9bn2QUz7U9U8RQKv9ezAtmMr qPknFuVPamXmU+HDZbcV5eDri4VyLS76rW3PixzV2XvR3N7Oot+i2g/+2YTH/k+rN/u1 Jt2A== 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=dyKYiK73NfWL7xJlf6zwRglUY7kvHdbwRzoXZ3nb8mg=; b=d0SvPQNGCxEf0Adzwds50PUubWCWlMdJVj0cRNF/BqsaDgvuuRf/kQxVTzQA1XFPYV KuTrMB3ZWIGT/1ZuIHejqss4G42Z7e9hAGjA9HoBkRXUJRKYuICWzBsIQcBNvX1/J1E7 UNX3Ibd+rzh1PpFs6oJ9dcvatKT325n1tFx0JdegLonOQro37NAQhXY7AletNaJjJOGy rKEzbjjXHoywViAOBFv1NJCiL+SGfXdjGryan31sKe5o+OeP+j9tzB9GTWpzL9JIVD/z xxdru4SgNANnK8Bs+7o1aJF0Mwo0Tgen9JyW9Q58+L1Lxve6HF/SCw1WQThiTgNvQPWr mi3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=V94tzEgi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b188-20020a6367c5000000b00476990d057asi701428pgc.472.2022.11.17.03.10.33; Thu, 17 Nov 2022 03:10:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=V94tzEgi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239891AbiKQLJM (ORCPT + 99 others); Thu, 17 Nov 2022 06:09:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239736AbiKQLIP (ORCPT ); Thu, 17 Nov 2022 06:08:15 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4075531FB3; Thu, 17 Nov 2022 03:08:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668683291; x=1700219291; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LBHKobpk/VhTDX4eSeyn9vK1zVXcs+GCnxTGHrxO5To=; b=V94tzEgi/ezsUIHZq+vGkaOsch6tpfBJ1jCptoi3UB8L3E8+9Txt6bsq ewqlA6oQVE0nFesmm11HhuzGERhBYOkZRJe2Dd/T2garH3KQiIr8+0TPm pBEbsS9TWm1eDxFcCBOVRyAPKfahtfSormwU/saAT27XuZ4zj03wRtrcf 57uKx2Rc12W5Pu0Ibr9pVdiRquBxv6mVDeCEq98yWfFaos65zkhB231x5 cHlAHf5mMpUIMJwsC/sf2mzuvg0TY2qUTzEb6cYC5LZvkNZ+himJNIWWb IM/SiNZqfqJP2pOhuEiLUqUTUXLnbn2uAGuPQrm0z/mCc8YgEc0/c9KrX A==; X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="296186172" X-IronPort-AV: E=Sophos;i="5.96,171,1665471600"; d="scan'208";a="296186172" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2022 03:08:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="639763892" X-IronPort-AV: E=Sophos;i="5.96,171,1665471600"; d="scan'208";a="639763892" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 17 Nov 2022 03:07:58 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 4725A41A; Thu, 17 Nov 2022 13:08:23 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Mika Westerberg , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , Hans de Goede , Thierry Reding , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org Cc: Andy Shevchenko , Linus Walleij Subject: [PATCH v5 5/7] pwm: lpss: Rename pwm_lpss_probe() --> devm_pwm_lpss_probe() Date: Thu, 17 Nov 2022 13:08:04 +0200 Message-Id: <20221117110806.65470-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221117110806.65470-1-andriy.shevchenko@linux.intel.com> References: <20221117110806.65470-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749741414430602457?= X-GMAIL-MSGID: =?utf-8?q?1749741414430602457?= The pwm_lpss_probe() uses managed resources. Show this to the users explicitly by adding devm prefix to its name. Signed-off-by: Andy Shevchenko Acked-by: Uwe Kleine-König --- drivers/pwm/pwm-lpss-pci.c | 2 +- drivers/pwm/pwm-lpss-platform.c | 2 +- drivers/pwm/pwm-lpss.c | 6 +++--- include/linux/platform_data/x86/pwm-lpss.h | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/pwm/pwm-lpss-pci.c b/drivers/pwm/pwm-lpss-pci.c index 98413d364338..b4134bee2863 100644 --- a/drivers/pwm/pwm-lpss-pci.c +++ b/drivers/pwm/pwm-lpss-pci.c @@ -30,7 +30,7 @@ static int pwm_lpss_probe_pci(struct pci_dev *pdev, return err; info = (struct pwm_lpss_boardinfo *)id->driver_data; - lpwm = pwm_lpss_probe(&pdev->dev, pcim_iomap_table(pdev)[0], info); + lpwm = devm_pwm_lpss_probe(&pdev->dev, pcim_iomap_table(pdev)[0], info); if (IS_ERR(lpwm)) return PTR_ERR(lpwm); diff --git a/drivers/pwm/pwm-lpss-platform.c b/drivers/pwm/pwm-lpss-platform.c index c48c6f2b2cd8..f350607e28bd 100644 --- a/drivers/pwm/pwm-lpss-platform.c +++ b/drivers/pwm/pwm-lpss-platform.c @@ -31,7 +31,7 @@ static int pwm_lpss_probe_platform(struct platform_device *pdev) if (IS_ERR(base)) return PTR_ERR(base); - lpwm = pwm_lpss_probe(&pdev->dev, base, info); + lpwm = devm_pwm_lpss_probe(&pdev->dev, base, info); if (IS_ERR(lpwm)) return PTR_ERR(lpwm); diff --git a/drivers/pwm/pwm-lpss.c b/drivers/pwm/pwm-lpss.c index b8739cd2c235..bb740346b699 100644 --- a/drivers/pwm/pwm-lpss.c +++ b/drivers/pwm/pwm-lpss.c @@ -244,8 +244,8 @@ static const struct pwm_ops pwm_lpss_ops = { .owner = THIS_MODULE, }; -struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, void __iomem *base, - const struct pwm_lpss_boardinfo *info) +struct pwm_lpss_chip *devm_pwm_lpss_probe(struct device *dev, void __iomem *base, + const struct pwm_lpss_boardinfo *info) { struct pwm_lpss_chip *lpwm; unsigned long c; @@ -284,7 +284,7 @@ struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, void __iomem *base, return lpwm; } -EXPORT_SYMBOL_GPL(pwm_lpss_probe); +EXPORT_SYMBOL_GPL(devm_pwm_lpss_probe); MODULE_DESCRIPTION("PWM driver for Intel LPSS"); MODULE_AUTHOR("Mika Westerberg "); diff --git a/include/linux/platform_data/x86/pwm-lpss.h b/include/linux/platform_data/x86/pwm-lpss.h index 296bd837ddbb..c852fe24fe2a 100644 --- a/include/linux/platform_data/x86/pwm-lpss.h +++ b/include/linux/platform_data/x86/pwm-lpss.h @@ -27,7 +27,7 @@ struct pwm_lpss_boardinfo { bool other_devices_aml_touches_pwm_regs; }; -struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, void __iomem *base, - const struct pwm_lpss_boardinfo *info); +struct pwm_lpss_chip *devm_pwm_lpss_probe(struct device *dev, void __iomem *base, + const struct pwm_lpss_boardinfo *info); #endif /* __PLATFORM_DATA_X86_PWM_LPSS_H */ From patchwork Thu Nov 17 11:08:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 21577 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp339012wrr; Thu, 17 Nov 2022 03:11:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf6fD+T+0LcovxKUYUBnpgJiMb+rgjcG/neuADILK5kCQbw4AnJ1Sdhrz9lGcsZ6sbVpOU+s X-Received: by 2002:a17:90b:1282:b0:214:1804:d96b with SMTP id fw2-20020a17090b128200b002141804d96bmr2276603pjb.90.1668683503858; Thu, 17 Nov 2022 03:11:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668683503; cv=none; d=google.com; s=arc-20160816; b=wYKMlk+m+/3AsgzMqp3h/uFQc2NPacxvRmRcnetUfN6zlctdsQZJDfhwWIbEt5yojD P5ePbByrU3ateK9ok6Iij1tP/amgZXky9qpgPr9tE9viO3fzgfUBNfMCUTors7RRYHlR T/EtjaFMHL3HsQ+poAlpdOFu0ryGKOSb+TJ+aXEiN585nwPaABmJAK30Yl5bN6bUiLOb xHMk0ib7gc1G0lrZmccT7h81vx571FhdEUu5y9nFaB63f5jdt6UIVt6R12FygwFM/xaO l48wT8bjyHfVht8YO7+lHJREI1gzTBZNXZzjxdeBTrUi6HAKxHqfdvrlJT/WRjXygAx9 ArjQ== 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=MFKxy3kbakFchJNSIPgMdW8uXCXs6zXv162PRaFFwHk=; b=NQE0be8MxVhjFdyKWVUF6DL2lSCafzonjy4kax/hoNFVuERRUBchT+wx+VQb4wQMfw rmUPqJotZUNMTStdUnjbz8mV7zK3SxHv+/nmoFc8F0Lnp3fIjBiyDm33nAA6NrUbP0kM T2+Xl1VrOb4lXrnZ5jLok6n3vDDTZuaDy/adnrhac/7YhYlnXqQqr60vs+EPF7pD752R 2V/2vxPQF2yIErgoZzQwS4VxvWrXfTF309yHnfB/VIvqzhYE9oBfuWh4OSXgn4ywLZzq SPKB/SIQhpoRwiAPZGmbOU9mXNNMTiywuimNmrMGnFS4IvB7aM69aSas1Jz/baFq817C eQyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Cwwbtuls; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c20-20020a6566d4000000b00476cc6391fcsi655082pgw.445.2022.11.17.03.11.27; Thu, 17 Nov 2022 03:11:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Cwwbtuls; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239783AbiKQLJg (ORCPT + 99 others); Thu, 17 Nov 2022 06:09:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239849AbiKQLII (ORCPT ); Thu, 17 Nov 2022 06:08:08 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03757450A7; Thu, 17 Nov 2022 03:08:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668683282; x=1700219282; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vb4Kjx+Zzgw7pJ7ccpP6XKDAM1GDRLtTdQAtD7V1YcM=; b=CwwbtulsbSftGJAX21u1zR9QCiyXrEL2fbOyIRrEVrpTRUVuCqi/TszF mziKyzTqaqfE2HxLeduDdpybGxFoL4MPOsZiGOmdvqQKryhYygk8URHfh HjZh4yGXFOfZyA3uHhpcC6ObLwdPE1IeZ0x6+1nBXtmJb07s303UmpMCh iogW+xpW/izq3wGLOVCUPI7U3Js/ggbCEQG87jAu/q/e1fH5R8r+hoZ5a b0iaDrq0O38k5fN2PM7q+lmHb3MDM7XqEupbCttZKI1iBYiyd4U5VIPcs bXEzXKaC70H/RnBwGH5vql7HX5FTTxPhrQnOzlB7sv8mKYRP6FLjxl0IV g==; X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="293218217" X-IronPort-AV: E=Sophos;i="5.96,171,1665471600"; d="scan'208";a="293218217" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2022 03:08:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="639763895" X-IronPort-AV: E=Sophos;i="5.96,171,1665471600"; d="scan'208";a="639763895" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 17 Nov 2022 03:07:58 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0214C2F3; Thu, 17 Nov 2022 13:08:23 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Mika Westerberg , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , Hans de Goede , Thierry Reding , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org Cc: Andy Shevchenko , Linus Walleij Subject: [PATCH v5 6/7] pwm: lpss: Add devm_pwm_lpss_probe() stub Date: Thu, 17 Nov 2022 13:08:05 +0200 Message-Id: <20221117110806.65470-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221117110806.65470-1-andriy.shevchenko@linux.intel.com> References: <20221117110806.65470-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749741473671210401?= X-GMAIL-MSGID: =?utf-8?q?1749741473671210401?= In case the PWM LPSS module is not provided, allow users to be compiled with the help of the devm_pwm_lpss_probe() stub. Signed-off-by: Andy Shevchenko Acked-by: Thierry Reding Reviewed-by: Mika Westerberg --- include/linux/platform_data/x86/pwm-lpss.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/linux/platform_data/x86/pwm-lpss.h b/include/linux/platform_data/x86/pwm-lpss.h index c852fe24fe2a..6ef21b8baec7 100644 --- a/include/linux/platform_data/x86/pwm-lpss.h +++ b/include/linux/platform_data/x86/pwm-lpss.h @@ -4,6 +4,8 @@ #ifndef __PLATFORM_DATA_X86_PWM_LPSS_H #define __PLATFORM_DATA_X86_PWM_LPSS_H +#include +#include #include struct device; @@ -27,7 +29,16 @@ struct pwm_lpss_boardinfo { bool other_devices_aml_touches_pwm_regs; }; +#if IS_REACHABLE(CONFIG_PWM_LPSS) struct pwm_lpss_chip *devm_pwm_lpss_probe(struct device *dev, void __iomem *base, const struct pwm_lpss_boardinfo *info); +#else +static inline +struct pwm_lpss_chip *devm_pwm_lpss_probe(struct device *dev, void __iomem *base, + const struct pwm_lpss_boardinfo *info) +{ + return ERR_PTR(-ENODEV); +} +#endif /* CONFIG_PWM_LPSS */ #endif /* __PLATFORM_DATA_X86_PWM_LPSS_H */ From patchwork Thu Nov 17 11:08:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 21573 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp338684wrr; Thu, 17 Nov 2022 03:10:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf7fCWu8QbF/fJfe/4SXlDnob0mDy06sZZ7eg6tN4rmZokeVdvAxZUf2yTtrRBtDu2+3B57j X-Received: by 2002:a63:4d5e:0:b0:42a:babf:9f1f with SMTP id n30-20020a634d5e000000b0042ababf9f1fmr1576746pgl.324.1668683445887; Thu, 17 Nov 2022 03:10:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668683445; cv=none; d=google.com; s=arc-20160816; b=qLpyDDf3v2auaDLQrT221WNWMNbN3Tyo6wiOI+N3Y0IJZ1Pg2bycpgyc0GWuMuwhxg U3KDxtHE37MFnUk3sRqDE2XszKTHl0GIf3qOz+uCQzZDxxW0JXIrCJFrHD59q4n/Kjza Gn6r+NVOnlL6GV/qCD3JuVCaSGqIfEuP0uUgbfRqTAg2l2EYoFVRCQlJEGJDmJw3nPA9 dFtkaIz3/fikl6D8WrnsnJtKYtbCr9QyfECR6uz1DG9d9AeM8C8mBs2al5o1Ah4nqVbl i6OjCtsB/Ls1zIUGXS+8l4AryR0GHGYNvRY4t5i5haSx+HGz+YC1tKpvAEWPYsbLCNPx wsDw== 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=DSMDM/jUdcuOG5Jq6xtLM3Ua4N4Aa+WT8xuEY501hTM=; b=U8GNRvkwyQwj0PxdWsm0XRAgCycraJtXhWqCJ1P5+WgvaaT9kuguFw5x0l9pDeBEo6 Jq306CmsjXPmA7O1TxVBYLqq2KVIZ8Fsx2YP8AZiYqBz/hpjfzKU8FaKWpaQpaQuqY+o 01JPXgVVILUp4u2aElunRj4owcPv1lStfltEtPw8Qg2f47cI5Gk7bDpWrALlU6x6+zQN Dsck82IhVDfQN/Aj1mbFASnPZY/trxp4bK9p7cPQ6CKqMVo3V5XeZ/GvaoNtDo3C4LiE SGU9Z0f19G8MZqgk6h2bWthweh1TqysxmI1XHp8ak6vk9qx8YjkAwIxwQVl7N6DkPJY/ 4y8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=R+iJ5Cvo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v25-20020a637a19000000b0047715878e0dsi86573pgc.298.2022.11.17.03.10.32; Thu, 17 Nov 2022 03:10:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=R+iJ5Cvo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239667AbiKQLJG (ORCPT + 99 others); Thu, 17 Nov 2022 06:09:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239848AbiKQLII (ORCPT ); Thu, 17 Nov 2022 06:08:08 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 317095C74F; Thu, 17 Nov 2022 03:08:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668683282; x=1700219282; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RK+XGHZ2BELVVYkxCYeGM6RfxC8qsuOPoluHIaCRq2s=; b=R+iJ5Cvo2Mki1IeRdhrlzG7Eu5NnQ6aEVYbVUCy5L5fXluZerCkwd8+r 9GKChPwrLeju5+dy0T2TNJEOYx4hEipV+XDBKjJ0Y7f0USWzipBfXaYwX UkePNZBJsMYmb3KNSvaUhyz/VEgNbkbvogjM5YktSTtS/4jz5MkIv0h7f aFgZK/vLqxrZ+GVl9qBX18+VPsvA//poqAN2x5IdiyR1tzvkEt1pdVft4 VtFdOdTwItiEwicb61V/M7J+H6dYr9wXUQbY3q2MRYYXN0QA3dQYC+qJd JFk7bSukzzWKIinkCLEsPpQi6Q4EodErZSImjf8b6hPLRt9rSDUN9BSIr Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="314638732" X-IronPort-AV: E=Sophos;i="5.96,171,1665471600"; d="scan'208";a="314638732" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2022 03:08:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="617572346" X-IronPort-AV: E=Sophos;i="5.96,171,1665471600"; d="scan'208";a="617572346" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 17 Nov 2022 03:07:59 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 99CDF2B7; Thu, 17 Nov 2022 13:08:24 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Mika Westerberg , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , Hans de Goede , Thierry Reding , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org Cc: Andy Shevchenko , Linus Walleij Subject: [PATCH v5 7/7] pinctrl: intel: Enumerate PWM device when community has a capability Date: Thu, 17 Nov 2022 13:08:06 +0200 Message-Id: <20221117110806.65470-8-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221117110806.65470-1-andriy.shevchenko@linux.intel.com> References: <20221117110806.65470-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749741412825725902?= X-GMAIL-MSGID: =?utf-8?q?1749741412825725902?= Some of the Communities may have PWM capability. In such cases, enumerate the PWM device via respective driver. A user is still responsible for setting correct pin muxing for the line that needs to output the signal. Signed-off-by: Andy Shevchenko Acked-by: Thierry Reding Reviewed-by: Mika Westerberg Acked-by: Linus Walleij Acked-by: Uwe Kleine-König --- drivers/pinctrl/intel/pinctrl-intel.c | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c index 52ecd66ce357..d74c8b650aa7 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c @@ -21,6 +21,8 @@ #include #include +#include + #include "../core.h" #include "pinctrl-intel.h" @@ -46,6 +48,8 @@ #define PADOWN_MASK(p) (GENMASK(3, 0) << PADOWN_SHIFT(p)) #define PADOWN_GPP(p) ((p) / 8) +#define PWMC 0x204 + /* Offset from pad_regs */ #define PADCFG0 0x000 #define PADCFG0_RXEVCFG_SHIFT 25 @@ -1499,6 +1503,27 @@ static int intel_pinctrl_pm_init(struct intel_pinctrl *pctrl) return 0; } +static int intel_pinctrl_probe_pwm(struct intel_pinctrl *pctrl, + struct intel_community *community) +{ + static const struct pwm_lpss_boardinfo info = { + .clk_rate = 19200000, + .npwm = 1, + .base_unit_bits = 22, + .bypass = true, + }; + struct pwm_lpss_chip *pwm; + + if (!(community->features & PINCTRL_FEATURE_PWM)) + return 0; + + if (!IS_REACHABLE(CONFIG_PWM_LPSS)) + return 0; + + pwm = devm_pwm_lpss_probe(pctrl->dev, community->regs + PWMC, &info); + return PTR_ERR_OR_ZERO(pwm); +} + static int intel_pinctrl_probe(struct platform_device *pdev, const struct intel_pinctrl_soc_data *soc_data) { @@ -1584,6 +1609,10 @@ static int intel_pinctrl_probe(struct platform_device *pdev, ret = intel_pinctrl_add_padgroups_by_size(pctrl, community); if (ret) return ret; + + ret = intel_pinctrl_probe_pwm(pctrl, community); + if (ret) + return ret; } irq = platform_get_irq(pdev, 0);