Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2035718pxb; Sun, 18 Apr 2021 16:22:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylOXvdgvM9bDtOZUM2T/eahtQc9SJYv6HOxUQ3F5C/+p2cVDQFutJbo4KMJp9yqYmVpPpF X-Received: by 2002:aa7:81d9:0:b029:25e:6771:fa0a with SMTP id c25-20020aa781d90000b029025e6771fa0amr4504827pfn.62.1618788158646; Sun, 18 Apr 2021 16:22:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618788158; cv=none; d=google.com; s=arc-20160816; b=pKiBZ2PRNjIv9BbCXs4iCrk260/gRpHu9LhvO1hqgze61FkIo5zCEkjW/4Zal09iSa cepeneLKdcfH8duFqNf0xEDlmQQM/bEja9wKeh/0IqFEsvFR4m7l5jgo3ze0ywvOIlgU c0jc17G2tCdLhRQJ2jmP5pj7g+60PoZe34Xn54o6aOCZnM5lkoz2CjJOOYEmsSPUSy5p HISh8DNtUsnWaJxiaUiXUo2WCEl5BpLc9/f8z0Qne8APj2g+nCXLdc9af3+x0BoFDhce FKhbvU1bf4sHjed5q9dgN9MqyLgjUI5MYP0WdLVpZiSe0+6z9boqTJZNryQaeqqSRsHT V1iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=8s5qr2r83+lahrELgeI/LM3vW+977f7RrigH8pmfUhE=; b=QsrLao6cou5jO3jEMpJ7zxdOR3CmVsSqJraH0vYr5u9QZloUvX5Wb5AuirqQkasEQY XCKOK+EtAh2S99Nb9GTuDEKykYlTrXRNXf7Nt70w6aMa2wNCcMhc7QL562A/bENlaP2M dazLMBCaV6LlR8GeInEoRXyv44w/FrkgwKkrnRntL1gNcrhE6wkon0GuoRj/Q+lOazEG RHtKe1fnz+kqaJTs5ZSe3nx7tKNb5VeYS1YiZmslGY25NliSp2CcX2mdKgKvCJbu/+uR DkSRfVDKztwcC87GMsIhjzc/iind6+fjJtbOm8gdOCkClDV/+It1cHZlVpotpXw8PCCA sKFA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=toshiba.co.jp Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z16si15148633plo.14.2021.04.18.16.22.13; Sun, 18 Apr 2021 16:22:38 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=toshiba.co.jp Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232729AbhDRXVx (ORCPT + 99 others); Sun, 18 Apr 2021 19:21:53 -0400 Received: from mo-csw1515.securemx.jp ([210.130.202.154]:54030 "EHLO mo-csw.securemx.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231489AbhDRXVx (ORCPT ); Sun, 18 Apr 2021 19:21:53 -0400 Received: by mo-csw.securemx.jp (mx-mo-csw1515) id 13INL0TW024872; Mon, 19 Apr 2021 08:21:00 +0900 X-Iguazu-Qid: 34trpShQIDkL9fGb0y X-Iguazu-QSIG: v=2; s=0; t=1618788060; q=34trpShQIDkL9fGb0y; m=htFKz+h4lbFLcahE26O7ZRAXTEyWViAHI8UFOYwBN5k= Received: from imx12-a.toshiba.co.jp (imx12-a.toshiba.co.jp [61.202.160.135]) by relay.securemx.jp (mx-mr1513) id 13INKxGT022101 (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 19 Apr 2021 08:20:59 +0900 Received: from enc02.toshiba.co.jp (enc02.toshiba.co.jp [61.202.160.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by imx12-a.toshiba.co.jp (Postfix) with ESMTPS id 19AA91000BB; Mon, 19 Apr 2021 08:20:59 +0900 (JST) Received: from hop101.toshiba.co.jp ([133.199.85.107]) by enc02.toshiba.co.jp with ESMTP id 13INKwYW003126; Mon, 19 Apr 2021 08:20:58 +0900 Date: Mon, 19 Apr 2021 08:20:01 +0900 From: Nobuhiro Iwamatsu To: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= Cc: Rob Herring , Thierry Reding , Lee Jones , devicetree@vger.kernel.org, linux-pwm@vger.kernel.org, punit1.agrawal@toshiba.co.jp, yuji2.ishikawa@toshiba.co.jp, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 2/2] pwm: visconti: Add Toshiba Visconti SoC PWM support X-TSB-HOP: ON Message-ID: <20210418232001.lvx7ho2qo2ac2khy@toshiba.co.jp> References: <20210418110904.1942806-1-nobuhiro1.iwamatsu@toshiba.co.jp> <20210418110904.1942806-3-nobuhiro1.iwamatsu@toshiba.co.jp> <20210418134411.vfltokielrwuygqa@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210418134411.vfltokielrwuygqa@pengutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Uwe, Thanks for your review. On Sun, Apr 18, 2021 at 03:44:11PM +0200, Uwe Kleine-K?nig wrote: > Hello, > > just a few smaller issues left to fix. > > On Sun, Apr 18, 2021 at 08:09:04PM +0900, Nobuhiro Iwamatsu wrote: > > diff --git a/drivers/pwm/pwm-visconti.c b/drivers/pwm/pwm-visconti.c > > new file mode 100644 > > index 000000000000..166b18ac1a3a > > --- /dev/null > > +++ b/drivers/pwm/pwm-visconti.c > > @@ -0,0 +1,188 @@ > > +// SPDX-License-Identifier: GPL-2.0-only > > +/* > > + * Toshiba Visconti pulse-width-modulation controller driver > > + * > > + * Copyright (c) 2020 TOSHIBA CORPORATION > > + * Copyright (c) 2020 Toshiba Electronic Devices & Storage Corporation > > We're in 2021, so you might want to adapt the year in the copy right > notice. OK, I will update. > > > + * > > + * Authors: Nobuhiro Iwamatsu > > + * > > + * Limitations: > > + * - PIPGM_PWMC is a 2-bit divider (00: 1, 01: 2, 10: 4, 11: 8). > > This is too detailed for the purpose of this section. Please either drop > it or make this: > > - The fixed input clock is running at 1 MHz and is divided by either 1, > 2, 4 or 8. OK, I will add your sugggestion. > > > + * - Fixed input clock running at 1 MHz. > > + * - When the settings of the PWM are modified, the new values are shadowed > > + * in hardware until the PIPGM_PCSR register is written and the currently > > + * running period is completed. This way the hardware switches atomically > > + * from the old setting to the new. > > + * - Disabling the hardware completes the currently running period and keeps > > + * the output at low level at all times. > > + */ > > + > > [...] > > + /* > > + * PWMC controls a divider that divides the input clk by a > > + * power of two between 1 and 8. As a smaller divider yields > > + * higher precision, pick the smallest possible one. > > + */ > > + if (period > 0xffff) { > > + pwmc0 = ilog2(period >> 16); > > + BUG_ON(pwmc0 > 3); > > + } else > > + pwmc0 = 0; > > The linux coding style mandates that you should use braces for both > branches. (i.e. > > + if (period > 0xffff) { > + pwmc0 = ilog2(period >> 16); > + BUG_ON(pwmc0 > 3); > + } else { > + pwmc0 = 0; > + } > ) Oh, I fotgot it, I will fix this. Thanks you. > > > + period >>= pwmc0; > > + duty_cycle >>= pwmc0; > > + > > + if (state->polarity == PWM_POLARITY_INVERSED) > > + pwmc0 |= PIPGM_PWMC_PWMACT; > > + writel(pwmc0, priv->base + PIPGM_PWMC(pwm->hwpwm)); > > + writel(duty_cycle, priv->base + PIPGM_PDUT(pwm->hwpwm)); > > + writel(period, priv->base + PIPGM_PCSR(pwm->hwpwm)); > > + > > + return 0; > > +} > > Best regards > Uwe Best regards, Nobuhiro