Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2828659ybg; Thu, 24 Oct 2019 16:09:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzfYKWV7Pk0llIUavkw45FhOh0oD3nNSkhtofqhKx2PyA7fARKtexqsYR8lSqXUSKRuaj1 X-Received: by 2002:a17:906:7f06:: with SMTP id d6mr554418ejr.323.1571958568655; Thu, 24 Oct 2019 16:09:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571958568; cv=none; d=google.com; s=arc-20160816; b=qidM0Y08K6Eacb6bEwH8EI5nNB5p46SmqeiOTufk39kCG9gMYBJA8Ehf4+JdQRSyfI Tr+kmtSGBkqEj6yPwGxvwsMhnOwCPbxi4J4GCvgVP0b8nf6D1rkjKfAelNHKsmabj8UN SXdkqtK+6lQg+0ZdfmUklv3N17j/shpV38fPvTgO2u0WKynPy03OFu5MIG0VisX4SaPk t1nnEktShFffEzSP9QmQx6LzP/0EDxBDB3y7xtFP6LiHyQ1ci75u4TZWBoxa0Ym9g3s1 OK+oc3w90mAX6xa2EPQMH5R1Oyxp3qWAEVjta4xraET2vemCs2ghRHnqITeSbqGoNonM 3FbQ== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=iA8rnha9mtyoi6ioF93JoEJEpTtmN445x+IcHqPDVEc=; b=N7Gd7F68yYlsxKU3m2v8e53nIoBt0OF2/0j8MH9bWpYXCyv7hv0XN4mEXRUxB91ZoI aQMcz6aZY4dO1W5PLSV3JWfByNc25Hqk0rIN4tAY/si1r6YVIUJnh1UgwvLwbFKMXAQx Qxr2o/Hi9IpKts2WguD7/OQ+hY4UAT8cE03PoRzc6lWqc+/57U68lewHH++XmPTcyiCx zMJ6fT8vjI8eVFp9p0WwrzrsEIno1C5zWOn1K97DOh6e3VWWfMyo93cxtYOGFVC2APQ1 gZ/BnHWoOZt9TYlgmpPPm7EI/x8Jdg2Sk5h8bOUb+04g4gxYNARnnChbTuWO1xLbzkKC w6/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WsVMmVTs; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z3si151890ejb.42.2019.10.24.16.09.05; Thu, 24 Oct 2019 16:09:28 -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=@linaro.org header.s=google header.b=WsVMmVTs; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438179AbfJXI02 (ORCPT + 99 others); Thu, 24 Oct 2019 04:26:28 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:36081 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725947AbfJXI02 (ORCPT ); Thu, 24 Oct 2019 04:26:28 -0400 Received: by mail-wr1-f67.google.com with SMTP id w18so24467068wrt.3 for ; Thu, 24 Oct 2019 01:26:26 -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 :user-agent; bh=iA8rnha9mtyoi6ioF93JoEJEpTtmN445x+IcHqPDVEc=; b=WsVMmVTs5afSXPK5AtLu8vC5zxAK90MRe1AVDo+TWW2PefFV/5LIfXpd01x08eKGUP qf3WrHd6I1rEXsvhkZXZmulyDKlwehsL4Mk6XntcOhOeqcdW8RSpB9F1UmwbHJRlKzry 7TO2RjGsvBM+TFWQnO8MLmTjp85la1Zjt/tI5MBMxFn1AZvKs92V4ER+h6cKaAeJPbd8 cXDJ1m56FPbloDPc5g7K6ttEZjrdPC8Os09S/SS5zwasdw3WUzzeB0QFOcSWFnGFCrrA O7ZA5g7ZWafR5OXdpP0x5La7eooMlen51xPnGfcAAd45wyz7NbFOmVw3uXCFSlFGRPXy hKLQ== 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:user-agent; bh=iA8rnha9mtyoi6ioF93JoEJEpTtmN445x+IcHqPDVEc=; b=sCwGsHA+s3asi0ucS9iowzTcmeLTeHdRgiBiHrdvcoQaKXNjZEET3diq3U0DVxhS1Q BU3CJGPyNzLjFDWpSrdf5GRPctPUGqTvfSmzjynQIo0Lv4eObmhdG1VapRYL/vblo1lL RODdz8tnPRknRxLO2Rpcu9yLHqCccNuatyq9+iKS7MYib8qEFgnZLDlPCLCGC5Ju/mXG 5pKUGtCvwnSr74lkeCOosgKhY/rjJtJytCCrRxlWvm+HagiO0IR+CW9Rsl9E++fkjLkT mkgr/aXx/3cyRylqj9UbUUNNYBED2Rur8xlXw+ClEfcniOQZVgs30AwF/G1gNYzKha4k am4Q== X-Gm-Message-State: APjAAAUquSWo05lGKVi+XGLfKfsRfu2sWXSPNpKBgyrxd4N7FZK/9XOH GuMRSl0qGOCkIpOr4JbFcHeIRw== X-Received: by 2002:adf:e542:: with SMTP id z2mr2459639wrm.338.1571905585910; Thu, 24 Oct 2019 01:26:25 -0700 (PDT) Received: from dell ([95.149.164.99]) by smtp.gmail.com with ESMTPSA id v6sm28034467wru.72.2019.10.24.01.26.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 01:26:25 -0700 (PDT) Date: Thu, 24 Oct 2019 09:26:23 +0100 From: Lee Jones To: Gene Chen , Wolfram Sang Cc: matthias.bgg@gmail.com, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, gene_chen@richtek.com, Wilma.Wu@mediatek.com, shufan_lee@richtek.com, cy_huang@richtek.com Subject: Re: [PATCH v4] mfd: mt6360: add pmic mt6360 driver Message-ID: <20191024082623.GK15843@dell> References: <1571749359-15752-1-git-send-email-gene.chen.richtek@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1571749359-15752-1-git-send-email-gene.chen.richtek@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Wolfram, Would you be kind enough to see below please? I'd like to know if it looks sane to you. On Tue, 22 Oct 2019, Gene Chen wrote: > From: Gene Chen > > Add mfd driver for mt6360 pmic chip include > Battery Charger/USB_PD/Flash LED/RGB LED/LDO/Buck > > Signed-off-by: Gene Chen --- > drivers/mfd/Kconfig | 12 + > drivers/mfd/Makefile | 1 + > drivers/mfd/mt6360-core.c | 457 +++++++++++++++++++++++++++++++++++++ > include/linux/mfd/mt6360-private.h | 279 ++++++++++++++++++++++ > include/linux/mfd/mt6360.h | 32 +++ > 5 files changed, 781 insertions(+) > create mode 100644 drivers/mfd/mt6360-core.c > create mode 100644 include/linux/mfd/mt6360-private.h > create mode 100644 include/linux/mfd/mt6360.h > > changelogs between v1 & v2 > - include missing header file > > changelogs between v2 & v3 > - add changelogs > > changelogs between v3 & v4 > - fix Kconfig description > - replace mt6360_pmu_info with mt6360_pmu_data > - replace probe with probe_new > - remove unnecessary irq_chip variable > - remove annotation > - replace MT6360_MFD_CELL with OF_MFD_CELL [...] > + for (i = 0; i < MT6360_SLAVE_MAX; i++) { > + if (mt6360_slave_addr[i] == client->addr) { > + mpd->i2c[i] = client; > + continue; > + } > + mpd->i2c[i] = i2c_new_dummy(client->adapter, > + mt6360_slave_addr[i]); > + if (!mpd->i2c[i]) { > + dev_err(&client->dev, "new i2c dev [%d] fail\n", i); > + ret = -ENODEV; > + goto out; > + } > + i2c_set_clientdata(mpd->i2c[i], mpd); > + } > + > + ret = devm_mfd_add_devices(&client->dev, PLATFORM_DEVID_AUTO, > + mt6360_devs, ARRAY_SIZE(mt6360_devs), NULL, > + 0, regmap_irq_get_domain(mpd->irq_data)); > + if (ret < 0) { > + dev_err(&client->dev, "mfd add cells fail\n"); > + goto out; > + } > + > + return 0; > +out: > + while (--i >= 0) { > + if (mpd->i2c[i]->addr == client->addr) > + continue; > + i2c_unregister_device(mpd->i2c[i]); > + } > + > + return ret; > +} > + > +static int mt6360_pmu_remove(struct i2c_client *client) > +{ > + struct mt6360_pmu_data *mpd = i2c_get_clientdata(client); > + int i; > + > + for (i = 0; i < MT6360_SLAVE_MAX; i++) { > + if (mpd->i2c[i]->addr == client->addr) > + continue; > + i2c_unregister_device(mpd->i2c[i]); > + } > + > + return 0; > +} -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog