From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753370AbbIJQms (ORCPT ); Thu, 10 Sep 2015 12:42:48 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:35382 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751724AbbIJQmp (ORCPT ); Thu, 10 Sep 2015 12:42:45 -0400 Subject: Re: [PATCH] power: bq24261_charger: Add support for TI BQ24261 charger To: Krzysztof Kozlowski , "Pallala, Ramakrishna" References: <1441560187-23611-1-git-send-email-ramakrishna.pallala@intel.com> <55F0C522.6070705@samsung.com> CC: "linux-kernel@vger.kernel.org" , "linux-pm@vger.kernel.org" , "devicetree@vger.kernel.org" , Sebastian Reichel , "Tc, Jenny" , Andreas Dannenberg From: "Andrew F. Davis" Message-ID: <55F1B2FD.4020608@ti.com> Date: Thu, 10 Sep 2015 11:42:37 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55F0C522.6070705@samsung.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/09/2015 06:47 PM, Krzysztof Kozlowski wrote: >>>> +- ti,enable-user-write: boolean, if present driver will allow the user space >>>> + to control the charging current and voltage through sysfs; >>> >>> This is not DT property. It does not describe hardware. >> We needed a mechanism to enable the sysfs writes on certain properties. >> If DT is not the place where should it go? > > DT is not the place. As I discussed later with Andreas, if you really > need this and if mainline is a place for that then probably this should > be compile option (a Kconfig symbol). > I think this would actually be a good use for module parameters, this way it could still be set at boot without re-compiling. I think compile-time disabling sysfs properties because they are "dangerous" is a little bit too artificially restricting and controlling, you can set permissions so only root can change them already. The kernel should not be restricting root, I understand the fear of someone rooting a machine and remotely over charging a LiPo[1], but these physical limits are hardware descriptions and can and should be set by DT, beyond this root should have full control over their machine. Besides root can already just unbind your driver and issue raw I2C commands to do the same thing. [1] http://i.imgur.com/vszJJ.jpg Regards, Andrew