From patchwork Thu Aug 15 12:11:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Stols X-Patchwork-Id: 819817 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D47317BEB4 for ; Thu, 15 Aug 2024 12:12:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723723932; cv=none; b=epa/d5PehkKpMCUSTG/dYyAI8UhvkSQpB2/5hXrLJem+g8z10hB7j8Jj5R/mWI2zmhjmyibKl1CfNpytM2Wy4rHcznbVdznEPAsFiyQ0yZsTuIhZf+9ztw4U2QU0WPPgCEgWn2BztDc9yvy/NBX2i8d1/MJBw1yxRTOlAjRlDzw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723723932; c=relaxed/simple; bh=B299RubzcyeAZYqSINS1JMw78PJqVT8lqVWbm+KhLHQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hjSCLHn3vpLr/yT8LeeVYYEkHOXwl7n6GOEpB2/TaTPe6ntyIdwbCedn9askS+3M4bvBJOFiJjqYAxvN/NNtritWEBQJ9iGC/lnLHYthMVrOI0U8E5I0PX4wnX3MbCf1NJ3mWsWuqKrjeU1EumTNt92yiS+2kZZPMCiOIygr4NA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=ZEmvrITb; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="ZEmvrITb" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4280c55e488so4341555e9.0 for ; Thu, 15 Aug 2024 05:12:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1723723927; x=1724328727; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=aIfifid+gNmxqdjRD2+a9HhTRK2zF1nl/3in+BtGhPo=; b=ZEmvrITbVbmkcj5jQFb/DuAQwP1GSlJcJyhT1Fo9l4OWrmQsUIA0CmstuSK+C4nn4e +maA6XI7ioCWHKIng9ypRFOTs3scA6NFtiQEyI0EVF/cRoVxaRzgbBgVrcw7DaDS4jN9 WakjrUmtwTS8NC/it8wu2LI5mD6OYwLVtNNV9mevmY9sbrKhxARZU1EjahEuGFluMbKP t6xqHFCqUiReiLzDXOvfTLOAgXmoXEw7VRRKggIhGkJQ0M7UJi2vTLSwXXcIgjy9H1Dl yvxRVv7Qex+W37iTWCuWu/PAxmZ4FdoU3dM5U1nGsNAkckTVLbK/UAMsFRPzqvdsRB1+ Zz8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723723927; x=1724328727; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aIfifid+gNmxqdjRD2+a9HhTRK2zF1nl/3in+BtGhPo=; b=xJx59EdD2Zi0WOCwbyKxD+IwRxODIL165+IpiS74XWGqRaKOD7SXmJmvmcg9uaAcrt qGNYxntCqdlj9WRSekTxuzJzyLaPCD4lcLWNzqcVJxiqrpWwf+RD7vwiQ0D73869khCb U5dpteqoMhSbjibEmP4HvXpws8GKcgkJg7bLLFhQdumKysCfgPOsAGB4aaRwEzRMUFMy nVnU4jsYLY7/nCRq2lSi1K85p63tm6WP/bi3Hwn8QjTr04YwxD5lY1szSKcsbfmOw0hD Xa3I0RnrzzlPaOSBeCHahRe/WtgHCAmQMzCBe+PrsXDQ53FSnHStu742cZOSatLazclc KqNw== X-Forwarded-Encrypted: i=1; AJvYcCWIfiLdSoCO10egrQ+iSk0UNcKkqYoBEMluSEtBLxQ/hLuvwwV4dSXI2TpeU8XhkatKcZTFUjD6eakX6GRxInB4jYLsw6ejygLAadM= X-Gm-Message-State: AOJu0Yz+8zcoQh4mxXnWNLLMB73/yGPGHP2rRB4kTkJcLfmP3yZ9YMr1 1qtRH/QlSnSBTwYW7I8/jWQWu6PbBUY4H3ZgfLKTDvzjBMX3BGf2jsHDjDAt5kQ= X-Google-Smtp-Source: AGHT+IEuybZDakhKeQ5LH52V3RpeDuVw/uxz9FrF2X2Ngvg5W3lc4Fx9NnyZt1280p66tj9dqkB9jg== X-Received: by 2002:a05:600c:348b:b0:424:8be4:f2c with SMTP id 5b1f17b1804b1-429e231f76dmr18552725e9.2.1723723927027; Thu, 15 Aug 2024 05:12:07 -0700 (PDT) Received: from [127.0.1.1] (frhb82016ds.ikexpress.com. [185.246.87.17]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37189897926sm1365082f8f.87.2024.08.15.05.12.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 05:12:06 -0700 (PDT) From: Guillaume Stols Date: Thu, 15 Aug 2024 12:11:58 +0000 Subject: [PATCH 4/8] pwm: Export pwm_get_state_hw Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240815-ad7606_add_iio_backend_support-v1-4-cea3e11b1aa4@baylibre.com> References: <20240815-ad7606_add_iio_backend_support-v1-0-cea3e11b1aa4@baylibre.com> In-Reply-To: <20240815-ad7606_add_iio_backend_support-v1-0-cea3e11b1aa4@baylibre.com> To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Greg Kroah-Hartman , "Rafael J. Wysocki" , Jonathan Corbet Cc: linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Hennerich , linux-fbdev@vger.kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, Guillaume Stols , 20240705211452.1157967-2-u.kleine-koenig@baylibre.com, 20240712171821.1470833-2-u.kleine-koenig@baylibre.com, cover.1721040875.git.u.kleine-koenig@baylibre.com, aardelean@baylibre.com X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1723723923; l=1631; i=gstols@baylibre.com; s=20240417; h=from:subject:message-id; bh=B299RubzcyeAZYqSINS1JMw78PJqVT8lqVWbm+KhLHQ=; b=R0SYVR5ABChT/agrkOGtqE560UOP8iseJdjHPPNT794iaKR5TkwlROnIsf6vbGNXL+qEbca08 3vR+WhJM5zGB++xcBB8es5v4vgNmrPQDw8zW1fS8VOXM6g+CfvJksiB X-Developer-Key: i=gstols@baylibre.com; a=ed25519; pk=XvMm5WHuV67sGYOJZqIYzXndbaJOlNd8Q6li6vnb4Cs= This function can be used in some other drivers, for instance when we want to retrieve the real frequency vs the one that was asked. Signed-off-by: Guillaume Stols --- drivers/pwm/core.c | 3 ++- include/linux/pwm.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 21fca27bb8a3..82e05ed88310 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -651,7 +651,7 @@ int pwm_apply_atomic(struct pwm_device *pwm, const struct pwm_state *state) } EXPORT_SYMBOL_GPL(pwm_apply_atomic); -static int pwm_get_state_hw(struct pwm_device *pwm, struct pwm_state *state) +int pwm_get_state_hw(struct pwm_device *pwm, struct pwm_state *state) { struct pwm_chip *chip = pwm->chip; const struct pwm_ops *ops = chip->ops; @@ -685,6 +685,7 @@ static int pwm_get_state_hw(struct pwm_device *pwm, struct pwm_state *state) return ret; } +EXPORT_SYMBOL_GPL(pwm_get_state_hw); /** * pwm_adjust_config() - adjust the current PWM config to the PWM arguments diff --git a/include/linux/pwm.h b/include/linux/pwm.h index fd100c27f109..d48ea3051e28 100644 --- a/include/linux/pwm.h +++ b/include/linux/pwm.h @@ -369,6 +369,7 @@ int pwm_apply_might_sleep(struct pwm_device *pwm, const struct pwm_state *state) int pwm_apply_atomic(struct pwm_device *pwm, const struct pwm_state *state); int pwm_adjust_config(struct pwm_device *pwm); +int pwm_get_state_hw(struct pwm_device *pwm, struct pwm_state *state); /** * pwm_config() - change a PWM device configuration * @pwm: PWM device