* Re: [PATCH 1/2] i2c: qup: Add device tree bindings information [not found] ` <1378814937.960.37.camel@iivanov-dev.int.mm-sol.com> @ 2013-09-10 13:59 ` Josh Cartwright 2013-09-10 14:43 ` Ivan T. Ivanov 0 siblings, 1 reply; 4+ messages in thread From: Josh Cartwright @ 2013-09-10 13:59 UTC (permalink / raw) To: Ivan T. Ivanov Cc: Kumar Gala, wsa, rob.herring, pawel.moll, mark.rutland, swarren, ian.campbell, rob, grant.likely, gavidov, sdharia, alokc, linux-i2c, devicetree, linux-kernel, linux-arm-msm [Hmm. Fixing b0rked LKML address; that might explain why I am not seeing Kumar's replies.] On Tue, Sep 10, 2013 at 03:08:57PM +0300, Ivan T. Ivanov wrote: > Hi Kumar, > > On Fri, 2013-08-30 at 10:21 -0500, Kumar Gala wrote: > > On Aug 29, 2013, at 12:26 PM, Ivan T. Ivanov wrote: > > >>> + > > >>> +Optional properties : > > >>> + - Child nodes conforming to i2c bus binding > > >>> + - clock-frequency : Desired I2C bus clock frequency in Hz. If > > >>> + not set thedefault frequency is 100kHz > > >>> + - qcom,src-freq : Frequency of the source clocking this bus in Hz. > > >>> + Divider value is set based on soruce-frequency and > > >>> + desired I2C bus frequency. If this value is not > > >>> + provided, the source clock is assumed to be running > > >>> + at 19.2 MHz. > > >> > > >> I'd spell out frequency instead of 'freq' to be consistent with 'clock-frequency' > > > > > > ok. > > > > > >> > > >> Is the frequency of the 'iface' clock? Can we not use clk_get_rate? > > > > > > It is for 'core' clock. I think that for higher I2C bus frequencies, > > > 'core' clock have to be higher, but I am not sure what is relation. > > > > Ok, can we use clk_get_rate on the 'core' clk to get its frequency instead of needing a DT prop for it? > > Probably I didn't explain it well. The 'core' clock have to be > accelerated before higher bus frequencies could be achieved. I think what Kumar is suggesting is that the QUP driver not do an explicit clk_set_rate() at all (which AFAICT is what's currently being done to set the consuming clock to the rate specified in 'qcom,src-freq'), but instead assume that the consuming clock has already been setup properly. Then the driver just uses clk_get_rate() and clock-frequency to calculate how to setup any internal dividers. > > >>> +Aliases: An alias may optionally be used to bind the I2C controller > > >>> +to bus number. Aliases are of the form i2c<n> where <n> is an integer > > >>> +representing the bus number to use. > > >>> + > > >>> +Example: > > >>> + > > >>> + aliases { > > >>> + i2c0 = &i2c_A; > > >>> + i2c1 = &i2c_B; > > >>> + i2c2 = &i2c_C; > > >>> + }; > > >> > > >> What is the purpose here? > > > > > > Define on which I2C bus this controller operate. I2C client > > > drivers usually do i2c_get_adapter(bus_number) before its > > > registration. This is for drivers before invention of > > > of_i2c_register_devices(), I believe. > > > > Since this is for upstream why dont we use of_i2c_register_devices() and remove this stuff related to aliases. > > Adapter driver already is using of_i2c_register_devices(). Also OF > helper function will/or is already part of i2c_register_adapter(). > Attempt here was to make it compatible with older i2c client drivers. I agree with Kumar on removing this. If we decide it is something worth keeping, logic to support it doesn't belong in the QUP driver, but in the i2c core. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] i2c: qup: Add device tree bindings information 2013-09-10 13:59 ` [PATCH 1/2] i2c: qup: Add device tree bindings information Josh Cartwright @ 2013-09-10 14:43 ` Ivan T. Ivanov 2013-09-25 16:06 ` Wolfram Sang 0 siblings, 1 reply; 4+ messages in thread From: Ivan T. Ivanov @ 2013-09-10 14:43 UTC (permalink / raw) To: Josh Cartwright Cc: Kumar Gala, wsa, rob.herring, pawel.moll, mark.rutland, swarren, ian.campbell, rob, grant.likely, gavidov, sdharia, alokc, linux-i2c, devicetree, linux-kernel, linux-arm-msm Hi, On Tue, 2013-09-10 at 08:59 -0500, Josh Cartwright wrote: > [Hmm. Fixing b0rked LKML address; that might explain why I am not > seeing Kumar's replies.] > Yes, sorry about this. > On Tue, Sep 10, 2013 at 03:08:57PM +0300, Ivan T. Ivanov wrote: > > Hi Kumar, > > > > On Fri, 2013-08-30 at 10:21 -0500, Kumar Gala wrote: > > > On Aug 29, 2013, at 12:26 PM, Ivan T. Ivanov wrote: > > > >>> + > > > >>> +Optional properties : > > > >>> + - Child nodes conforming to i2c bus binding > > > >>> + - clock-frequency : Desired I2C bus clock frequency in Hz. If > > > >>> + not set thedefault frequency is 100kHz > > > >>> + - qcom,src-freq : Frequency of the source clocking this bus in Hz. > > > >>> + Divider value is set based on soruce-frequency and > > > >>> + desired I2C bus frequency. If this value is not > > > >>> + provided, the source clock is assumed to be running > > > >>> + at 19.2 MHz. > > > >> > > > >> I'd spell out frequency instead of 'freq' to be consistent with 'clock-frequency' > > > > > > > > ok. > > > > > > > >> > > > >> Is the frequency of the 'iface' clock? Can we not use clk_get_rate? > > > > > > > > It is for 'core' clock. I think that for higher I2C bus frequencies, > > > > 'core' clock have to be higher, but I am not sure what is relation. > > > > > > Ok, can we use clk_get_rate on the 'core' clk to get its frequency instead of needing a DT prop for it? > > > > Probably I didn't explain it well. The 'core' clock have to be > > accelerated before higher bus frequencies could be achieved. > > I think what Kumar is suggesting is that the QUP driver not do an > explicit clk_set_rate() at all (which AFAICT is what's currently being > done to set the consuming clock to the rate specified in > 'qcom,src-freq'), but instead assume that the consuming clock has > already been setup properly. Then the driver just uses clk_get_rate() > and clock-frequency to calculate how to setup any internal dividers. Yes, I think I got it, but the point is that clock is not already set and it is driver responsibility to do that. > > > > >>> +Aliases: An alias may optionally be used to bind the I2C controller > > > >>> +to bus number. Aliases are of the form i2c<n> where <n> is an integer > > > >>> +representing the bus number to use. > > > >>> + > > > >>> +Example: > > > >>> + > > > >>> + aliases { > > > >>> + i2c0 = &i2c_A; > > > >>> + i2c1 = &i2c_B; > > > >>> + i2c2 = &i2c_C; > > > >>> + }; > > > >> > > > >> What is the purpose here? > > > > > > > > Define on which I2C bus this controller operate. I2C client > > > > drivers usually do i2c_get_adapter(bus_number) before its > > > > registration. This is for drivers before invention of > > > > of_i2c_register_devices(), I believe. > > > > > > Since this is for upstream why dont we use of_i2c_register_devices() and remove this stuff related to aliases. > > > > Adapter driver already is using of_i2c_register_devices(). Also OF > > helper function will/or is already part of i2c_register_adapter(). > > Attempt here was to make it compatible with older i2c client drivers. > > I agree with Kumar on removing this. If we decide it is something worth > keeping, logic to support it doesn't belong in the QUP driver, but in > the i2c core. I don't have strong objection here, will remove aliases support. Regards, Ivan > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] i2c: qup: Add device tree bindings information 2013-09-10 14:43 ` Ivan T. Ivanov @ 2013-09-25 16:06 ` Wolfram Sang 2013-09-26 5:04 ` Ivan T. Ivanov 0 siblings, 1 reply; 4+ messages in thread From: Wolfram Sang @ 2013-09-25 16:06 UTC (permalink / raw) To: Ivan T. Ivanov Cc: Josh Cartwright, Kumar Gala, rob.herring, pawel.moll, mark.rutland, swarren, ian.campbell, rob, grant.likely, gavidov, sdharia, alokc, linux-i2c, devicetree, linux-kernel, linux-arm-msm [-- Attachment #1: Type: text/plain, Size: 437 bytes --] > > I agree with Kumar on removing this. If we decide it is something worth > > keeping, logic to support it doesn't belong in the QUP driver, but in > > the i2c core. > > I don't have strong objection here, will remove aliases support. When resubmitting, please test against v3.12-rcX. of_i2c_register_devices() is in the core meanwhile and alias support for of is in the core for a while, too. Check i2c_add_adapter(). [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] i2c: qup: Add device tree bindings information 2013-09-25 16:06 ` Wolfram Sang @ 2013-09-26 5:04 ` Ivan T. Ivanov 0 siblings, 0 replies; 4+ messages in thread From: Ivan T. Ivanov @ 2013-09-26 5:04 UTC (permalink / raw) To: Wolfram Sang Cc: Josh Cartwright, Kumar Gala, rob.herring, pawel.moll, mark.rutland, swarren, ian.campbell, rob, grant.likely, gavidov, sdharia, alokc, linux-i2c, devicetree, linux-kernel, linux-arm-msm Hi, On Wed, 2013-09-25 at 18:06 +0200, Wolfram Sang wrote: > > > I agree with Kumar on removing this. If we decide it is something worth > > > keeping, logic to support it doesn't belong in the QUP driver, but in > > > the i2c core. > > > > I don't have strong objection here, will remove aliases support. > > When resubmitting, please test against v3.12-rcX. > of_i2c_register_devices() is in the core meanwhile and alias support for > of is in the core for a while, too. Check i2c_add_adapter(). Thanks, I will. Regards, Ivan ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-09-26 5:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1377782873-31931-1-git-send-email-iivanov@mm-sol.com>
[not found] ` <3A0F4153-1C55-4008-8EB1-D6FA60D87CEA@codeaurora.org>
[not found] ` <1377797186.30358.14.camel@localhost>
[not found] ` <767E9FBB-2975-4795-9C7E-69E302511FF2@codeaurora.org>
[not found] ` <1378814937.960.37.camel@iivanov-dev.int.mm-sol.com>
2013-09-10 13:59 ` [PATCH 1/2] i2c: qup: Add device tree bindings information Josh Cartwright
2013-09-10 14:43 ` Ivan T. Ivanov
2013-09-25 16:06 ` Wolfram Sang
2013-09-26 5:04 ` Ivan T. Ivanov
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox