History log of /src/sys/compat/linuxkpi/common/include/linux/i2c.h (Results 1 – 12 of 12)
Revision Date Author Comments
# b5f7a0b0 17-Aug-2025 Jean-Sébastien Pédron <dumbbell@FreeBSD.org>

linuxkpi: Replicate Linux #includes between headers

The DRM drivers (and probably other parts of the Linux kernel) had a
significant cleanup w.r.t. which source file includes what in Linux
6.10. Non

linuxkpi: Replicate Linux #includes between headers

The DRM drivers (and probably other parts of the Linux kernel) had a
significant cleanup w.r.t. which source file includes what in Linux
6.10. Nonetheless, the DRM drivers still depend on implicit namespace
pollution because some source files do not include all the headers they
should.

This cleanup broke the build with FreeBSD because we do not replicate
the same `#include` directives everywhere.

This commit adds the same `#include` directives in several headers in
order to get the same namespace pollution.

This fixes the build of the DRM drivers from Linux 6.10. An example is
`drm_dp_tunnel.c` which needed `str_yes_no()` defined by
<linux/string_helpers.h> (technically <linux/string_choices.h> in
Linux). It gets it through:

<linux/i2c.h> -> <linux/regulator/consumer.h> -> <linux/suspend.h> ->
<linux/swap.h> -> <linux/memcontrol.h> -> <linux/cgroup.h> ->
<linux/seq_file.h> -> <linux/string_helpers.h>

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54496

show more ...


# 83276e1f 08-Feb-2023 Jean-Sébastien Pédron <dumbbell@FreeBSD.org>

linuxkpi: Add `i2c_adapter_quirks` support

While here, also declare `I2C_CLASS_HWMON`.

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38535


# 63641805 18-Aug-2022 Emmanuel Vadot <manu@FreeBSD.org>

linuxkpi: unbreak linux_i2cbb

This is a joint work with manu.

- fixed conditions in do_i2c_transfer and i2c_transfer as linux_i2cbb
does not set adapter->algo->master_xfer but does set
adapter-

linuxkpi: unbreak linux_i2cbb

This is a joint work with manu.

- fixed conditions in do_i2c_transfer and i2c_transfer as linux_i2cbb
does not set adapter->algo->master_xfer but does set
adapter->algo_data;
- fixed parent bus specification for linux_i2cbb driver module;
- actually implemented iicbb_transfer method;
- added iicbb_pre_xfer and iicbb_post_xfer methods;
- removed unnecessary and harmful delays (and other extra logic) from
iicbb methods as iicbb driver already has them;
- added setting of iicbb speed based on algo_data->udelay, so that iicbb
uses correct delays;

PR: 265920
Fixes: 1961a14a4743 linuxkpi: Add i2c support
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG (manu's work)

show more ...


# 1961a14a 04-Nov-2021 Emmanuel Vadot <manu@FreeBSD.org>

linuxkpi: Add i2c support

Add i2c support to linuxkpi. This is needed by drm-kmod.
For every i2c_adapter added by i2c_add_adapter we add a child to the
device named "lkpi_iic". This child handle the

linuxkpi: Add i2c support

Add i2c support to linuxkpi. This is needed by drm-kmod.
For every i2c_adapter added by i2c_add_adapter we add a child to the
device named "lkpi_iic". This child handle the conversion between
Linux i2c_msgs to FreeBSD iic_msgs.
For every i2c_adapter added by i2c_bit_add_bus we add a child to the
device named "lkpi_iicbb". This child handle the conversion between
Linux i2c_msgs to FreeBSD iic_msgs.
With the help of iic(4), this expose the i2c controller to userspace
allowing a user to query DDC information from a monitor.
e.g.: i2c -f /dev/iic0 -a 0x28 -c 128 -d r
will query the standard EDID from the monitor if plugged.

The bitbang part (lkpi_iicbb) isn't tested at all for now as I don't have
compatible hardware (all my hardware have native i2c controller).

Tested on: Intel (SandyBridge, Skylake, ApolloLake)
Tested on: AMD (Picasso, Polaris (amd64 and arm64))

MFC after: 1 month
Reviewed by: hselasky
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33053

show more ...


# b5f7a0b0 17-Aug-2025 Jean-Sébastien Pédron <dumbbell@FreeBSD.org>

linuxkpi: Replicate Linux #includes between headers

The DRM drivers (and probably other parts of the Linux kernel) had a
significant cleanup w.r.t. which source file includes what in Linux
6.10. Non

linuxkpi: Replicate Linux #includes between headers

The DRM drivers (and probably other parts of the Linux kernel) had a
significant cleanup w.r.t. which source file includes what in Linux
6.10. Nonetheless, the DRM drivers still depend on implicit namespace
pollution because some source files do not include all the headers they
should.

This cleanup broke the build with FreeBSD because we do not replicate
the same `#include` directives everywhere.

This commit adds the same `#include` directives in several headers in
order to get the same namespace pollution.

This fixes the build of the DRM drivers from Linux 6.10. An example is
`drm_dp_tunnel.c` which needed `str_yes_no()` defined by
<linux/string_helpers.h> (technically <linux/string_choices.h> in
Linux). It gets it through:

<linux/i2c.h> -> <linux/regulator/consumer.h> -> <linux/suspend.h> ->
<linux/swap.h> -> <linux/memcontrol.h> -> <linux/cgroup.h> ->
<linux/seq_file.h> -> <linux/string_helpers.h>

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54496

show more ...


# 83276e1f 08-Feb-2023 Jean-Sébastien Pédron <dumbbell@FreeBSD.org>

linuxkpi: Add `i2c_adapter_quirks` support

While here, also declare `I2C_CLASS_HWMON`.

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38535


# 63641805 18-Aug-2022 Emmanuel Vadot <manu@FreeBSD.org>

linuxkpi: unbreak linux_i2cbb

This is a joint work with manu.

- fixed conditions in do_i2c_transfer and i2c_transfer as linux_i2cbb
does not set adapter->algo->master_xfer but does set
adapter-

linuxkpi: unbreak linux_i2cbb

This is a joint work with manu.

- fixed conditions in do_i2c_transfer and i2c_transfer as linux_i2cbb
does not set adapter->algo->master_xfer but does set
adapter->algo_data;
- fixed parent bus specification for linux_i2cbb driver module;
- actually implemented iicbb_transfer method;
- added iicbb_pre_xfer and iicbb_post_xfer methods;
- removed unnecessary and harmful delays (and other extra logic) from
iicbb methods as iicbb driver already has them;
- added setting of iicbb speed based on algo_data->udelay, so that iicbb
uses correct delays;

PR: 265920
Fixes: 1961a14a4743 linuxkpi: Add i2c support
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG (manu's work)

show more ...


# 1961a14a 04-Nov-2021 Emmanuel Vadot <manu@FreeBSD.org>

linuxkpi: Add i2c support

Add i2c support to linuxkpi. This is needed by drm-kmod.
For every i2c_adapter added by i2c_add_adapter we add a child to the
device named "lkpi_iic". This child handle the

linuxkpi: Add i2c support

Add i2c support to linuxkpi. This is needed by drm-kmod.
For every i2c_adapter added by i2c_add_adapter we add a child to the
device named "lkpi_iic". This child handle the conversion between
Linux i2c_msgs to FreeBSD iic_msgs.
For every i2c_adapter added by i2c_bit_add_bus we add a child to the
device named "lkpi_iicbb". This child handle the conversion between
Linux i2c_msgs to FreeBSD iic_msgs.
With the help of iic(4), this expose the i2c controller to userspace
allowing a user to query DDC information from a monitor.
e.g.: i2c -f /dev/iic0 -a 0x28 -c 128 -d r
will query the standard EDID from the monitor if plugged.

The bitbang part (lkpi_iicbb) isn't tested at all for now as I don't have
compatible hardware (all my hardware have native i2c controller).

Tested on: Intel (SandyBridge, Skylake, ApolloLake)
Tested on: AMD (Picasso, Polaris (amd64 and arm64))

MFC after: 1 month
Reviewed by: hselasky
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33053

show more ...


# b5f7a0b0 17-Aug-2025 Jean-Sébastien Pédron <dumbbell@FreeBSD.org>

linuxkpi: Replicate Linux #includes between headers

The DRM drivers (and probably other parts of the Linux kernel) had a
significant cleanup w.r.t. which source file includes what in Linux
6.10. Non

linuxkpi: Replicate Linux #includes between headers

The DRM drivers (and probably other parts of the Linux kernel) had a
significant cleanup w.r.t. which source file includes what in Linux
6.10. Nonetheless, the DRM drivers still depend on implicit namespace
pollution because some source files do not include all the headers they
should.

This cleanup broke the build with FreeBSD because we do not replicate
the same `#include` directives everywhere.

This commit adds the same `#include` directives in several headers in
order to get the same namespace pollution.

This fixes the build of the DRM drivers from Linux 6.10. An example is
`drm_dp_tunnel.c` which needed `str_yes_no()` defined by
<linux/string_helpers.h> (technically <linux/string_choices.h> in
Linux). It gets it through:

<linux/i2c.h> -> <linux/regulator/consumer.h> -> <linux/suspend.h> ->
<linux/swap.h> -> <linux/memcontrol.h> -> <linux/cgroup.h> ->
<linux/seq_file.h> -> <linux/string_helpers.h>

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54496

show more ...


# 83276e1f 08-Feb-2023 Jean-Sébastien Pédron <dumbbell@FreeBSD.org>

linuxkpi: Add `i2c_adapter_quirks` support

While here, also declare `I2C_CLASS_HWMON`.

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38535


# 63641805 18-Aug-2022 Emmanuel Vadot <manu@FreeBSD.org>

linuxkpi: unbreak linux_i2cbb

This is a joint work with manu.

- fixed conditions in do_i2c_transfer and i2c_transfer as linux_i2cbb
does not set adapter->algo->master_xfer but does set
adapter-

linuxkpi: unbreak linux_i2cbb

This is a joint work with manu.

- fixed conditions in do_i2c_transfer and i2c_transfer as linux_i2cbb
does not set adapter->algo->master_xfer but does set
adapter->algo_data;
- fixed parent bus specification for linux_i2cbb driver module;
- actually implemented iicbb_transfer method;
- added iicbb_pre_xfer and iicbb_post_xfer methods;
- removed unnecessary and harmful delays (and other extra logic) from
iicbb methods as iicbb driver already has them;
- added setting of iicbb speed based on algo_data->udelay, so that iicbb
uses correct delays;

PR: 265920
Fixes: 1961a14a4743 linuxkpi: Add i2c support
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG (manu's work)

show more ...


# 1961a14a 04-Nov-2021 Emmanuel Vadot <manu@FreeBSD.org>

linuxkpi: Add i2c support

Add i2c support to linuxkpi. This is needed by drm-kmod.
For every i2c_adapter added by i2c_add_adapter we add a child to the
device named "lkpi_iic". This child handle the

linuxkpi: Add i2c support

Add i2c support to linuxkpi. This is needed by drm-kmod.
For every i2c_adapter added by i2c_add_adapter we add a child to the
device named "lkpi_iic". This child handle the conversion between
Linux i2c_msgs to FreeBSD iic_msgs.
For every i2c_adapter added by i2c_bit_add_bus we add a child to the
device named "lkpi_iicbb". This child handle the conversion between
Linux i2c_msgs to FreeBSD iic_msgs.
With the help of iic(4), this expose the i2c controller to userspace
allowing a user to query DDC information from a monitor.
e.g.: i2c -f /dev/iic0 -a 0x28 -c 128 -d r
will query the standard EDID from the monitor if plugged.

The bitbang part (lkpi_iicbb) isn't tested at all for now as I don't have
compatible hardware (all my hardware have native i2c controller).

Tested on: Intel (SandyBridge, Skylake, ApolloLake)
Tested on: AMD (Picasso, Polaris (amd64 and arm64))

MFC after: 1 month
Reviewed by: hselasky
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33053

show more ...