Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4099753pxf; Tue, 23 Mar 2021 02:39:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEiVczoSrnCC5XszkwcrJQV+CV7xNWEGu7+aRYR5ArupF+wBX1MJVv1lIXckSXy2BS/H61 X-Received: by 2002:a17:906:71c3:: with SMTP id i3mr3984059ejk.391.1616492382656; Tue, 23 Mar 2021 02:39:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616492382; cv=none; d=google.com; s=arc-20160816; b=xAAwpZ15UwBn4UiLvaBrW5wv5InBR3kgPapmOSPN5pONLq6Qtbz/p+O7YI12fUOeJb ufop5PlSpi6syR6Jb1DrGhyuFhyJXW5Y9waN5o3Ufj7C6HBfF9EQVj8WrIAz8eNWIzvY k5tFlvNbHmnKckp28dKosCPUnJo4TIHH5tjZkjlQq7n/z4C+/CqpRv+cxnyxXgRb2pmY 7rM3cwDduGq6kqivZv9a3s+TZdtiL3tcfx0MI1aqHZtTiGdgk3sDFWn7hpX6k9DJ6eE2 ubt/UDqJe+FNIukpHhbQ7bx/elg3CGc5tG2hUcR0QLBR86Oj0qEVjMV0cK2yneCiKn3i S9tQ== 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:dkim-signature; bh=Dq+A8bXkgLP4LCXqXNUDH5ZiTBBc0y9mfd6LMDIWfCU=; b=BOHUNt64eHftL0DgK6CT0yEVbsGT1URpI7J3g53Ny+STtxPCXZV87f/6GNYw/HFc6g oNO9D5j0rXlRzOlpHA6iHGIQBOsPLI5qOyTp9Deq1v01NcvTVoL6S8rg6Mi6vzzCvv19 LtbQapXY/ePc8gcp2HJwtBq31EVO1gDEsNh/k3ZthC/gM+iEGK5sgjQyS+jsxeEizDgx EAUGZuGtu4xVQ3t+IfgIhp/h+MN50u6fbm48lG0gfNqux8bVJp6Atv4E6VTUUJ/N8J0/ s0A4MlYurWMThA8wb6Oeg2lK/fNfGXdYZnxeuZQ4yKw6J4qsM5TNk0EjUmp4TQ3KhOmg Wt/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tKkIq3X7; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h9si13672021edv.190.2021.03.23.02.39.20; Tue, 23 Mar 2021 02:39:42 -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=@linaro.org header.s=google header.b=tKkIq3X7; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230165AbhCWJgK (ORCPT + 99 others); Tue, 23 Mar 2021 05:36:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230145AbhCWJfp (ORCPT ); Tue, 23 Mar 2021 05:35:45 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE9ADC061756 for ; Tue, 23 Mar 2021 02:35:44 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id hq27so25948275ejc.9 for ; Tue, 23 Mar 2021 02:35:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=Dq+A8bXkgLP4LCXqXNUDH5ZiTBBc0y9mfd6LMDIWfCU=; b=tKkIq3X7o/IL5dkQNju1wLTVOoPVV67taVtXTYskG4CouQe2JIk5wd6faYWU4DUmKT XYXtQ/K0nBSAxzd+qjL6+mYK7+dgV8DCP+YqRvVbwWvWj0C8WV8tlTVN8RlI63i0TLl1 vMJRhzHYZo8dATdMEQgfartBQtwjWpebWJoNCGGH1NRYvCNt+UFcdlntZnH9BcsKNScd Hm5udRpBcg67SNmERm8UYchvCe0PfaPvKeaESw6FgnyME2Zoo5BxXU5wrZd0RssHibYr 4/eRHuoZamqRIq6cOAPYUb/EhVCqYJgFI4aT+UgpkJ/7QLeH4I1ZGO+QyA+pQly1+NIP w8qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=Dq+A8bXkgLP4LCXqXNUDH5ZiTBBc0y9mfd6LMDIWfCU=; b=X28uq05ZPXuyzGkd+1f1tkRBYbeA5qtSQkiX4k8K9Af1XxMPtCHsk0YNexszj2UbME hWlg5iYMHJmdr4mbDama4IfRea46+8O1BUXRlsrEHSV/eJe59jy/fFEoo5BEYu1lU3Gc h+frwpOPBvO6m7xMzoyGSCGD561IHENhZjp6UXDySWLhR5xUCEYnuc2rm9u6TOeGRX+d bsPTfYkuvUxEvY68hRWBEhXu0Zel+z+TTfcY6xr29HxIcxul4fb/V8xHm3m/lbXscFC4 82HKpKF+GLFL0txpaEGTvbigwlR7VZam5ur0i6RIK5D+HkwjvT7kHbLPUvwVYiPN2VjA dH0Q== X-Gm-Message-State: AOAM532lHxbx+RJfvl+KFz8UBGft6YHwSWWaMeom5zz56gNE27nE0Dxj DJd8UwfSUuEaHulnkahaeDBKMQ== X-Received: by 2002:a17:907:b06:: with SMTP id h6mr4046258ejl.144.1616492143515; Tue, 23 Mar 2021 02:35:43 -0700 (PDT) Received: from dell ([91.110.221.180]) by smtp.gmail.com with ESMTPSA id u24sm10811910ejr.34.2021.03.23.02.35.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 02:35:43 -0700 (PDT) Date: Tue, 23 Mar 2021 09:35:41 +0000 From: Lee Jones To: Alistair Francis Cc: Alistair Francis , Rob Herring , lgirdwood@gmail.com, Mark Brown , dl-linux-imx , Sascha Hauer , devicetree , Linux Kernel Mailing List Subject: Re: [PATCH 2/6] mfd: Initial commit of sy7636a Message-ID: <20210323093541.GQ2916463@dell> References: <20210117042539.1609-1-alistair@alistair23.me> <20210117042539.1609-2-alistair@alistair23.me> <20210204103126.GA2789116@dell> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 20 Mar 2021, Alistair Francis wrote: > On Thu, Feb 4, 2021 at 5:31 AM Lee Jones wrote: > > > > On Sat, 16 Jan 2021, Alistair Francis wrote: > > > > > Initial support for the Silergy SY7636A Power Management chip > > > driver. > > > > Please remove "driver", as this is not support for the driver, it *is* > > the driver which supports the chip. > > Sorry for the long delay here. > > I have addressed your comments. [...] > > > diff --git a/drivers/mfd/sy7636a.c b/drivers/mfd/sy7636a.c > > > new file mode 100644 > > > index 000000000000..39aac965d854 > > > --- /dev/null > > > +++ b/drivers/mfd/sy7636a.c > > > @@ -0,0 +1,252 @@ > > > +// SPDX-License-Identifier: GPL-2.0+ > > > +/* > > > + * MFD driver for SY7636A chip > > > > "Parent driver". > > > > > + * Copyright (C) 2019 reMarkable AS - http://www.remarkable.com/ > > > > This is quite out of date. Please update. > > I don't own this copyright, so I would rather not change it. I'm not comfortable taking a new driver with an old Copyright. Maybe ask reMarkable if it's okay to bump it. > > > + * Author: Lars Ivar Miljeteig Or ping this guy. [...] > > > +int set_vcom_voltage_mv(struct regmap *regmap, unsigned int vcom) > > > +{ > > > + int ret; > > > + unsigned int val; > > > + > > > + if (vcom < 0 || vcom > 5000) > > > > Please define min/max values. > > > > > + return -EINVAL; > > > + > > > + val = (unsigned int)(vcom / 10) & 0x1ff; > > > > As above. > > I have used defines for all of these. > > > > > > + ret = regmap_write(regmap, SY7636A_REG_VCOM_ADJUST_CTRL_L, val); > > > + if (ret) > > > + return ret; > > > + > > > + ret = regmap_write(regmap, SY7636A_REG_VCOM_ADJUST_CTRL_H, val >> 8); > > > + if (ret) > > > + return ret; > > > + > > > + return 0; > > > +} > > > > Who calls these? > > They sysfs store and show functions. They should be in a power/regulator driver really. [...] > > > + if (val >= ARRAY_SIZE(states)) { > > > + dev_err(sy7636a->dev, "Unexpected value read from device: %u\n", val); > > > + return -EINVAL; > > > + } > > > + > > > + return snprintf(buf, PAGE_SIZE, "%s\n", states[val]); > > > +} > > > +static DEVICE_ATTR(state, 0444, state_show, NULL); > > > > You need to document new sysfs entries. > > I'm not sure how to document this. Do you mind pointing out an example > I can use? See the final paragraph in: Documentation/filesystems/sysfs.rst [...] > > > +static struct attribute *sy7636a_sysfs_attrs[] = { > > > + &dev_attr_state.attr, > > > + &dev_attr_power_good.attr, > > > + &dev_attr_vcom.attr, > > > + NULL, > > > +}; > > > > These all look like power options? Do they really belong here? > > From what I can tell I think they do. Let me know if you don't think so. As above, I think they should be in power or regulator. [...] -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog