From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com ([192.55.52.88]:6171 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932080AbaISTsV (ORCPT ); Fri, 19 Sep 2014 15:48:21 -0400 Date: Fri, 19 Sep 2014 12:47:51 -0700 From: Jacob Pan To: Srinivas Pandruvada Cc: Peter Meerwald , IIO , Lars-Peter Clausen , Hartmut Knaack , Ramakrishna Pallala Subject: Re: [PATCH v2 4/4] iio/adc/axp288: add support for axp288 gpadc Message-ID: <20140919124751.01c2de00@ultegra> In-Reply-To: <1411147870.3829.31.camel@spandruv-hsb-test> References: <1410267775-4683-1-git-send-email-jacob.jun.pan@linux.intel.com> <1410267775-4683-5-git-send-email-jacob.jun.pan@linux.intel.com> <20140919094310.6f045021@ultegra> <1411147870.3829.31.camel@spandruv-hsb-test> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-iio-owner@vger.kernel.org List-Id: linux-iio@vger.kernel.org On Fri, 19 Sep 2014 10:31:10 -0700 Srinivas Pandruvada wrote: > On Fri, 2014-09-19 at 09:43 -0700, Jacob Pan wrote: > > On Tue, 9 Sep 2014 15:46:31 +0200 (CEST) > > Peter Meerwald wrote: > > > > > > +static int axp288_gpadc_remove(struct platform_device *pdev) > > > > +{ > > > > + struct iio_dev *indio_dev = platform_get_drvdata(pdev); > > > > + > > > > + iio_device_unregister(indio_dev); > > > > + iio_map_array_unregister(indio_dev); > > > > > > axp288_gpadc_enable(axp2xx->regmap, false); > > on a second thought, we should not disable the adc even on driver > > removal. otherwise, internal fuel gauge will be affected. > As an independent driver it should disable when driver is removed and > bring back to state before init. You can check the state at init and > restore to that state on exit. > If the FG or other driver has dependency then either it should use the > driver model to take reference by not allowing removal of this driver. > Or use built in module so that it can never be removed. > I share you opinion. But in this case, ideally ADCs should have been enabled by FW since it should be always on, independent of fuel gauge driver. > Isn't it a platform specific dependency not universal? > it is more PMIC specific since its internal fuel gauge depends on ADC to be available regardless of what platform. > Thanks, > Srinivas > > [Jacob Pan]