Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp405148pxf; Thu, 25 Mar 2021 06:53:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQ0LG75pl5K8FnWBx7o5VuAZVfG8N/VZCwDx1HWjl1t6JE+E0a/manh2khtEbYyblFkxu4 X-Received: by 2002:a17:906:f8d5:: with SMTP id lh21mr9538954ejb.64.1616680410391; Thu, 25 Mar 2021 06:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616680410; cv=none; d=google.com; s=arc-20160816; b=kjKwuBWRsb0NL/bGtavNogwXYsyV025LkmE6v/9Sb03mtR8xYuhXtpVPACiI9ykXft JZmLJ2EUfIP2xL1xVJWwB6/AV7bpbcMq5/ujZI7LTZPNpMl2Rjf4Y62YKTdNBgJTHCcd GBFP7Z0uQeCjr/NVVTR/LCXfBJoX5WYfQz49C0uJoE4g37FB8LOn52hilXJiV3QgPpO+ QZIYJ2F/hj59VGw1+VmR+nzD3OFuOf4bM6/kfPEQ3DjhxpTWqJjz3LX821e7dQirU4Tb YE2wpzhABzHui6heQG+yaOMRQldktLZZncrg0ElWpy/T/fdbDG2LJnspELKhGBUeb0aa s0tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=6SqcI7wfV+RRHYGPRjS+pVaFs+2AUelArIaZQWbVrio=; b=jb3eNiaL+nYGp9yvoXueylcmGBlAbK/mOO/AkthEbfBSqOtuIFPQDU2bw6syH+Yw2O tsyIIpQOCbih/VzTmeYnqWwKS9Nh/qSu04T+ZXo8aWcN0ivTtcqYdOTYcYBR6NWzadHq K1B/3niW3V7jCrMXtsG9jSfU1PX/th7eBZa2Ky7FrzLO6yxxkb3G0xFXBPc7c9Yc1yCG nuslIZCRB/MS9fwWFvcaDhMOTZnL0hAqYSzDaqNCPiZVRBORGSm2JJ7ALhtGh31y1L0e smAoh3H1onHx8mFMq6PaUVb9IuS0NiY63LaKemH6os6em6N1hXV9hLG1g0MT6JzH8JtN d/Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fHGDpiK3; 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 lt12si4279176ejb.158.2021.03.25.06.53.07; Thu, 25 Mar 2021 06:53:30 -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=fHGDpiK3; 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 S229533AbhCYNv4 (ORCPT + 99 others); Thu, 25 Mar 2021 09:51:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231202AbhCYNvm (ORCPT ); Thu, 25 Mar 2021 09:51:42 -0400 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EDD2C06174A; Thu, 25 Mar 2021 06:51:40 -0700 (PDT) Received: by mail-il1-x130.google.com with SMTP id u10so2237162ilb.0; Thu, 25 Mar 2021 06:51:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=6SqcI7wfV+RRHYGPRjS+pVaFs+2AUelArIaZQWbVrio=; b=fHGDpiK3JBh/PsiCtP3z2LFWYIAz5AKbfErqmPootKMXzYWpSTTqPp0BQljhhwtOqj PaOltLKGnzVNkFzGyUOvG1Wy6U4+JI0PTF3OC532D66DubQzlJB/Nwm3OtVEj7ycf43K O6eA26dGlT51MJ8gXJ0VZQQl8aNMhQceyIcZh82ExO8PRhcozq6NkOkOWx/W3BqaZpkJ uzuzA7cbdeffuYav3x5pU9My4r6VBWi2Y2hH9cVc40Z0PjjBYR7G1BkKYClFzx+0V7bk xonk63iqekj2iHqqzSul0JPtOVV1WLn5Jbhbcx40tiAmh3pBAqQKhvhWSyKc0sK7uuzG Z0rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=6SqcI7wfV+RRHYGPRjS+pVaFs+2AUelArIaZQWbVrio=; b=kDChoENCXZD+uaZtximapPc/6lv7PkX0GOZv5uhNPVacvx49bUabt738RE6JxxACGd maRT0zDtMXbrJLZ5LlGWfsHslf01Z3ARIsln1w655bJ+4QebzixcmQE1+fhyB24gCYdB u05CMmStFAaKCldxWq2eaJvZZ3FPz/ZW8JN0Vb7DFpY9XJvu6p3Fo5nEyVPgy5a7xgWW yf7UWNC+arbfb1n2CINDVcB0oxM4hMwbCLhM2VRJnZTiEda6svPQNoel27WrDEaoobOm rWULwQNX4XRnbfb/AKxhPtsGox7yD5wJb3ZXIsuNAjmwSuEoJiWns+4o4ovupbU54Dq4 WmkQ== X-Gm-Message-State: AOAM530RKZaYhHKTHG1Ax3TpWYI60624hvKeUx2zmQFacM4zPBU2OF+c usiDsgMbaW/QqFZDCfMbCH+ScXBpezZX4W9yVD4= X-Received: by 2002:a92:da89:: with SMTP id u9mr3177383iln.131.1616680299834; Thu, 25 Mar 2021 06:51:39 -0700 (PDT) MIME-Version: 1.0 References: <20210117042539.1609-1-alistair@alistair23.me> <20210117042539.1609-2-alistair@alistair23.me> <20210204103126.GA2789116@dell> <20210323093541.GQ2916463@dell> In-Reply-To: <20210323093541.GQ2916463@dell> From: Alistair Francis Date: Thu, 25 Mar 2021 09:49:39 -0400 Message-ID: Subject: Re: [PATCH 2/6] mfd: Initial commit of sy7636a To: Lee Jones Cc: Alistair Francis , Rob Herring , lgirdwood@gmail.com, Mark Brown , dl-linux-imx , Sascha Hauer , devicetree , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 23, 2021 at 5:35 AM Lee Jones wrote: > > 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. I reached out to him and have permission to bump the year. > > [...] > > > > > +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 =3D (unsigned int)(vcom / 10) & 0x1ff; > > > > > > As above. > > > > I have used defines for all of these. > > > > > > > > > + ret =3D regmap_write(regmap, SY7636A_REG_VCOM_ADJUST_CTRL_L, = val); > > > > + if (ret) > > > > + return ret; > > > > + > > > > + ret =3D 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. Ok, I have moved these to the regulator. > > [...] > > > > > + if (val >=3D ARRAY_SIZE(states)) { > > > > + dev_err(sy7636a->dev, "Unexpected value read from dev= ice: %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 Thanks! > > [...] > > > > > +static struct attribute *sy7636a_sysfs_attrs[] =3D { > > > > + &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. Done. Alistair > > [...] > > -- > Lee Jones [=E6=9D=8E=E7=90=BC=E6=96=AF] > Senior Technical Lead - Developer Services > Linaro.org =E2=94=82 Open source software for Arm SoCs > Follow Linaro: Facebook | Twitter | Blog