From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Jones Subject: Re: [PATCH v7 2/5] MFD: RK808: Add new mfd driver for RK808 Date: Mon, 1 Sep 2014 11:09:22 +0100 Message-ID: <20140901100922.GL7374@lee--X1> References: <1409562468-16586-1-git-send-email-zyw@rock-chips.com> <1409564384-18380-1-git-send-email-zyw@rock-chips.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: <1409564384-18380-1-git-send-email-zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Chris Zhong Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, pawel.moll-5wv7dgnIgG8@public.gmane.org, mark.rutland-5wv7dgnIgG8@public.gmane.org, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org, galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org, sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, a.zummo-BfzFCNDTiLLj+vYz1yj4TQ@public.gmane.org, mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, rtc-linux-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org, grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, hl-TNX95d0MmH7DzftRWevZcw@public.gmane.org, huangtao-TNX95d0MmH7DzftRWevZcw@public.gmane.org, cf-TNX95d0MmH7DzftRWevZcw@public.gmane.org, zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org, xxx-TNX95d0MmH7DzftRWevZcw@public.gmane.org, dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org, olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org, sonnyrao-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, dtor-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, javier.martinez-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org, kever.yang-TNX95d0MmH7DzftRWevZcw@public.gmane.org List-Id: devicetree@vger.kernel.org On Mon, 01 Sep 2014, Chris Zhong wrote: > The RK808 chip is a power management IC for multimedia and handheld > devices. It contains the following components: >=20 > - Regulators > - RTC > - Clkout >=20 > The RK808 core driver is registered as a platform driver and provides > communication through I2C with the host device for the different > components. >=20 > Signed-off-by: Chris Zhong > Signed-off-by: Zhang Qing Couple of nits. Once fixed you can apply my: Acked-by: Lee Jones [...] > +/* > + * MFD core driver for Rockchip RK808 > + * > + * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd Author? > + * This program is free software; you can redistribute it and/or mod= ify it > + * under the terms and conditions of the GNU General Public License, > + * version 2, as published by the Free Software Foundation. > + * > + * This program is distributed in the hope it will be useful, but WI= THOUT > + * ANY WARRANTY; without even the implied warranty of MERCHANTABILIT= Y or > + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public Lic= ense for > + * more details. > + */ [...] > +static int rk808_probe(struct i2c_client *client, > + const struct i2c_device_id *id) > +{ > + int i; > + int ret; > + int pm_off =3D 0; > + struct rk808 *rk808; > + struct device_node *np =3D client->dev.of_node; Reverse these declarations please, structs at the top etc. [...] > + rk808->i2c =3D client; > + i2c_set_clientdata(client, rk808); '\n' here. > + ret =3D mfd_add_devices(&client->dev, -1, > + rk808s, ARRAY_SIZE(rk808s), > + NULL, 0, regmap_irq_get_domain(rk808->irq_data)); > + if (ret) { > + dev_err(&client->dev, "failed to add MFD devices %d\n", ret); > + goto err_irq; > + } > + > + if (np) { There has to be an 'np'. The driver depends on OF. > + pm_off =3D of_property_read_bool(np, > + "rockchip,system-power-controller"); > + if (pm_off && !pm_power_off) { > + rk808_i2c_client =3D client; > + pm_power_off =3D rk808_device_shutdown; > + } > + } > + > + return 0; > + > +err_irq: > + regmap_del_irq_chip(client->irq, rk808->irq_data); > + return ret; > +} [...] > +static struct i2c_driver rk808_i2c_driver =3D { > + .driver =3D { > + .name =3D "rk808", > + .of_match_table =3D of_match_ptr(rk808_of_match), No need to use of_match_ptr() now that you depend on OF. > + }, > + .probe =3D rk808_probe, > + .remove =3D rk808_remove, > + .id_table =3D rk808_ids, > +}; > + > +module_i2c_driver(rk808_i2c_driver); > + > +MODULE_LICENSE("GPL"); > +MODULE_AUTHOR("Chris Zhong "); > +MODULE_AUTHOR("Zhang Qing "); > +MODULE_DESCRIPTION("RK808 PMIC driver"); [...] --=20 Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org =E2=94=82 Open source software for ARM SoCs =46ollow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line "unsubscribe devicetree" i= n the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753165AbaIAKJd (ORCPT ); Mon, 1 Sep 2014 06:09:33 -0400 Received: from mail-qa0-f42.google.com ([209.85.216.42]:54986 "EHLO mail-qa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752327AbaIAKJb (ORCPT ); Mon, 1 Sep 2014 06:09:31 -0400 Date: Mon, 1 Sep 2014 11:09:22 +0100 From: Lee Jones To: Chris Zhong Cc: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, sameo@linux.intel.com, lgirdwood@gmail.com, a.zummo@towertech.it, mturquette@linaro.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com, grant.likely@linaro.org, hl@rock-chips.com, huangtao@rock-chips.com, cf@rock-chips.com, zhangqing@rock-chips.com, xxx@rock-chips.com, dianders@chromium.org, heiko@sntech.de, olof@lixom.net, sonnyrao@chromium.org, dtor@chromium.org, javier.martinez@collabora.co.uk, kever.yang@rock-chips.com Subject: Re: [PATCH v7 2/5] MFD: RK808: Add new mfd driver for RK808 Message-ID: <20140901100922.GL7374@lee--X1> References: <1409562468-16586-1-git-send-email-zyw@rock-chips.com> <1409564384-18380-1-git-send-email-zyw@rock-chips.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1409564384-18380-1-git-send-email-zyw@rock-chips.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 01 Sep 2014, Chris Zhong wrote: > The RK808 chip is a power management IC for multimedia and handheld > devices. It contains the following components: > > - Regulators > - RTC > - Clkout > > The RK808 core driver is registered as a platform driver and provides > communication through I2C with the host device for the different > components. > > Signed-off-by: Chris Zhong > Signed-off-by: Zhang Qing Couple of nits. Once fixed you can apply my: Acked-by: Lee Jones [...] > +/* > + * MFD core driver for Rockchip RK808 > + * > + * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd Author? > + * This program is free software; you can redistribute it and/or modify it > + * under the terms and conditions of the GNU General Public License, > + * version 2, as published by the Free Software Foundation. > + * > + * This program is distributed in the hope it will be useful, but WITHOUT > + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for > + * more details. > + */ [...] > +static int rk808_probe(struct i2c_client *client, > + const struct i2c_device_id *id) > +{ > + int i; > + int ret; > + int pm_off = 0; > + struct rk808 *rk808; > + struct device_node *np = client->dev.of_node; Reverse these declarations please, structs at the top etc. [...] > + rk808->i2c = client; > + i2c_set_clientdata(client, rk808); '\n' here. > + ret = mfd_add_devices(&client->dev, -1, > + rk808s, ARRAY_SIZE(rk808s), > + NULL, 0, regmap_irq_get_domain(rk808->irq_data)); > + if (ret) { > + dev_err(&client->dev, "failed to add MFD devices %d\n", ret); > + goto err_irq; > + } > + > + if (np) { There has to be an 'np'. The driver depends on OF. > + pm_off = of_property_read_bool(np, > + "rockchip,system-power-controller"); > + if (pm_off && !pm_power_off) { > + rk808_i2c_client = client; > + pm_power_off = rk808_device_shutdown; > + } > + } > + > + return 0; > + > +err_irq: > + regmap_del_irq_chip(client->irq, rk808->irq_data); > + return ret; > +} [...] > +static struct i2c_driver rk808_i2c_driver = { > + .driver = { > + .name = "rk808", > + .of_match_table = of_match_ptr(rk808_of_match), No need to use of_match_ptr() now that you depend on OF. > + }, > + .probe = rk808_probe, > + .remove = rk808_remove, > + .id_table = rk808_ids, > +}; > + > +module_i2c_driver(rk808_i2c_driver); > + > +MODULE_LICENSE("GPL"); > +MODULE_AUTHOR("Chris Zhong "); > +MODULE_AUTHOR("Zhang Qing "); > +MODULE_DESCRIPTION("RK808 PMIC driver"); [...] -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog