Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp12716ybk; Tue, 12 May 2020 13:55:20 -0700 (PDT) X-Google-Smtp-Source: APiQypK/bWwbBe9mnHp1DXgx2UoTvvIBWQVC/y1VoRdbm13RWzGFV4GMhb0xKvpa7xwvNt8xswwN X-Received: by 2002:a17:906:f98f:: with SMTP id li15mr14874271ejb.259.1589316920780; Tue, 12 May 2020 13:55:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589316920; cv=none; d=google.com; s=arc-20160816; b=D/vLQjK/SNhTRPklTYXDV9+D1ZSXlM+I7tzmxJLtAkin11ZgKwSSgurYfCQYVRs0gs cTNWG4YARdYJ3MhVUbZuXXCc+NHJIICW1eLz/GUkPVKVDgGeFoEIzTw1RXCHA/TxPQU9 ZW9LRC0TGC5/JYscw5CHn0jrz+anN2/XtUfKqhlFmuwiFX7QUB6DfpeYDUnyHdBBHJKL Z0bXobcdaGTUd97RMrruF1HToZCi9NK2mpAzMxpYUi++HYZbwYY26yZcJSBLJVJ7V6TS 0DfPJWV2s2+EdeRFY4AMjMlNPHkNjLl2DXRByWGKaBONF2rlsBny143qpN7vKFJ3ImNz vUcg== 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:dkim-signature; bh=OyS6mmNv0q65u62hC5nV/TgLYdLkGis5cCl6PdzqkEw=; b=Y312/KYppD9YfjqD5A8yX8I5yrD+yIKpN/VXWZVxyADgjMTm8xAwdFqI5IhFWiv2ab VCU+l+fxyXoQ+zr1l8+7YsLg67Nn5m4P3oHjAae/ZIsBb0lFr4WwcTHVN6lCvsFMj+Dk tUFAjyYoTuZJMnswLZFC43BEMTZxPr0QKAqzO/FFHSlLSkVEef9Xb3U8Mnbekrn7tzY/ fXMz+tc/svj4yYTJaQ1UeQC/kupSovkVnn6ec7HoNTk3bHNP5VU3QQAdABoN6h09AkMf JwVxX9ZQnb2OgcuIVqOWK+i5qTHmzKHwhEChBly8+LdR2vc4gRvOsLoqWGXVpkqAcJMc /jDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RDTWOYNZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o6si9328219edz.574.2020.05.12.13.54.57; Tue, 12 May 2020 13:55:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RDTWOYNZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731191AbgELUxY (ORCPT + 99 others); Tue, 12 May 2020 16:53:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725938AbgELUxW (ORCPT ); Tue, 12 May 2020 16:53:22 -0400 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45270C061A0C; Tue, 12 May 2020 13:53:22 -0700 (PDT) Received: by mail-qk1-x742.google.com with SMTP id f83so15144653qke.13; Tue, 12 May 2020 13:53:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OyS6mmNv0q65u62hC5nV/TgLYdLkGis5cCl6PdzqkEw=; b=RDTWOYNZFw5NrEI6k34m0CvGM/VljYk9JpYUDU2JUU4ujF+SMcR/IG9rddtmv11V4M HhSKPLqzLJJ6pEGFDRODF5eN4gRdg88TKm2IZ337xqOgktJ9zkUb74ongeklO9XvKCva Sb49D79rmoDYGgCSPyWhgGW5i4R8VxUZgzURvXZTYkqJUlYc5NB24D24JkH2zCuqSYGa IDK9Iz3oU4rKsWoJqJDGM+BRVv83HL60erDVZXXKgCnblKn5xBdMCklFoHms0pyOJwY6 RAauDIOzMG7F4YM0T8b9l+D+bDeJlZqh6TrP+u+zJhGglxmMmlCGXpfYXJsyt0QjDru/ Th/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OyS6mmNv0q65u62hC5nV/TgLYdLkGis5cCl6PdzqkEw=; b=htgmLaXB8I+4szb7oRLl8WNwTwOqjh75xuXxs/G6xjFM1U4UAaZ9X9tsfkgN1kpPaX 12V1+Vmp4KFZu0IrReuqmfOsuplT0vH/ZkLFbWf/Q/XCMaGLv2GRmSvILBdLLmRse/q3 yShdSfnhOjr3qVKZEJAUKuAX3a1AdA9FPT/E5AyQ04AL4vKEUbNJGV5RfrFB7q2W2K0Q iOglSi+g/hgSkvDXBEfpt4hH+6EoxPkyRwWmgJtL8sJ82+E9J76yjf5DWFrRZh5kVo0p gutIdC+dw9zPg+BXbmebYW0OuQNVlL3DopQw6UuruH3EZNBSROqXuEgGwGwf1sA6SL2f 0m5Q== X-Gm-Message-State: AGi0PubI4wmC9lqdvmWfuW9R3MaNufEttOS4YLHJ+rMXdCxTZpZS9k5C D0aOii6+SQby1+xB+OxZCDXYF8VN/Sd+Cg== X-Received: by 2002:a05:620a:662:: with SMTP id a2mr20537000qkh.304.1589316801088; Tue, 12 May 2020 13:53:21 -0700 (PDT) Received: from sca.dev ([201.17.110.164]) by smtp.gmail.com with ESMTPSA id h6sm9503374qkf.61.2020.05.12.13.53.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 May 2020 13:53:20 -0700 (PDT) From: Rodrigo Rolim Mendes de Alencar <455.rodrigo.alencar@gmail.com> X-Google-Original-From: Rodrigo Rolim Mendes de Alencar To: linux-fbdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, maxime.ripard@free-electrons.com, alencar.fmce@imbel.gov.br Subject: [PATCH 3/3] video: fbdev: ssd1307fb: Switch to atomic PWM API Date: Tue, 12 May 2020 17:52:49 -0300 Message-Id: <1589316769-13277-3-git-send-email-alencar.fmce@imbel.gov.br> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1589316769-13277-1-git-send-email-alencar.fmce@imbel.gov.br> References: <1589316769-13277-1-git-send-email-alencar.fmce@imbel.gov.br> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Rodrigo Rolim Mendes de Alencar --- drivers/video/fbdev/ssd1307fb.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c index 748c21c0567b..b1cac4a3722f 100644 --- a/drivers/video/fbdev/ssd1307fb.c +++ b/drivers/video/fbdev/ssd1307fb.c @@ -303,7 +303,7 @@ static int ssd1307fb_init(struct ssd1307fb_par *par) { int ret; u32 precharge, dclk, com_invdir, compins; - struct pwm_args pargs; + struct pwm_state pstate; if (par->device_info->need_pwm) { par->pwm = pwm_get(&par->client->dev, NULL); @@ -312,18 +312,18 @@ static int ssd1307fb_init(struct ssd1307fb_par *par) return PTR_ERR(par->pwm); } - /* - * FIXME: pwm_apply_args() should be removed when switching to - * the atomic PWM API. - */ - pwm_apply_args(par->pwm); + pwm_init_state(par->pwm, &pstate); + par->pwm_period = pstate.period; - pwm_get_args(par->pwm, &pargs); - - par->pwm_period = pargs.period; /* Enable the PWM */ - pwm_config(par->pwm, par->pwm_period / 2, par->pwm_period); - pwm_enable(par->pwm); + pstate.enabled = true; + pstate.duty_cycle = pstate.period / 2; + + ret = pwm_apply_state(par->pwm, &pstate); + if (ret) { + dev_err(&par->client->dev, "Failed to apply PWM state: %d\n", ret); + return ret; + } dev_dbg(&par->client->dev, "Using PWM%d with a %dns period.\n", par->pwm->pwm, par->pwm_period); -- 2.23.0.rc1