Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3303315imm; Tue, 29 May 2018 05:02:52 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoGh9mzFD8zwyE98j1SMdVlcMtZsA+HbnwTJCCg4kXdP1QaDds733vJiO5qTnYfvVbWzWxt X-Received: by 2002:a65:578b:: with SMTP id b11-v6mr13886501pgr.57.1527595371981; Tue, 29 May 2018 05:02:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527595371; cv=none; d=google.com; s=arc-20160816; b=AMzgxK51tD4GxCg3v4Jc9AcSfNSG+RcnsD8V2JomW9Y/vr50FFCzNgQusdQiaCpe3j wqbGmf/ZX+tKiZvvyidbAmQnCX20u2iJl79cM/PHa6JQCe0qiZxW5/byBLVSnC3h/Wh4 +jxt5oXvB6ayfOvJv6pK1mqHGeYQv5Tsnl2FS8nql8PiFXJPKqiIPPKdsdMur3ph3lQ3 xvIHFyRF+sbn/ClkWHcs+IsOgsyrWStTrsoSdyxRrIg1nZzTDtiNiFw8m7bUDk0TpvHp AEk0c7XgiuctIXqgwABz6ZFwchY7RnEDD7BwNMll/LOU7i5vVWCWAA7mGYv9eXZ///9y Omhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature:arc-authentication-results; bh=cPocqUHzoq1A5dKkPpo2AfAAdtpbfBPwSXYfcfsts1c=; b=nQh4Qo3Kxr1SpA5Pp9vAPEog6B0aq9mJZxP6pMt/DH5XhFZyyFwDVjgWlJgwtboQz3 jAc8Z+HtZvdEin4Dzfp1u03HjkQr25dF/HldD3pvuS4fBHpg117FYlbIwMr7k1K2xRq+ 4XGapnrB5v0vkff7E3K3W9B8mEJWQeUj3cs99vzrm5bW1/CLeDIrjHYuyx/YTa2pIZ86 kYFZElVK0gk2G16YfklZIV7Lv6bMwvfp63zeAWmbyusy9bFwxqxpxktzSew22krfn2YF LFzb6AM2HQzF1+fW92W9seR3RgPTusOIh0QJG7K4IwVyo2GMbbR/DtfMm7MujkF7vx4q RYGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=buxoVyu+; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y5-v6si22618947pgq.276.2018.05.29.05.02.06; Tue, 29 May 2018 05:02:51 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=buxoVyu+; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933611AbeE2MAi (ORCPT + 99 others); Tue, 29 May 2018 08:00:38 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:45081 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933391AbeE2MAd (ORCPT ); Tue, 29 May 2018 08:00:33 -0400 Received: by mail-wr0-f194.google.com with SMTP id w3-v6so25021940wrl.12; Tue, 29 May 2018 05:00:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=cPocqUHzoq1A5dKkPpo2AfAAdtpbfBPwSXYfcfsts1c=; b=buxoVyu+Xk8a1j+qCUfDtdTucQoYq5tre4ndlvhPOjmDnEtyktjRjewalk+dAxpO0X phXEiYQs32tRKWc/NTIuWln4KGjaPUjYDSTgbe0wlKMpIl4CzVRae1Bu0owWByUU730T MD/sd6JNlpIQ21ifQx1SCTB8Jv3Re3AN4mibJ0Yif7sgMVKVfGFbs6EKzmgtQe7S5A1S 6CwDqeMWtBOgBjyouuR2mivlK3tjHcOGgIw+v2608nEN3umnBp57JEK0VGg3zk0K76+6 LKwEfr7mwnmyqXvYdWgSQ3LMk4BYO5eUjzvnU/yZoF/xOjFVRMXPbfDcAaEhzjwRq5p3 smbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=cPocqUHzoq1A5dKkPpo2AfAAdtpbfBPwSXYfcfsts1c=; b=Gd8/Udkh65ZBKjZfxVOgqMggHTtyZvwKGVY1YJZty2zXo+N6YU54t/tRXUQiZhzNgI xGXElYczLN1hrjbtAS470R+9bZPFlTcTZB14NvNOe37em7f+ZUN1ewygzovRBIeovBO3 UhIsfRrrEX1SEMFczb+Hd7RNR2roT/9UXr/z/P+8IClqOvDONq4zHH5GJGqNcdCW1CqM dgrJsj4nuQW5cQaPF7o6hmFN7it1XFC/CeZlg2zf6kungBWwcU58iePGIIe0rWecsSkb 1FDd47jtWPgkYJCIaSkXuMf/uNsEU9qhOTppQxHEJOYEQjXRi7XSQeEcu/V6Gll+hziN o+2Q== X-Gm-Message-State: ALKqPwc8FNDCWHP+l2qAY7FcV+j+SDIrRYV3kOmETRxHxGEBsR7fJ5N+ swp4g0K5VHmx0+DlUZpVZLE= X-Received: by 2002:a19:cb96:: with SMTP id b144-v6mr9068347lfg.72.1527595231900; Tue, 29 May 2018 05:00:31 -0700 (PDT) Received: from localhost.localdomain ([213.255.186.34]) by smtp.gmail.com with ESMTPSA id v6-v6sm6417756ljk.83.2018.05.29.05.00.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 May 2018 05:00:31 -0700 (PDT) From: Matti Vaittinen X-Google-Original-From: Matti Vaittinen Date: Tue, 29 May 2018 15:00:28 +0300 To: Mark Brown Cc: Matti Vaittinen , mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, lee.jones@linaro.org, lgirdwood@gmail.com, mazziesaccount@gmail.com, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mikko.mutanen@fi.rohmeurope.com, heikki.haikola@fi.rohmeurope.com Subject: Re: [PATCH v3 6/6] regulator: bd71837: BD71837 PMIC regulator driver Message-ID: <20180529120028.GB13528@localhost.localdomain> References: <68b0cf2c7ab5578eef2f71a33315bc8ab9a68a39.1527587295.git.matti.vaittinen@fi.rohmeurope.com> <20180529114740.GG23509@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180529114740.GG23509@sirena.org.uk> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Tue, May 29, 2018 at 12:47:40PM +0100, Mark Brown wrote: > On Tue, May 29, 2018 at 01:02:15PM +0300, Matti Vaittinen wrote: > > > @@ -0,0 +1,677 @@ > > +/* SPDX-License-Identifier: GPL-2.0 */ > > +/* Copyright (C) 2018 ROHM Semiconductors */ > > +/* > > + * bd71837-regulator.c ROHM BD71837MWV regulator driver > > + */ > > The SPDX header (and the rest of the block) need to be C++ comments. Oh. My bad. I mixed up the C and Cpp style comments. So I will convert the SPDX and following block to // (Cpp -style) comments. > > > +static int bd71837_regulator_set_regmap(struct regulator_dev *rdev, int set) > > +{ > > + int ret = -EINVAL; > > + struct bd71837_pmic *pmic = rdev->reg_data; > > + > > + /* According to the data sheet we must not change regulator voltage > > + * when it is enabled. Thus we need to check if regulator is enabled > > + * before changing the voltage. This mutex is used to avoid race where > > + * we might enable regulator after it's state has been checked but > > + * before the voltage is changed > > + */ > > + mutex_lock(&pmic->mtx); > > + if (!set) > > + ret = regulator_disable_regmap(rdev); > > + else > > + ret = regulator_enable_regmap(rdev); > > + mutex_unlock(&pmic->mtx); > > + > > This still has the weird locking/wrapper thing going on. The regulator > core will ensure that only one operation is called on a given regulator > at once. Ok. I''ll remove the mutex and wrapper since core handles this. Also, after re-reading the data sheet I see that this restriction to voltage changes (regulator must be disabled when voltage is changed) is not mentioned for first 4 bucks. I will confirm if they can be changed when enabled and also reflect this in next patch set. > > > +static const struct regulator_desc bd71837_regulators[] = { > > + { > > + .name = "buck1", > > The indentation style here is weird, please follow CodingStyle. Looks > like the second level is just indented by a space for some reason, and > there's similar problems elsewhere. I'll change this too. Br, Matti Vaittinen