Received: by 10.223.185.116 with SMTP id b49csp1838467wrg; Thu, 22 Feb 2018 04:05:47 -0800 (PST) X-Google-Smtp-Source: AH8x225MLptVYp9/9Kt70gzjUTepEYNLFqHqQ4Ip0sdPbva0TRSAx321RPkHg8DLjEAZiiNxR66p X-Received: by 2002:a17:902:bd89:: with SMTP id q9-v6mr6543439pls.172.1519301147656; Thu, 22 Feb 2018 04:05:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519301147; cv=none; d=google.com; s=arc-20160816; b=W98MFbeV3INn8kTFwlRxrjJ1ghlIKOUdz+UX3hc0KMbS4k0k8vSIlY4ZTuWF4AoNLp lX0bMWhBgxEsO4qzxuAuHJld/5qEMIt/Zmiq7N8QXboV0UaFMItjS3w/iw9xqVWVZXqM TDoVfTBUcN1nn94XOH8UfwXRMMssLkHb197Vyq805Nr9x+DKOaBBbmbv5Y/CBVjMWgz8 QitJbA9PeMxuMG34qfDts0/pwZmAJloZ6bVrofnhBc4HJpKC7Zj1wps7ERm8lU1SQGwU 3k4JP6ZP4rREjcTZv1flTH15GLr7msHow4otxyZX7n+750QPnVDtrOq0AYTRRvUhJAt3 qkWA== 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=wsNaFYnnU9DlX+jFgjH6rdbRZn3Q71x6K+n43A3wZ0c=; b=T8Dmpfz5W+ZdCL2VrEpXd/gmRa3DdCrQ1ngH6qwjNq9RlnbNfTmBz1rR+B6LzRIuAP rZnS6izBPBmZ2xIM8uUX/aDy4Cwf3iFCLI5Hfum8Xzacb7wP2ED3HcxbbOJ2By1JY6BG bzcTsspeAVZqyOC2r6Aoh9RpdVd14YsvPvI62gIIzcazLA4cFYcXlM/WTUQBROzRngFS 6KlzmEYCGOY5qy4q4hlsLPVMS5LF3FJ6oVtq7bwoQ9ZcrbfP4JBtfTXvu/8tyFJ5j67P esfVt09NEBVy/DlGb6nYaVF+qq3Yu8SFdti22H+PAdTNib4EmNIRf/CneQrX9NxXlBJJ yGIQ== 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 c13si5234394pgn.696.2018.02.22.04.05.07; Thu, 22 Feb 2018 04:05:47 -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 S932293AbeBVMDW (ORCPT + 99 others); Thu, 22 Feb 2018 07:03:22 -0500 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:57741 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932121AbeBVMDP (ORCPT ); Thu, 22 Feb 2018 07:03:15 -0500 X-IronPort-AV: E=Sophos;i="5.46,543,1511852400"; d="scan'208";a="9043032" 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:14 -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:13 -0700 From: Claudiu Beznea To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , , , , , , , , , , , , , Claudiu Beznea Subject: [PATCH v3 04/10] pwm: pxa: populate PWM mode in of_xlate function Date: Thu, 22 Feb 2018 14:01:15 +0200 Message-ID: <1519300881-8136-5-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-pxa.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c index 4143a46684d2..7a035716e054 100644 --- a/drivers/pwm/pwm-pxa.c +++ b/drivers/pwm/pwm-pxa.c @@ -155,12 +155,16 @@ static struct pwm_device * pxa_pwm_of_xlate(struct pwm_chip *pc, const struct of_phandle_args *args) { struct pwm_device *pwm; + struct pwm_caps caps; pwm = pwm_request_from_chip(pc, 0, NULL); if (IS_ERR(pwm)) return pwm; + pwm_get_caps(pc, pwm, &caps); + pwm->args.period = args->args[0]; + pwm->args.mode = BIT(ffs(caps.modes) - 1); return pwm; } -- 2.7.4