Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753704AbbEDMtB (ORCPT ); Mon, 4 May 2015 08:49:01 -0400 Received: from mga02.intel.com ([134.134.136.20]:46554 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753672AbbEDMsv convert rfc822-to-8bit (ORCPT ); Mon, 4 May 2015 08:48:51 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,366,1427785200"; d="scan'208";a="723274761" From: "Nicolae, Anda-maria" To: Krzysztof Kozlowski CC: "sre@kernel.org" , "dbaryshkov@gmail.com" , "robh+dt@kernel.org" , "pawel.moll@arm.com" , "mark.rutland@arm.com" , "ijc+devicetree@hellion.org.uk" , "galak@codeaurora.org" , "dwmw2@infradead.org" , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" Subject: RE: [PATCHv2] power_supply: Add support for Richtek rt9455 battery charger Thread-Topic: [PATCHv2] power_supply: Add support for Richtek rt9455 battery charger Thread-Index: AQHQgxrWvZyxeXHWo0e8KCl8mTcwmJ1ryYFa Date: Mon, 4 May 2015 12:48:45 +0000 Message-ID: <11982715D62E664DBACA4351A418B0581437E15D@IRSMSX107.ger.corp.intel.com> References: <1430338406-24012-1-git-send-email-anda-maria.nicolae@intel.com>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.3.86.137] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3681 Lines: 67 Hi Krzysztof, Inline are the answers to your questions. Thanks, Anda ________________________________________ From: k.kozlowski.k@gmail.com [k.kozlowski.k@gmail.com] on behalf of Krzysztof Kozlowski [k.kozlowski@samsung.com] Sent: Thursday, April 30, 2015 10:53 AM To: Nicolae, Anda-maria Cc: sre@kernel.org; dbaryshkov@gmail.com; robh+dt@kernel.org; pawel.moll@arm.com; mark.rutland@arm.com; ijc+devicetree@hellion.org.uk; galak@codeaurora.org; dwmw2@infradead.org; linux-pm@vger.kernel.org; linux-kernel@vger.kernel.org; devicetree@vger.kernel.org Subject: Re: [PATCHv2] power_supply: Add support for Richtek rt9455 battery charger 2015-04-30 5:13 GMT+09:00 Anda-Maria Nicolae : > Based on the datasheet found here: > http://www.richtek.com/download_ds.jsp?p=RT9455 > > Updates from the previous version: > - replaced license GPLv2 with GPL > - replaced vendor prefix rt with richtek > - replaced uppercase properties names from devicetree with lowercase separated by dash properties names > - replaced I/O read/write API with regmap_read/write and regmap_field_read/write > - used kernel multiline comment > - used DELAYED_WORK and scheduled the works in system_power_efficient_wq. It is high probability that the device is in suspend state while charging (i.e. the user leaves the device to charge during night) and it is needed that the scheduled works to be executed as planned. I think when device is suspended (e.g. to RAM) no work will ever be executed. The timers (for delayed work) will not wake up the device... RTC could wake but this is different story. My proposal of deferred timers is affected by idle CPU time. Are you sure that you want to wake up from the system suspend? Oh, now I better understand it. I don't think I need this feature. Also, the expire times that I use in the driver are not defined in the datasheet, so it should not be a problem if they are fired later. So, I will use INIT_DEFERRABLE_WORK instead of INIT_DELAYED_WORK. > - replaced struct power_supply_desc rt9455_charger_desc with static const struct power_supply_desc rt9455_charger_desc > - replaced if (IS_ERR_OR_NULL(info->charger)) with if (IS_ERR(info->charger)) > - replaced {"RTK9455", 0} with { "RTK9455", 0 } > - removed .owner = THIS_MODULE > > Signed-off-by: Anda-Maria Nicolae You missed some of my comments. I mentioned wrong error paths around put_usb_phy in probe. They do not seem to be fixed... Now I see what you meant. I looked at usb_get_phy() implementation and I saw that I cannot return NULL. So I replaced IS_ERR_OR_NULL() with IS_ERR(). I did this in rt9455_remove() and in rt9455_irq_handler_thread() functions, too. Also, this replacement (IS_ERR() instead of IS_ERR_OR_NULL()) should also be done in other power charger drivers: drivers/power/pda_power.c lines 319, 375, 410, 445; drivers/power/ab8500_charger.c line 3651; drivers/power/twl4030_charger.c lines 642, 674 and 706. I will send the patch for RT9455 charger soon. I will also send a patch to replace IS_ERR_OR_NULL() with IS_ERR() in the drivers listed above. Just one hint - mostly new bindings are posted in separate patches at the beginning of the patchset. I actually don't mind. but separating them will probably give you higher chance of review from DT people. This is also mentioned in: Documentation/devicetree/bindings/submitting-patches.txt Best regards, Krzysztof -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/