Received: by 10.213.65.68 with SMTP id h4csp546096imn; Fri, 30 Mar 2018 10:26:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx49sHJw16u8f+0IbNhyh6JL5n/rvY7cvKQBIedHE/B/THBt1LEIVsDGEkX4QEzTX5iPIYmkP X-Received: by 2002:a17:902:b617:: with SMTP id b23-v6mr13549258pls.191.1522430765654; Fri, 30 Mar 2018 10:26:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522430765; cv=none; d=google.com; s=arc-20160816; b=Q2vvb9VqOE4lGKnNWKF2XFgTzQL0bx3S/5JxgUnsbzYm398yojHNcH/CxySJCAL48L VM7SV7HO4tR8IJ960GemzF4xEJuVsLPezjLg+KEipuaQcNgxr0UZ/33kKj4x+y678oWP Lxut6/t8V1HKKlQTf1QAAVoDC/Nw8SROZEQ2ukxfq0p9W/SRVTDES4P800FKtqbKuiVc bxdNRtwsfPO7CuuHTJoDtdVqd+Z8KH27UozRU5nvNzhGr8n8c+5yBoUZpmu+gpCaZqUf QP7hSPqSzQvmKsd0UFJmK5wfdw5lvweJJGZF7HE8WVbNDSWZQtaI28oBl5B0a5msGI9A 0V3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=kes3yZkfL3QxSmBH+i5RVSQgVOtivge+sgZvHXKzw3g=; b=BKvUgwWHYEedjwnYAMAZwroa5LaPG+jvB4fdDVz7+cGZavhI+c9swRTSp6X6F5tcWx cLE+SXtfIUb8oMlL65uVNwBYo8KzpKuClvs6C0AOfy/8vvMYkR6sDYDnYCKL4Aa8I9L7 OlkGlRBQQrAMqIa5UBzs/LFI+g+cJrhP0c/WyggQMdPuV1MGzKTCVImZtZOzY/XNY0Kp 0dOzP1s7aO9UQPVRR+Uk7ydyA9m2UBRGI/isBucq9mb3ql2ThPex3XYxDeHqeF8Np0jT aOhhgB/m8UG0dxrJ2M7XMO5wJTPEOGq1J95ZhFmO58TP9JESgqQ+lHz/Z/Hcj14uiqAS hQwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l7-v6si9095225plt.89.2018.03.30.10.25.52; Fri, 30 Mar 2018 10:26:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752673AbeC3RYk (ORCPT + 99 others); Fri, 30 Mar 2018 13:24:40 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:58950 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752431AbeC3RYg (ORCPT ); Fri, 30 Mar 2018 13:24:36 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 32A6F260BD3 From: Sebastian Reichel To: Sebastian Reichel , Milo Kim , Lee Jones , Daniel Thompson , Rob Herring , Tony Lindgren Cc: Jingoo Han , Mark Rutland , linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, devicetree@vger.kernel.org, linux-omap@vger.kernel.org, Sebastian Reichel Subject: [PATCHv4 06/10] mfd: ti-lmu: add PWM support Date: Fri, 30 Mar 2018 19:24:10 +0200 Message-Id: <20180330172414.26575-7-sebastian.reichel@collabora.co.uk> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180330172414.26575-1-sebastian.reichel@collabora.co.uk> References: <20180330172414.26575-1-sebastian.reichel@collabora.co.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds support to acquire the optional PWM channel, that can be used by some of the LMU variants. Signed-off-by: Sebastian Reichel --- drivers/mfd/ti-lmu.c | 11 +++++++++++ include/linux/mfd/ti-lmu.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/drivers/mfd/ti-lmu.c b/drivers/mfd/ti-lmu.c index ce16c896879b..f43b8acc30e1 100644 --- a/drivers/mfd/ti-lmu.c +++ b/drivers/mfd/ti-lmu.c @@ -183,6 +183,17 @@ static int ti_lmu_probe(struct i2c_client *cl, const struct i2c_device_id *id) return ret; } + lmu->pwm = devm_pwm_get(dev, "lmu-backlight"); + if (IS_ERR(lmu->pwm)) { + ret = PTR_ERR(lmu->pwm); + if (ret != -EINVAL) { + dev_err(dev, "Failed to get PWM: %d\n", ret); + return ret; + } + + lmu->pwm = NULL; + } + ret = ti_lmu_enable_hw(lmu, id->driver_data); if (ret) return ret; diff --git a/include/linux/mfd/ti-lmu.h b/include/linux/mfd/ti-lmu.h index 1ef51ed36be5..246ab5145dff 100644 --- a/include/linux/mfd/ti-lmu.h +++ b/include/linux/mfd/ti-lmu.h @@ -17,6 +17,7 @@ #include #include #include +#include /* Notifier event */ #define LMU_EVENT_MONITOR_DONE 0x01 @@ -77,12 +78,14 @@ enum lm363x_regulator_id { * @dev: Parent device pointer * @regmap: Used for i2c communcation on accessing registers * @en_gpio: GPIO for HWEN pin [Optional] + * @pwm: PWM for module [Optional] * @notifier: Notifier for reporting hwmon event */ struct ti_lmu { struct device *dev; struct regmap *regmap; struct gpio_desc *en_gpio; + struct pwm_device *pwm; struct blocking_notifier_head notifier; }; #endif -- 2.16.2