Skip to content

driver: pinctrl: npcx: get build error when apply pinctrl mechanism to a DT node without reg prop. #45795

@MulinChao

Description

@MulinChao

Describe the bug
When users enable pinctrl functionality for a npcx DT node in npcx7m6fb_evb or npcx9m6f_evb boards, we might encounter a build error since not all npcx peripheral DT nodes have reg property.

For example, i2c6_0 & i2c6_1 peripheral DT nodes have no reg property. If the users set the status of these DT nodes to "okay" as below:

&i2c6_0 {
	status = "okay";
	pinctrl-0 = <&i2c6_0_sda_scl_gpc1_c2>;
	pinctrl-names = "default";
	clock-frequency = <I2C_BITRATE_FAST>;
};

Then, they will get a build error that indicates there is no such definition for the address of reg property.

error: 'DT_N_S_soc_if_S_io_i2c_ctrl0_port0_REG_IDX_0_VAL_ADDRESS' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_i2c_40018000_REG_IDX_0_VAL_ADDRESS'?
33011 | #define DT_N_INST_0_nuvoton_npcx_i2c_port DT_N_S_soc_if_S_io_i2c_ctrl0_port0

To Reproduce
Steps to reproduce the behavior:

  1. cd tests/drivers/i2c/i2c_api
  2. export BOARD=npcx9m6f_evb
  3. west build -p always
  4. See build error

Expected behavior
Shouldn't see any build error.

Impact
Encounter build error.

Additional context
Please refer PR45712. It resolves this issue without enabling STORE_REG if we need to configure pwm drive-mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThe issue is a bug, or the PR is fixing a bug

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions