All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: "Corey Minyard" <cminyard@mvista.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Andrzej Hajda" <andrzej.hajda@intel.com>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Antonio Borneo" <antonio.borneo@foss.st.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Marek Behún" <kabel@kernel.org>,
	"linux-renesas-soc@vger.kernel.org"
	<linux-renesas-soc@vger.kernel.org>,
	"Robert Foss" <rfoss@kernel.org>,
	"Jonas Karlman" <jonas@kwiboo.se>,
	"Kieran Bingham" <kieran.bingham@ideasonboard.com>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Geert Uytterhoeven" <geert@linux-m68k.org>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"Alessandro Zummo" <a.zummo@towertech.it>,
	"Jiasheng Jiang" <jiasheng@iscas.ac.cn>,
	"Abhinav Kumar" <quic_abhinavk@quicinc.com>,
	"Fabrizio Castro" <fabrizio.castro.jz@renesas.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Ahmad Fatoum" <a.fatoum@pengutronix.de>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Wolfram Sang" <wsa@kernel.org>,
	"Mark Brown" <broonie@kernel.org>,
	"Hans Verkuil" <hverkuil-cisco@xs4all.nl>
Subject: Re: [PATCH v5 01/11] i2c: Enhance i2c_new_ancillary_device API
Date: Thu, 8 Jun 2023 15:50:19 +0300	[thread overview]
Message-ID: <20230608125019.GD26742@pendragon.ideasonboard.com> (raw)
In-Reply-To: <OS0PR01MB592259E6A7ACED4A0548DD228650A@OS0PR01MB5922.jpnprd01.prod.outlook.com>

Hi Biju,

On Thu, Jun 08, 2023 at 11:00:19AM +0000, Biju Das wrote:
> > Subject: Re: [PATCH v5 01/11] i2c: Enhance i2c_new_ancillary_device API
> > On Thu, Jun 08, 2023 at 06:41:35AM +0000, Biju Das wrote:
> > > > Subject: RE: [PATCH v5 01/11] i2c: Enhance i2c_new_ancillary_device
> > > > API
> > > > > Subject: Re: [PATCH v5 01/11] i2c: Enhance
> > > > > i2c_new_ancillary_device API
> > > > >
> > > > > Hi all,
> > > > >
> > > > > sorry for not being able to chime in earlier.
> > > > >
> > > > > > In Biju's particular use case, the i2c device responds to two
> > > > > > addresses, which is the standard i2c ancillary use case.
> > > > > > However, what's special
> > > > >
> > > > > Not quite. ancillary is used when a *driver* needs to take care of
> > > > > two addresses. We already have devices bundling two features into
> > > > > the same chip. I recall at least RTC + EEPROM somewhere. And so
> > > > > far, we have been handling this by creating two nodes in DT and have proper binding docs.
> > > > > I think this is cleaner. First, you can see in DT already what the
> > > > > compound device really consists of. In this case, which RTC and
> > > > > RTC driver is exactly needed. Second, the code added here adds
> > > > > complexity to the I2C core with another layer of inderection for dummy devices.
> > > >
> > > > FYI, please see [1] and [2]
> > > >
> > > > As per DT maintainers, most of PMICs are described with one node,
> > > > even though RTC is on separate address. According to them the DT
> > > > schema allows multiple addresses for children.
> > > > But currently we lacks implementation for that. The enhancement to
> > > > this API allows that.
> > > >
> > > > > > As some resources are shared (knowledge about the clocks),
> > > > > > splitting this in two distinct devices in DT (which is what
> > > > > > Biju's initial patch series did) would need phandles to link both nodes together.
> > > > > >
> > > > > > Do you have a better idea how to represent this?
> > > > >
> > > > > Not sure if I understood this chip correctly, but maybe: The PMIC
> > > > > driver exposes a clock gate which can be consumed by the RTC driver?
> > >
> > > Let me give me some details of this PMIC chip.
> > >
> > > PMIC device has 2 addresses "0x12:- PMIC" , "0x6f"- rtc.
> > >
> > > It has XIN, XOUT, INT# pins and a register for firmware revisions.
> > 
> > Is the firmware revision register accessed through address 0x12 (PMIC) or
> > 0x6f (RTC) ?
> 
> 0x12(PMIC).
> 
> > > Based on the system design,
> > >
> > > If XIN and XOUT is connected to external crystal, Internal oscillator
> > > is enabled for RTC. In this case we need to set the oscillator bit to
> > > "0".
> > >
> > > If XIN is connected to external clock source, Internal oscillator is
> > > disabled for RTC. In this case we need to set the oscillator bit to
> > > "1".
> > 
> > Same here, which address is the oscillator bit accessed through ?
> 
> RTC (0x6F)--> to set oscillator bit.

And does the PMIC part depend on the oscillator bit being set correctly,
or is that used for the RTC only ?

> > > If XIN and XOUT not connected RTC operation not possible.
> > >
> > > IRQ# (optional) functionality is shared between PMIC and RTC. (PMIC
> > > fault for various bucks/LDOs/WDT/OTP/NVM and alarm condition).
> > 
> > IRQs can be shared between multiple devices so this shouldn't be a
> > problem.
> 
> OK. How do we represent this IRQ in DT?

You can simply reference the same IRQ from the interrupts property of
different DT nodes.

> > > The board, I have doesn't populate IRQ# pin. If needed some customers
> > > can populate IRQ# pin and use it for PMIC fault and RTC alarm.
> > >
> > > Also, currently my board has PMIC rev a0 where oscillator bit is
> > > inverted and internal oscillator is enabled (ie: XIN and XOUT is
> > > connected to external crystal)

-- 
Regards,

Laurent Pinchart

WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: "Wolfram Sang" <wsa@kernel.org>,
	"Geert Uytterhoeven" <geert@linux-m68k.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Andrzej Hajda" <andrzej.hajda@intel.com>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Robert Foss" <rfoss@kernel.org>,
	"David Airlie" <airlied@gmail.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Kieran Bingham" <kieran.bingham@ideasonboard.com>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Hans Verkuil" <hverkuil-cisco@xs4all.nl>,
	"Alessandro Zummo" <a.zummo@towertech.it>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Jonas Karlman" <jonas@kwiboo.se>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Corey Minyard" <cminyard@mvista.com>,
	"Marek Behún" <kabel@kernel.org>,
	"Jiasheng Jiang" <jiasheng@iscas.ac.cn>,
	"Antonio Borneo" <antonio.borneo@foss.st.com>,
	"Abhinav Kumar" <quic_abhinavk@quicinc.com>,
	"Ahmad Fatoum" <a.fatoum@pengutronix.de>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Fabrizio Castro" <fabrizio.castro.jz@renesas.com>,
	"linux-renesas-soc@vger.kernel.org"
	<linux-renesas-soc@vger.kernel.org>,
	"Mark Brown" <broonie@kernel.org>
Subject: Re: [PATCH v5 01/11] i2c: Enhance i2c_new_ancillary_device API
Date: Thu, 8 Jun 2023 15:50:19 +0300	[thread overview]
Message-ID: <20230608125019.GD26742@pendragon.ideasonboard.com> (raw)
In-Reply-To: <OS0PR01MB592259E6A7ACED4A0548DD228650A@OS0PR01MB5922.jpnprd01.prod.outlook.com>

Hi Biju,

On Thu, Jun 08, 2023 at 11:00:19AM +0000, Biju Das wrote:
> > Subject: Re: [PATCH v5 01/11] i2c: Enhance i2c_new_ancillary_device API
> > On Thu, Jun 08, 2023 at 06:41:35AM +0000, Biju Das wrote:
> > > > Subject: RE: [PATCH v5 01/11] i2c: Enhance i2c_new_ancillary_device
> > > > API
> > > > > Subject: Re: [PATCH v5 01/11] i2c: Enhance
> > > > > i2c_new_ancillary_device API
> > > > >
> > > > > Hi all,
> > > > >
> > > > > sorry for not being able to chime in earlier.
> > > > >
> > > > > > In Biju's particular use case, the i2c device responds to two
> > > > > > addresses, which is the standard i2c ancillary use case.
> > > > > > However, what's special
> > > > >
> > > > > Not quite. ancillary is used when a *driver* needs to take care of
> > > > > two addresses. We already have devices bundling two features into
> > > > > the same chip. I recall at least RTC + EEPROM somewhere. And so
> > > > > far, we have been handling this by creating two nodes in DT and have proper binding docs.
> > > > > I think this is cleaner. First, you can see in DT already what the
> > > > > compound device really consists of. In this case, which RTC and
> > > > > RTC driver is exactly needed. Second, the code added here adds
> > > > > complexity to the I2C core with another layer of inderection for dummy devices.
> > > >
> > > > FYI, please see [1] and [2]
> > > >
> > > > As per DT maintainers, most of PMICs are described with one node,
> > > > even though RTC is on separate address. According to them the DT
> > > > schema allows multiple addresses for children.
> > > > But currently we lacks implementation for that. The enhancement to
> > > > this API allows that.
> > > >
> > > > > > As some resources are shared (knowledge about the clocks),
> > > > > > splitting this in two distinct devices in DT (which is what
> > > > > > Biju's initial patch series did) would need phandles to link both nodes together.
> > > > > >
> > > > > > Do you have a better idea how to represent this?
> > > > >
> > > > > Not sure if I understood this chip correctly, but maybe: The PMIC
> > > > > driver exposes a clock gate which can be consumed by the RTC driver?
> > >
> > > Let me give me some details of this PMIC chip.
> > >
> > > PMIC device has 2 addresses "0x12:- PMIC" , "0x6f"- rtc.
> > >
> > > It has XIN, XOUT, INT# pins and a register for firmware revisions.
> > 
> > Is the firmware revision register accessed through address 0x12 (PMIC) or
> > 0x6f (RTC) ?
> 
> 0x12(PMIC).
> 
> > > Based on the system design,
> > >
> > > If XIN and XOUT is connected to external crystal, Internal oscillator
> > > is enabled for RTC. In this case we need to set the oscillator bit to
> > > "0".
> > >
> > > If XIN is connected to external clock source, Internal oscillator is
> > > disabled for RTC. In this case we need to set the oscillator bit to
> > > "1".
> > 
> > Same here, which address is the oscillator bit accessed through ?
> 
> RTC (0x6F)--> to set oscillator bit.

And does the PMIC part depend on the oscillator bit being set correctly,
or is that used for the RTC only ?

> > > If XIN and XOUT not connected RTC operation not possible.
> > >
> > > IRQ# (optional) functionality is shared between PMIC and RTC. (PMIC
> > > fault for various bucks/LDOs/WDT/OTP/NVM and alarm condition).
> > 
> > IRQs can be shared between multiple devices so this shouldn't be a
> > problem.
> 
> OK. How do we represent this IRQ in DT?

You can simply reference the same IRQ from the interrupts property of
different DT nodes.

> > > The board, I have doesn't populate IRQ# pin. If needed some customers
> > > can populate IRQ# pin and use it for PMIC fault and RTC alarm.
> > >
> > > Also, currently my board has PMIC rev a0 where oscillator bit is
> > > inverted and internal oscillator is enabled (ie: XIN and XOUT is
> > > connected to external crystal)

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2023-06-08 12:50 UTC|newest]

Thread overview: 142+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-22 10:18 [PATCH v5 00/11] Add Renesas PMIC RAA215300 and built-in RTC support Biju Das
2023-05-22 10:18 ` [PATCH v5 01/11] i2c: Enhance i2c_new_ancillary_device API Biju Das
2023-05-22 10:18   ` Biju Das
2023-05-23  9:50   ` Hans Verkuil
2023-05-23  9:50     ` Hans Verkuil
2023-05-25 16:49   ` Geert Uytterhoeven
2023-05-25 16:49     ` Geert Uytterhoeven
2023-05-29  8:05   ` Laurent Pinchart
2023-05-29  8:05     ` Laurent Pinchart
2023-05-29  9:00     ` Biju Das
2023-05-29  9:00       ` Biju Das
2023-05-31  8:59       ` Laurent Pinchart
2023-05-31  8:59         ` Laurent Pinchart
2023-05-31  9:34         ` Biju Das
2023-05-31  9:34           ` Biju Das
2023-05-31 11:41           ` Laurent Pinchart
2023-05-31 11:41             ` Laurent Pinchart
2023-05-31 12:53             ` Biju Das
2023-05-31 12:53               ` Biju Das
2023-05-31 13:35               ` Laurent Pinchart
2023-05-31 13:35                 ` Laurent Pinchart
2023-05-31 13:44                 ` Biju Das
2023-05-31 13:44                   ` Biju Das
2023-06-02  7:40                   ` Biju Das
2023-06-02  7:40                     ` Biju Das
2023-05-31 13:37               ` Geert Uytterhoeven
2023-05-31 13:37                 ` Geert Uytterhoeven
2023-05-31 13:47                 ` Biju Das
2023-05-31 13:47                   ` Biju Das
2023-05-31 12:51         ` Geert Uytterhoeven
2023-05-31 12:51           ` Geert Uytterhoeven
2023-05-31 13:37           ` Laurent Pinchart
2023-05-31 13:37             ` Laurent Pinchart
2023-05-31 13:39             ` Geert Uytterhoeven
2023-05-31 13:39               ` Geert Uytterhoeven
2023-06-05  9:30           ` Wolfram Sang
2023-06-05  9:30             ` Wolfram Sang
2023-06-07  8:53           ` Wolfram Sang
2023-06-07  8:53             ` Wolfram Sang
2023-06-07 10:58             ` Biju Das
2023-06-07 10:58               ` Biju Das
2023-06-08  6:41               ` Biju Das
2023-06-08  6:41                 ` Biju Das
2023-06-08 10:39                 ` Laurent Pinchart
2023-06-08 10:39                   ` Laurent Pinchart
2023-06-08 11:00                   ` Biju Das
2023-06-08 11:00                     ` Biju Das
2023-06-08 12:50                     ` Laurent Pinchart [this message]
2023-06-08 12:50                       ` Laurent Pinchart
2023-06-08 12:57                       ` Biju Das
2023-06-08 12:57                         ` Biju Das
2023-06-12  9:53                         ` Biju Das
2023-06-12  9:53                           ` Biju Das
2023-06-12 12:23                           ` Laurent Pinchart
2023-06-12 12:23                             ` Laurent Pinchart
2023-06-12 12:42                             ` Biju Das
2023-06-12 12:42                               ` Biju Das
2023-06-12 12:54                               ` Laurent Pinchart
2023-06-12 12:54                                 ` Laurent Pinchart
2023-06-12 13:08                                 ` Geert Uytterhoeven
2023-06-12 13:08                                   ` Geert Uytterhoeven
2023-06-12 13:19                                   ` Laurent Pinchart
2023-06-12 13:19                                     ` Laurent Pinchart
2023-06-12 12:44                             ` Geert Uytterhoeven
2023-06-12 12:44                               ` Geert Uytterhoeven
2023-06-12 13:02                               ` Laurent Pinchart
2023-06-12 13:02                                 ` Laurent Pinchart
2023-06-12 12:35                           ` Wolfram Sang
2023-06-12 12:35                             ` Wolfram Sang
2023-06-12 12:42                             ` Geert Uytterhoeven
2023-06-12 12:42                               ` Geert Uytterhoeven
2023-06-12 12:48                               ` Wolfram Sang
2023-06-12 12:48                                 ` Wolfram Sang
2023-06-12 13:00                                 ` Geert Uytterhoeven
2023-06-12 13:00                                   ` Geert Uytterhoeven
2023-06-12 20:43                                   ` Wolfram Sang
2023-06-12 20:43                                     ` Wolfram Sang
2023-06-13  7:24                                     ` Biju Das
2023-06-13  7:24                                       ` Biju Das
2023-06-13 17:57                                       ` Biju Das
2023-06-13 17:57                                         ` Biju Das
2023-06-13 19:31                                         ` Biju Das
2023-06-13 19:31                                           ` Biju Das
2023-06-14  8:13                                           ` Laurent Pinchart
2023-06-14  8:13                                             ` Laurent Pinchart
2023-06-14  8:21                                             ` Biju Das
2023-06-14  8:21                                               ` Biju Das
2023-06-14  9:18                                               ` Geert Uytterhoeven
2023-06-14  9:18                                                 ` Geert Uytterhoeven
2023-06-14 11:04                                                 ` Biju Das
2023-06-14 11:04                                                   ` Biju Das
2023-06-15  9:00                                                   ` Geert Uytterhoeven
2023-06-15  9:00                                                     ` Geert Uytterhoeven
2023-06-14  9:54                                               ` Laurent Pinchart
2023-06-14  9:54                                                 ` Laurent Pinchart
2023-06-14 11:30                                                 ` Biju Das
2023-06-14 11:30                                                   ` Biju Das
2023-06-15  9:26                                                   ` Laurent Pinchart
2023-06-15  9:26                                                     ` Laurent Pinchart
2023-06-20  8:06                                                     ` Biju Das
2023-06-20  8:06                                                       ` Biju Das
2023-06-13  7:25                                     ` Geert Uytterhoeven
2023-06-13 10:45                                       ` Biju Das
2023-06-13 14:51                                         ` Geert Uytterhoeven
2023-06-13 14:51                                           ` Geert Uytterhoeven
2023-06-13 16:11                                           ` Biju Das
2023-06-13 16:11                                             ` Biju Das
2023-06-14  7:53                                             ` Geert Uytterhoeven
2023-06-14  7:53                                               ` Geert Uytterhoeven
2023-06-14  8:02                                               ` Biju Das
2023-06-14  8:02                                                 ` Biju Das
2023-06-15  8:07                                               ` Geert Uytterhoeven
2023-06-15  8:07                                                 ` Geert Uytterhoeven
2023-06-15  9:23                                                 ` Laurent Pinchart
2023-06-15  9:23                                                   ` Laurent Pinchart
2023-06-16  6:32                                                   ` Wolfram Sang
2023-06-16  6:32                                                     ` Wolfram Sang
2023-06-19  8:17                                                     ` Biju Das
2023-06-19  8:17                                                       ` Biju Das
2023-06-12 13:00                             ` Biju Das
2023-06-12 13:00                               ` Biju Das
2023-05-22 10:18 ` [PATCH v5 02/11] dt-bindings: rtc: isl1208: Convert to json-schema Biju Das
2023-05-22 10:18 ` [PATCH v5 03/11] dt-bindings: rtc: isil,isl1208: Document clock and clock-names properties Biju Das
2023-05-25 16:52   ` Geert Uytterhoeven
2023-05-22 10:18 ` [PATCH v5 04/11] rtc: isl1208: Drop name variable Biju Das
2023-05-22 10:18 ` [PATCH v5 05/11] rtc: isl1208: Make similar I2C and DT-based matching table Biju Das
2023-05-22 10:18 ` [PATCH v5 06/11] rtc: isl1208: Drop enum isl1208_id and split isl1208_configs[] Biju Das
2023-05-22 10:18 ` [PATCH v5 07/11] rtc: isl1208: Add isl1208_set_xtoscb() Biju Das
2023-05-26  7:20   ` Geert Uytterhoeven
2023-05-30 16:48     ` Biju Das
2023-05-22 10:18 ` [PATCH v5 08/11] rtc: isl1208: Add support for the built-in RTC on the PMIC RAA215300 Biju Das
2023-05-26  7:35   ` Geert Uytterhoeven
2023-05-30 17:28     ` Biju Das
2023-05-22 10:18 ` [PATCH v5 09/11] regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings Biju Das
2023-05-26  7:37   ` Geert Uytterhoeven
2023-05-22 10:18 ` [PATCH v5 10/11] regulator: Add Renesas PMIC RAA215300 driver Biju Das
2023-05-24 10:57   ` Mark Brown
2023-05-24 13:26     ` Biju Das
2023-05-22 10:18 ` [PATCH v5 11/11] arm64: dts: renesas: rzg2l-smarc-som: Enable PMIC and built-in RTC Biju Das
2023-05-26  7:55   ` Geert Uytterhoeven
2023-05-26  8:48     ` Biju Das
2023-05-30 18:26 ` [PATCH v5 00/11] Add Renesas PMIC RAA215300 and built-in RTC support Biju Das

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230608125019.GD26742@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=a.fatoum@pengutronix.de \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andrzej.hajda@intel.com \
    --cc=antonio.borneo@foss.st.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=broonie@kernel.org \
    --cc=cminyard@mvista.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fabrizio.castro.jz@renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jernej.skrabec@gmail.com \
    --cc=jiasheng@iscas.ac.cn \
    --cc=jonas@kwiboo.se \
    --cc=kabel@kernel.org \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=quic_abhinavk@quicinc.com \
    --cc=rfoss@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.