<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git, branch toradex_6.6-2.0.x-imx</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>arm64: dts: freescale: imx8mm-verdin: Fix SD regulator startup delay</title>
<updated>2024-10-28T11:47:14+00:00</updated>
<author>
<name>Francesco Dolcini</name>
<email>francesco.dolcini@toradex.com</email>
</author>
<published>2024-10-24T09:57:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=da3e0481aa7a6866ddb58f8005357125b7af50bd'/>
<id>da3e0481aa7a6866ddb58f8005357125b7af50bd</id>
<content type='text'>
The power switch used to power the SD card interface might have
more than 2ms turn-on time, increase the startup delay to 20ms to
prevent failures.

Upstream-Status: Submitted [https://lore.kernel.org/all/20241024130651.49718-1-francesco@dolcini.it/]
Fixes: 6a57f224f734 ("arm64: dts: freescale: add initial support for verdin imx8m mini")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Francesco Dolcini &lt;francesco.dolcini@toradex.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The power switch used to power the SD card interface might have
more than 2ms turn-on time, increase the startup delay to 20ms to
prevent failures.

Upstream-Status: Submitted [https://lore.kernel.org/all/20241024130651.49718-1-francesco@dolcini.it/]
Fixes: 6a57f224f734 ("arm64: dts: freescale: add initial support for verdin imx8m mini")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Francesco Dolcini &lt;francesco.dolcini@toradex.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>arm64: dts: freescale: imx8mp-verdin: Fix SD regulator startup delay</title>
<updated>2024-10-28T11:47:14+00:00</updated>
<author>
<name>Francesco Dolcini</name>
<email>francesco.dolcini@toradex.com</email>
</author>
<published>2024-10-24T09:58:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6fd944d97f83ca8d75a00b164581fb64e156a9a2'/>
<id>6fd944d97f83ca8d75a00b164581fb64e156a9a2</id>
<content type='text'>
The power switch used to power the SD card interface might have
more than 2ms turn-on time, increase the startup delay to 20ms to
prevent failures.

Upstream-Status: Submitted [https://lore.kernel.org/all/20241024130651.49718-1-francesco@dolcini.it/]
Fixes: a39ed23bdf6e ("arm64: dts: freescale: add initial support for verdin imx8m plus")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Francesco Dolcini &lt;francesco.dolcini@toradex.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The power switch used to power the SD card interface might have
more than 2ms turn-on time, increase the startup delay to 20ms to
prevent failures.

Upstream-Status: Submitted [https://lore.kernel.org/all/20241024130651.49718-1-francesco@dolcini.it/]
Fixes: a39ed23bdf6e ("arm64: dts: freescale: add initial support for verdin imx8m plus")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Francesco Dolcini &lt;francesco.dolcini@toradex.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>arm64: dts: imx8mp-verdin: add single-master property to all i2c nodes</title>
<updated>2024-10-25T12:59:09+00:00</updated>
<author>
<name>Stefan Eichenberger</name>
<email>stefan.eichenberger@toradex.com</email>
</author>
<published>2024-10-25T07:05:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cbbd2e36b52e13d9533daedb85726f5ab5626799'/>
<id>cbbd2e36b52e13d9533daedb85726f5ab5626799</id>
<content type='text'>
By default we expect all i2c nodes to be single-master, we do not have
any module or carrier board that uses multi-master mode on any i2c
controller. With this property set, we benefit from optimisations made
exclusively for single-masters.

Upstream-Status: Submitted [https://lore.kernel.org/all/20241025095915.22313-1-eichest@gmail.com]
Signed-off-by: Stefan Eichenberger &lt;stefan.eichenberger@toradex.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
By default we expect all i2c nodes to be single-master, we do not have
any module or carrier board that uses multi-master mode on any i2c
controller. With this property set, we benefit from optimisations made
exclusively for single-masters.

Upstream-Status: Submitted [https://lore.kernel.org/all/20241025095915.22313-1-eichest@gmail.com]
Signed-off-by: Stefan Eichenberger &lt;stefan.eichenberger@toradex.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>arm64: dts: imx8mm-verdin: add single-master property to all i2c nodes</title>
<updated>2024-10-25T12:58:18+00:00</updated>
<author>
<name>Stefan Eichenberger</name>
<email>stefan.eichenberger@toradex.com</email>
</author>
<published>2024-10-25T07:03:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0026f38f79557535f023f99444e7e090838bac5d'/>
<id>0026f38f79557535f023f99444e7e090838bac5d</id>
<content type='text'>
By default we expect all i2c nodes to be single-master, we do not have
any module or carrier board that uses multi-master mode on any i2c
controller. With this property set, we benefit from optimisations made
exclusively for single-masters.

Upstream-Status: Submitted [https://lore.kernel.org/all/20241025095915.22313-1-eichest@gmail.com]
Signed-off-by: Stefan Eichenberger &lt;stefan.eichenberger@toradex.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
By default we expect all i2c nodes to be single-master, we do not have
any module or carrier board that uses multi-master mode on any i2c
controller. With this property set, we benefit from optimisations made
exclusively for single-masters.

Upstream-Status: Submitted [https://lore.kernel.org/all/20241025095915.22313-1-eichest@gmail.com]
Signed-off-by: Stefan Eichenberger &lt;stefan.eichenberger@toradex.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: imx: prevent rescheduling in non dma mode</title>
<updated>2024-10-25T12:58:13+00:00</updated>
<author>
<name>Stefan Eichenberger</name>
<email>stefan.eichenberger@toradex.com</email>
</author>
<published>2024-07-05T12:32:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=20fb3dbfc8e507d5bd10559ad3200e29d26fd0f1'/>
<id>20fb3dbfc8e507d5bd10559ad3200e29d26fd0f1</id>
<content type='text'>
We are experiencing a problem with the i.MX I2C controller when
communicating with SMBus devices. We are seeing devices time-out because
the time between sending/receiving two bytes is too long, and the SMBus
device returns to the idle state. This happens because the i.MX I2C
controller sends and receives byte by byte. When a byte is sent or
received, we get an interrupt and can send or receive the next byte.

The current implementation sends a byte and then waits for an event
generated by the interrupt subroutine. After the event is received, the
next byte is sent and we wait again. This waiting allows the scheduler
to reschedule other tasks, with the disadvantage that we may not send
the next byte for a long time because the send task is not immediately
scheduled. For example, if the rescheduling takes more than 25ms, this
can cause SMBus devices to timeout and communication to fail.

This patch changes the behavior so that we do not reschedule the
send/receive task, but instead send or receive the next byte in the
interrupt subroutine. This prevents rescheduling and drastically reduces
the time between sending/receiving bytes. The cost in the interrupt
subroutine is relatively small, we check what state we are in and then
send/receive the next byte. Before we had to call wake_up, which is even
less expensive. However, we also had to do some scheduling, which
increased the overall cost compared to the new solution. The wake_up
function to wake up the send/receive task is now only called when an
error occurs or when the transfer is complete.

Upstream-Status: Submitted [https://lore.kernel.org/linux-i2c/20241014131635.205489-1-eichest@gmail.com]
Signed-off-by: Stefan Eichenberger &lt;stefan.eichenberger@toradex.com&gt;
Acked-by: Oleksij Rempel &lt;o.rempel@pengutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We are experiencing a problem with the i.MX I2C controller when
communicating with SMBus devices. We are seeing devices time-out because
the time between sending/receiving two bytes is too long, and the SMBus
device returns to the idle state. This happens because the i.MX I2C
controller sends and receives byte by byte. When a byte is sent or
received, we get an interrupt and can send or receive the next byte.

The current implementation sends a byte and then waits for an event
generated by the interrupt subroutine. After the event is received, the
next byte is sent and we wait again. This waiting allows the scheduler
to reschedule other tasks, with the disadvantage that we may not send
the next byte for a long time because the send task is not immediately
scheduled. For example, if the rescheduling takes more than 25ms, this
can cause SMBus devices to timeout and communication to fail.

This patch changes the behavior so that we do not reschedule the
send/receive task, but instead send or receive the next byte in the
interrupt subroutine. This prevents rescheduling and drastically reduces
the time between sending/receiving bytes. The cost in the interrupt
subroutine is relatively small, we check what state we are in and then
send/receive the next byte. Before we had to call wake_up, which is even
less expensive. However, we also had to do some scheduling, which
increased the overall cost compared to the new solution. The wake_up
function to wake up the send/receive task is now only called when an
error occurs or when the transfer is complete.

Upstream-Status: Submitted [https://lore.kernel.org/linux-i2c/20241014131635.205489-1-eichest@gmail.com]
Signed-off-by: Stefan Eichenberger &lt;stefan.eichenberger@toradex.com&gt;
Acked-by: Oleksij Rempel &lt;o.rempel@pengutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: imx: separate atomic, dma and non-dma use case</title>
<updated>2024-10-25T12:58:05+00:00</updated>
<author>
<name>Stefan Eichenberger</name>
<email>stefan.eichenberger@toradex.com</email>
</author>
<published>2024-07-12T13:34:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a7bfbf9bc8d5e209312a322e73d3e6c598575bf8'/>
<id>a7bfbf9bc8d5e209312a322e73d3e6c598575bf8</id>
<content type='text'>
Separate the atomic, dma and non-dma use case as a preparation step for
moving the non-dma use case to the isr to avoid rescheduling while a
transfer is in progress.

Upstream-Status: Submitted [https://lore.kernel.org/linux-i2c/20241014131635.205489-1-eichest@gmail.com]
Signed-off-by: Stefan Eichenberger &lt;stefan.eichenberger@toradex.com&gt;
Reviewed-by: Frank Li &lt;Frank.Li@nxp.com&gt;
Acked-by: Oleksij Rempel &lt;o.rempel@pengutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Separate the atomic, dma and non-dma use case as a preparation step for
moving the non-dma use case to the isr to avoid rescheduling while a
transfer is in progress.

Upstream-Status: Submitted [https://lore.kernel.org/linux-i2c/20241014131635.205489-1-eichest@gmail.com]
Signed-off-by: Stefan Eichenberger &lt;stefan.eichenberger@toradex.com&gt;
Reviewed-by: Frank Li &lt;Frank.Li@nxp.com&gt;
Acked-by: Oleksij Rempel &lt;o.rempel@pengutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: imx: do not poll for bus busy in single master mode</title>
<updated>2024-10-25T12:56:17+00:00</updated>
<author>
<name>Stefan Eichenberger</name>
<email>stefan.eichenberger@toradex.com</email>
</author>
<published>2024-07-05T12:36:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=01e990e094457fa7881db2b5086f0bbbaba2e01d'/>
<id>01e990e094457fa7881db2b5086f0bbbaba2e01d</id>
<content type='text'>
According to the i.MX8M Mini reference manual chapter "16.1.4.2
Generation of Start" it is only necessary to poll for bus busy and
arbitration lost in multi master mode. This helps to avoid rescheduling
while the i2c bus is busy and avoids SMBus devices to timeout. For
backward compatibility, the single-master property needs to be
explicitly set to disable the bus busy polling.

Upstream-Status: Submitted [https://lore.kernel.org/linux-i2c/20241014131635.205489-1-eichest@gmail.com]
Signed-off-by: Stefan Eichenberger &lt;stefan.eichenberger@toradex.com&gt;
Reviewed-by: Frank Li &lt;Frank.Li@nxp.com&gt;
Acked-by: Oleksij Rempel &lt;o.rempel@pengutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
According to the i.MX8M Mini reference manual chapter "16.1.4.2
Generation of Start" it is only necessary to poll for bus busy and
arbitration lost in multi master mode. This helps to avoid rescheduling
while the i2c bus is busy and avoids SMBus devices to timeout. For
backward compatibility, the single-master property needs to be
explicitly set to disable the bus busy polling.

Upstream-Status: Submitted [https://lore.kernel.org/linux-i2c/20241014131635.205489-1-eichest@gmail.com]
Signed-off-by: Stefan Eichenberger &lt;stefan.eichenberger@toradex.com&gt;
Reviewed-by: Frank Li &lt;Frank.Li@nxp.com&gt;
Acked-by: Oleksij Rempel &lt;o.rempel@pengutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>arm64: dts: imx8mp: Fix VPU PGC power-domain parents</title>
<updated>2024-09-30T22:11:49+00:00</updated>
<author>
<name>Vitor Soares</name>
<email>vitor.soares@toradex.com</email>
</author>
<published>2024-07-01T12:43:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0f1b9264c9b5d1fad27ba8c6e38fa36584e6a3d8'/>
<id>0f1b9264c9b5d1fad27ba8c6e38fa36584e6a3d8</id>
<content type='text'>
On iMX8M Plus QuadLite (VPU-less SoC), the dependency between VPU power
domains lead to a deferred probe error during boot:
[   17.140195] imx-pgc imx-pgc-domain.8: failed to command PGC
[   17.147183] platform imx-pgc-domain.11: deferred probe pending: (reason unknown)
[   17.147200] platform imx-pgc-domain.12: deferred probe pending: (reason unknown)
[   17.147207] platform imx-pgc-domain.13: deferred probe pending: (reason unknown)

This is incorrect and should be the VPU blk-ctrl controlling these power
domains, which is already doing it.

After removing the `power-domain` property from the VPU PGC nodes, both
iMX8M Plus w/ and w/out VPU boot correctly. However, it breaks the
suspend/resume functionality. A fix for this is pending, see Links.

Upstream-Status: Submitted [https://lore.kernel.org/all/20240701124302.16520-1-ivitro@gmail.com/]
Cc: stable@vger.kernel.org
Fixes: df680992dd62 ("arm64: dts: imx8mp: add vpu pgc nodes")
Link: https://lore.kernel.org/all/fcd6acc268b8642371cf289149b2b1c3e90c7f45.camel@pengutronix.de/
Link: https://lore.kernel.org/all/20240418155151.355133-1-ivitro@gmail.com/
Suggested-by: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Signed-off-by: Vitor Soares &lt;vitor.soares@toradex.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On iMX8M Plus QuadLite (VPU-less SoC), the dependency between VPU power
domains lead to a deferred probe error during boot:
[   17.140195] imx-pgc imx-pgc-domain.8: failed to command PGC
[   17.147183] platform imx-pgc-domain.11: deferred probe pending: (reason unknown)
[   17.147200] platform imx-pgc-domain.12: deferred probe pending: (reason unknown)
[   17.147207] platform imx-pgc-domain.13: deferred probe pending: (reason unknown)

This is incorrect and should be the VPU blk-ctrl controlling these power
domains, which is already doing it.

After removing the `power-domain` property from the VPU PGC nodes, both
iMX8M Plus w/ and w/out VPU boot correctly. However, it breaks the
suspend/resume functionality. A fix for this is pending, see Links.

Upstream-Status: Submitted [https://lore.kernel.org/all/20240701124302.16520-1-ivitro@gmail.com/]
Cc: stable@vger.kernel.org
Fixes: df680992dd62 ("arm64: dts: imx8mp: add vpu pgc nodes")
Link: https://lore.kernel.org/all/fcd6acc268b8642371cf289149b2b1c3e90c7f45.camel@pengutronix.de/
Link: https://lore.kernel.org/all/20240418155151.355133-1-ivitro@gmail.com/
Suggested-by: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Signed-off-by: Vitor Soares &lt;vitor.soares@toradex.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pmdomain: imx8m-blk-ctrl: fix suspend/resume order</title>
<updated>2024-09-30T22:10:13+00:00</updated>
<author>
<name>Vitor Soares</name>
<email>vitor.soares@toradex.com</email>
</author>
<published>2024-04-18T15:51:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e0dd36528500cc9cdaca981e76738927623ad674'/>
<id>e0dd36528500cc9cdaca981e76738927623ad674</id>
<content type='text'>
During the probe, the genpd power_dev is added to the dpm_list after
blk_ctrl due to its parent/child relationship. Making the blk_ctrl
suspend after and resume before the genpd power_dev.

As a consequence, the system hangs when resuming the VPU due to the
power domain dependency.

To ensure the proper suspend/resume order, add a device link betweem
blk_ctrl and genpd power_dev. It guarantees genpd power_dev is suspended
after and resumed before blk-ctrl.

Upstream-Status: Submitted [https://lore.kernel.org/all/20240418155151.355133-1-ivitro@gmail.com/]
Cc: stable@vger.kernel.org
Closes: https://lore.kernel.org/all/fccbb040330a706a4f7b34875db1d896a0bf81c8.camel@gmail.com/
Link: https://lore.kernel.org/all/20240409085802.290439-1-ivitro@gmail.com/
Fixes: 2684ac05a8c4 ("soc: imx: add i.MX8M blk-ctrl driver")
Suggested-by: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Reviewed-by: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Signed-off-by: Vitor Soares &lt;vitor.soares@toradex.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
During the probe, the genpd power_dev is added to the dpm_list after
blk_ctrl due to its parent/child relationship. Making the blk_ctrl
suspend after and resume before the genpd power_dev.

As a consequence, the system hangs when resuming the VPU due to the
power domain dependency.

To ensure the proper suspend/resume order, add a device link betweem
blk_ctrl and genpd power_dev. It guarantees genpd power_dev is suspended
after and resumed before blk-ctrl.

Upstream-Status: Submitted [https://lore.kernel.org/all/20240418155151.355133-1-ivitro@gmail.com/]
Cc: stable@vger.kernel.org
Closes: https://lore.kernel.org/all/fccbb040330a706a4f7b34875db1d896a0bf81c8.camel@gmail.com/
Link: https://lore.kernel.org/all/20240409085802.290439-1-ivitro@gmail.com/
Fixes: 2684ac05a8c4 ("soc: imx: add i.MX8M blk-ctrl driver")
Suggested-by: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Reviewed-by: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Signed-off-by: Vitor Soares &lt;vitor.soares@toradex.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>arm64: dts: freescale: imx8mm-verdin: Add Ivy carrier board</title>
<updated>2024-09-25T11:25:16+00:00</updated>
<author>
<name>João Paulo Gonçalves</name>
<email>joao.goncalves@toradex.com</email>
</author>
<published>2024-06-17T16:49:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=558ba3740880b6e2bdf86782e9a5052047885721'/>
<id>558ba3740880b6e2bdf86782e9a5052047885721</id>
<content type='text'>
Add Toradex Verdin Ivy carrier board support. One notable feature of Ivy
is the analog inputs. These inputs are multiplexed, allowing the same
input to measure either voltage or current. For current measurements,
a GPIO switch enables or disables the shunt resistor. This process is
automatically managed by the Linux kernel using the IIO and MUX
subsystems. Voltage measurement is always enabled, but the voltage
measured by the ADC is scaled by a cascade voltage divider. In the
device tree, the equivalent gain of the voltage divider is used, which
can be calculated as follows:

               ------------
               +          |
                         .-.
              R1=30K     | |
                         | |
                         '-'
                          |-------------------
    Analog Input (AIN)    |                  |
                         .-.                .-.
                  R2=10K | |         R3=30K | |
                         | |                | |
                         '-'                '-'
                          |                  |
                          |                  |--------
                          |                 .-.      +
                          |          R4=10K | |
                          |                 | |      ADC Input (Channels 0 and 1)
                          |                 '-'
               -          |                  |       -
               -----------|                  |--------
                         ===                ===
                         GND                GND

Vin  = Analog Input (AIN)
Vout = ADC Input
Rth  = Thevenin Equiv. Resistance
Vth  = Thevenin Equiv. Voltage
RL   = Load Resistor

R1 = 30K, R2 = 10K, R3 = 30K, R4 = 10K
RL = R4 = 10K

Rth  = (R1 // R2) + R3 = 37500 Ohms
Vth  = (Vin * R2) / (R1 + R2) = Vin/4;
Vout = (Vth * RL)/ (Rth + RL) = Vth/4.75 = Vin/19
Gain = Vout/Vin = 1/19

https://www.toradex.com/products/carrier-board/ivy-carrier-board

Upstream-Status: Submitted [https://lore.kernel.org/lkml/20240924113048.125761-1-francesco@dolcini.it/]
Signed-off-by: João Paulo Gonçalves &lt;joao.goncalves@toradex.com&gt;
Signed-off-by: Francesco Dolcini &lt;francesco.dolcini@toradex.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add Toradex Verdin Ivy carrier board support. One notable feature of Ivy
is the analog inputs. These inputs are multiplexed, allowing the same
input to measure either voltage or current. For current measurements,
a GPIO switch enables or disables the shunt resistor. This process is
automatically managed by the Linux kernel using the IIO and MUX
subsystems. Voltage measurement is always enabled, but the voltage
measured by the ADC is scaled by a cascade voltage divider. In the
device tree, the equivalent gain of the voltage divider is used, which
can be calculated as follows:

               ------------
               +          |
                         .-.
              R1=30K     | |
                         | |
                         '-'
                          |-------------------
    Analog Input (AIN)    |                  |
                         .-.                .-.
                  R2=10K | |         R3=30K | |
                         | |                | |
                         '-'                '-'
                          |                  |
                          |                  |--------
                          |                 .-.      +
                          |          R4=10K | |
                          |                 | |      ADC Input (Channels 0 and 1)
                          |                 '-'
               -          |                  |       -
               -----------|                  |--------
                         ===                ===
                         GND                GND

Vin  = Analog Input (AIN)
Vout = ADC Input
Rth  = Thevenin Equiv. Resistance
Vth  = Thevenin Equiv. Voltage
RL   = Load Resistor

R1 = 30K, R2 = 10K, R3 = 30K, R4 = 10K
RL = R4 = 10K

Rth  = (R1 // R2) + R3 = 37500 Ohms
Vth  = (Vin * R2) / (R1 + R2) = Vin/4;
Vout = (Vth * RL)/ (Rth + RL) = Vth/4.75 = Vin/19
Gain = Vout/Vin = 1/19

https://www.toradex.com/products/carrier-board/ivy-carrier-board

Upstream-Status: Submitted [https://lore.kernel.org/lkml/20240924113048.125761-1-francesco@dolcini.it/]
Signed-off-by: João Paulo Gonçalves &lt;joao.goncalves@toradex.com&gt;
Signed-off-by: Francesco Dolcini &lt;francesco.dolcini@toradex.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
