drivers: clock_control: rpi_pico: Configure GPOUT/GPIN pins

Configure GPOUT/GPIN pin for external clock in/out via GPIO.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
This commit is contained in:
TOKITA Hiroshi 2023-09-09 09:06:30 +09:00 committed by Carles Cufí
parent ea1cafbee7
commit 99a9b995d3
8 changed files with 33 additions and 1 deletions

View file

@ -47,4 +47,7 @@
input-enable;
};
};
clocks_default: clocks_default {
};
};

View file

@ -54,6 +54,11 @@
};
};
&clocks {
pinctrl-0 = <&clocks_default>;
pinctrl-names = "default";
};
&uart0 {
current-speed = <115200>;
status = "okay";

View file

@ -88,6 +88,11 @@
};
};
&clocks {
pinctrl-0 = <&clocks_default>;
pinctrl-names = "default";
};
&uart0 {
current-speed = <115200>;
status = "okay";

View file

@ -54,4 +54,7 @@
input-enable;
};
};
clocks_default: clocks_default {
};
};

View file

@ -46,4 +46,7 @@
input-enable;
};
};
clocks_default: clocks_default {
};
};

View file

@ -56,6 +56,10 @@
};
};
&clocks {
pinctrl-0 = <&clocks_default>;
pinctrl-names = "default";
};
&uart0 {
current-speed = <115200>;

View file

@ -8,6 +8,7 @@
#define DT_DRV_COMPAT raspberrypi_pico_clock_controller
#include <zephyr/drivers/clock_control.h>
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/drivers/reset.h>
#include <zephyr/dt-bindings/clock/rpi_pico_clock.h>
@ -696,6 +697,11 @@ static int clock_control_rpi_pico_init(const struct device *dev)
dev, (clock_control_subsys_t)rpi_pico_clkid_rosc_ph);
}
ret = pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT);
if (ret < 0) {
return ret;
}
return 0;
}
@ -741,12 +747,15 @@ BUILD_ASSERT(SRC_CLOCK_FREQ(clk_peri) >= CLOCK_FREQ_clk_peri,
BUILD_ASSERT(CLOCK_FREQ(rosc_ph) == CLOCK_FREQ(rosc), "rosc_ph: frequency must be equal to rosc");
PINCTRL_DT_INST_DEFINE(0);
static const struct clock_control_rpi_pico_config clock_control_rpi_pico_config = {
.clocks_regs = (clocks_hw_t *)DT_INST_REG_ADDR_BY_NAME(0, clocks),
.xosc_regs = (xosc_hw_t *)DT_INST_REG_ADDR_BY_NAME(0, xosc),
.pll_sys_regs = (pll_hw_t *)DT_INST_REG_ADDR_BY_NAME(0, pll_sys),
.pll_usb_regs = (pll_hw_t *)DT_INST_REG_ADDR_BY_NAME(0, pll_usb),
.rosc_regs = (rosc_hw_t *)DT_INST_REG_ADDR_BY_NAME(0, rosc),
.pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(0),
.clocks_data = {
[RPI_PICO_CLKID_CLK_GPOUT0] = {
.source = 0,

View file

@ -5,7 +5,7 @@ description: Raspberry Pi Pico clock controller node
compatible: "raspberrypi,pico-clock-controller"
include: [base.yaml, clock-controller.yaml]
include: [base.yaml, clock-controller.yaml, pinctrl-device.yaml]
properties:
reg: