Received: by 10.223.185.116 with SMTP id b49csp1841240wrg; Thu, 22 Feb 2018 04:08:15 -0800 (PST) X-Google-Smtp-Source: AH8x226BKzbqteWt70sOE4AIGw/ePSHFfT5WbIe6/rlanzf5W8OqxhvluGjHMyC9CF6N1HIssJRo X-Received: by 2002:a17:902:be02:: with SMTP id r2-v6mr6486186pls.234.1519301294941; Thu, 22 Feb 2018 04:08:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519301294; cv=none; d=google.com; s=arc-20160816; b=HDMLnT6S9fWabA9yvJQnMZkNVrfRxzeBwsndefFim35vXDwsJ5DlI7NcS+R1E9p/7T qTXYBpBfBYJtkBHbFc5meB1qG1Dmi7i3oUzCix4lparHXjesArEfv2wjqrdOX7GNaI5J 9vyVl9Nw/ORGYkXxIGQCLrviQorD0FJyl3MrOw/I3Sdz7O8M7UrwXjHOLPcBHIeDEsBW BrREyHolVdY8Cf5ifVmmWckJ7dv5+MrdnpF5Fmst8TFFya3a8Qkdxqo8SLdasaC66E7Q gSlejx+oCE84WJ7QvuUzfAo8dXvTHtmqozXf5HyTHk2zvfbEVr4ao+fLVWRJZrA+iNt3 kw2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=haweIvEdsIV52uTH8Rqg7Hynb3OZSpRatVUuXJadoy0=; b=oItkAH5Lbefcv7uJSitB7TPn+slQ6EzKv8oDyi1p8rIuXK3UBYipxNmjZ7rQ90ZKAg zxZpGpWaLIsKOQVgjh0hfgfaNKvmX2NjpQuB2yVBEsPW7DlM2DxyIBOa1iZOP/QhQXOh sQ+Slr9mQYvFQNB7UN9w9+60IHO5GgYnM2ec1AE7x3A70CFLTmNIDdaLlaVC3MnZtfcq PyehEgZiUTt+EGoYibP/xC7v5+ZxQKYiEFZrb1m+luG7qQvWoeBlPsE0wKIzXVlYVFC0 GpZvmxEj2uNGdQEMX3xgUig8mUW9gt1CytmxU+9Xr6wP25zCBCVP8lc078UV+DAs8WI+ YhJA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m21si4355919pfg.367.2018.02.22.04.08.00; Thu, 22 Feb 2018 04:08:14 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753778AbeBVMDK (ORCPT + 99 others); Thu, 22 Feb 2018 07:03:10 -0500 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:57713 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932121AbeBVMDG (ORCPT ); Thu, 22 Feb 2018 07:03:06 -0500 X-IronPort-AV: E=Sophos;i="5.46,543,1511852400"; d="scan'208";a="9043020" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Feb 2018 05:03:04 -0700 Received: from m18063-ThinkPad-T460p.microchip.com (10.10.76.4) by chn-sv-exch05.mchp-main.com (10.10.76.106) with Microsoft SMTP Server id 14.3.352.0; Thu, 22 Feb 2018 05:03:04 -0700 From: Claudiu Beznea To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , , , , , , , , , , , , , Claudiu Beznea Subject: [PATCH v3 03/10] pwm: cros-ec: populate PWM mode in of_xlate function Date: Thu, 22 Feb 2018 14:01:14 +0200 Message-ID: <1519300881-8136-4-git-send-email-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519300881-8136-1-git-send-email-claudiu.beznea@microchip.com> References: <1519300881-8136-1-git-send-email-claudiu.beznea@microchip.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Populate PWM mode in of_xlate function to avoid pwm_apply_state() failure. Signed-off-by: Claudiu Beznea --- drivers/pwm/pwm-cros-ec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pwm/pwm-cros-ec.c b/drivers/pwm/pwm-cros-ec.c index 9c13694eaa24..e54954c13323 100644 --- a/drivers/pwm/pwm-cros-ec.c +++ b/drivers/pwm/pwm-cros-ec.c @@ -137,6 +137,7 @@ static struct pwm_device * cros_ec_pwm_xlate(struct pwm_chip *pc, const struct of_phandle_args *args) { struct pwm_device *pwm; + struct pwm_caps caps; if (args->args[0] >= pc->npwm) return ERR_PTR(-EINVAL); @@ -145,8 +146,11 @@ cros_ec_pwm_xlate(struct pwm_chip *pc, const struct of_phandle_args *args) if (IS_ERR(pwm)) return pwm; + pwm_get_caps(pc, pwm, &caps); + /* The EC won't let us change the period */ pwm->args.period = EC_PWM_MAX_DUTY; + pwm->args.mode = BIT(ffs(caps.modes) - 1); return pwm; } -- 2.7.4