Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: i2c: Introduce I2C timeout and bus recovery for SAM0 #79311

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kowalewskijan
Copy link
Contributor

Adds configurable timeout for I2C transactions and provides bus recovery functionality.

Tested on SAME53J20A

Adds configurable timeout for I2C transactions and provides
bus recovery functionality.

Signed-off-by: Jan Kowalewski <jkowalewski@cthings.co>
Copy link
Member

@nandojve nandojve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kowalewskijan ,

Interesting, a few points:

1- Could you explain on the commit messages what you are solving and why? It will be nice that you add information about a few use cases too. In this case, are you trying to solve some of the problems related on 36.6.2.4.2 Transmitting Address Packets?

2- I can imagine that it is not possible to have a HW test to avoid regressions for this, right?

3- Zephyr is moving to have all dependencies defined by each driver. This means that you need to add GPIO and PINCTRL dependencies at Kconfig.

Comment on lines +126 to +128
pinctrl_configure_pins(&soc_pin_sda, 1, PINCTRL_REG_NONE);
pinctrl_configure_pins(&soc_pin_scl, 1, PINCTRL_REG_NONE);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this? Why not use below?

	retval = pinctrl_apply_state(cfg->pcfg, PINCTRL_STATE_DEFAULT);
	if (retval < 0) {
		return retval;
	}

Comment on lines +101 to +102
const struct device *sda_dev = sam_port_devs[sda_port_idx];
const struct device *scl_dev = sam_port_devs[scl_port_idx];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you pointing out an example where you found different ports for I2C pins at same?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: I2C platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants