Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion drivers/i2c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ zephyr_library_sources_ifdef(CONFIG_I2C_ESP32 i2c_esp32.c)
zephyr_library_sources_ifdef(CONFIG_I2C_GD32 i2c_gd32.c)
zephyr_library_sources_ifdef(CONFIG_I2C_GECKO i2c_gecko.c)
zephyr_library_sources_ifdef(CONFIG_I2C_IMX i2c_imx.c)
zephyr_library_sources_ifdef(CONFIG_I2C_INFINEON_CAT1 i2c_ifx_cat1.c)
zephyr_library_sources_ifdef(CONFIG_I2C_INFINEON_CAT1_HAL i2c_ifx_cat1.c)
zephyr_library_sources_ifdef(CONFIG_I2C_INFINEON_CAT1_PDL i2c_ifx_cat1_pdl.c)
zephyr_library_sources_ifdef(CONFIG_I2C_INFINEON_XMC4 i2c_ifx_xmc4.c)
zephyr_library_sources_ifdef(CONFIG_I2C_IPROC i2c_bcm_iproc.c)
zephyr_library_sources_ifdef(CONFIG_I2C_ITE_ENHANCE i2c_ite_enhance.c)
Expand Down
16 changes: 9 additions & 7 deletions drivers/i2c/Kconfig.ifx_cat1
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@
#
# SPDX-License-Identifier: Apache-2.0

config I2C_INFINEON_CAT1
bool "Infineon CAT1 I2C driver"
config I2C_INFINEON_CAT1_HAL
bool "Infineon CAT1 I2C HAL based driver"
default y
depends on DT_HAS_INFINEON_CAT1_I2C_ENABLED
depends on USE_INFINEON_LEGACY_HAL
select USE_INFINEON_I2C
select PINCTRL
help
This option enables the I2C driver for Infineon CAT1 family.
This option enables the HAL based I2C driver for Infineon CAT1 family.

config I2C_PDL_INFINEON_CAT1
bool "Infineon CAT1 I2C driver (PDL)"
config I2C_INFINEON_CAT1_PDL
bool "Infineon CAT1 I2C PDL based driver"
default y
depends on DT_HAS_INFINEON_CAT1_I2C_PDL_ENABLED
depends on DT_HAS_INFINEON_CAT1_I2C_ENABLED
depends on !USE_INFINEON_LEGACY_HAL
select USE_INFINEON_I2C
select PINCTRL
help
This option enables the I2C driver for the Infineon CAT1 family.
This option enables the PDL based I2C driver for the Infineon CAT1 family.

config I2C_INFINEON_CAT1_TARGET_BUF
int "I2C Target data buffer length"
Expand Down
20 changes: 11 additions & 9 deletions drivers/i2c/i2c_ifx_cat1_pdl.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* (c) 2025 Infineon Technologies AG, or an affiliate of Infineon Technologies AG.
* All rights reserved.
* Copyright (c) 2025 Infineon Technologies AG,
* or an affiliate of Infineon Technologies AG.
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -9,7 +9,9 @@
* @brief I2C driver for Infineon CAT1 MCU family.
*/

#define DT_DRV_COMPAT infineon_cat1_i2c_pdl
#define DT_DRV_COMPAT infineon_cat1_i2c

#include <infineon_kconfig.h>

#include <zephyr/drivers/i2c.h>
#include <zephyr/drivers/pinctrl.h>
Expand Down Expand Up @@ -60,7 +62,7 @@ struct ifx_cat1_i2c_data {
bool error;
uint32_t async_pending;
struct ifx_cat1_clock clock;
#if defined(COMPONENT_CAT1B) || defined(COMPONENT_CAT1C) || defined(COMPONENT_CAT1D)
#if defined(COMPONENT_CAT1B) || defined(COMPONENT_CAT1C) || defined(CONFIG_SOC_FAMILY_INFINEON_EDGE)
uint8_t clock_peri_group;
#endif
struct i2c_target_config *p_target_config;
Expand Down Expand Up @@ -230,7 +232,7 @@ void ifx_cat1_i2c_register_callback(const struct device *dev,
uint32_t _i2c_set_peri_divider(const struct device *dev, uint32_t freq, bool is_slave)
{
/* Peripheral clock values for different I2C speeds according PDL API Reference Guide */
#if defined(COMPONENT_CAT1D)
#if defined(CONFIG_SOC_FAMILY_INFINEON_EDGE)
/* Must be between 1.55 MHz and 12.8 MHz for running i2c master at 100KHz */
#define _SCB_PERI_CLOCK_SLAVE_STD 6000000
/* Must be between 7.82 MHz and 15.38 MHz for running i2c master at 400KHz */
Expand All @@ -240,7 +242,7 @@ uint32_t _i2c_set_peri_divider(const struct device *dev, uint32_t freq, bool is_
#define _SCB_PERI_CLOCK_SLAVE_STD 8000000
/* Must be between 7.82 MHz and 15.38 MHz for running i2c master at 400KHz */
#define _SCB_PERI_CLOCK_SLAVE_FST 12500000
#endif /* defined(COMPONENT_CAT1D) */
#endif /* defined(CONFIG_SOC_FAMILY_INFINEON_EDGE) */

/* Must be between 1.55 MHz and 3.2 MHz for running i2c slave at 100KHz */
#define _SCB_PERI_CLOCK_MASTER_STD 2000000
Expand All @@ -251,7 +253,7 @@ uint32_t _i2c_set_peri_divider(const struct device *dev, uint32_t freq, bool is_

/* Must be between 15.84 MHz and 89.0 MHz for running i2c master at 1MHz */
#if defined(COMPONENT_CAT1A) || defined(COMPONENT_CAT1B) || defined(COMPONENT_CAT1C) || \
defined(COMPONENT_CAT1D)
defined(CONFIG_SOC_FAMILY_INFINEON_EDGE)
#define _SCB_PERI_CLOCK_SLAVE_FSTP 50000000
#elif defined(COMPONENT_CAT2)
#define _SCB_PERI_CLOCK_SLAVE_FSTP 24000000
Expand Down Expand Up @@ -678,13 +680,13 @@ static const struct i2c_driver_api i2c_cat1_driver_api = {
.target_register = ifx_cat1_i2c_target_register,
.target_unregister = ifx_cat1_i2c_target_unregister};

#if defined(COMPONENT_CAT1B) || defined(COMPONENT_CAT1C) || defined(COMPONENT_CAT1D)
#if defined(COMPONENT_CAT1B) || defined(COMPONENT_CAT1C) || defined(CONFIG_SOC_FAMILY_INFINEON_EDGE)
#define PERI_INFO(n) .clock_peri_group = DT_PROP_BY_IDX(DT_INST_PHANDLE(n, clocks), peri_group, 1),
#else
#define PERI_INFO(n)
#endif

#if defined(COMPONENT_CAT1D)
#if defined(CONFIG_SOC_FAMILY_INFINEON_EDGE)
#define I2C_PERI_CLOCK_INIT(n) \
.clock = { \
.block = IFX_CAT1_PERIPHERAL_GROUP_ADJUST( \
Expand Down
74 changes: 0 additions & 74 deletions dts/bindings/i2c/infineon,cat1-i2c-pdl.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions soc/infineon/edge/common/pinctrl_soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include <stdint.h>
#include <zephyr/devicetree.h>
#include <infineon_kconfig.h>
#include <cy_gpio.h>

#ifdef __cplusplus
extern "C" {
Expand Down