Commit 222f42f2 authored by HaiLong Yang's avatar HaiLong Yang Committed by Carles Cufi
Browse files

dts: arm: gigadevice: introduce dac for gd32 series soc



Add DAC for gd32f4xx and gd32f350xx.

Signed-off-by: default avatarHaiLong Yang <cameledyang@pm.me>
parent de53e7f9
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2021 BrainCo Inc.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <mem.h>
#include <gigadevice/gd32f3x0/gd32f3x0.dtsi>

/ {
	soc {
		dac: dac@40007400 {
			compatible = "gd,gd32-dac";
			reg = <0x40007400 0x400>;
			rcu-periph-clock = <0x71d>;
			num-channels = <1>;
			label = "DAC";
			status = "disabled";
			#io-channel-cells = <1>;
		};
	};
};
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
 */

#include <mem.h>
#include <gigadevice/gd32f3x0/gd32f3x0.dtsi>
#include <gigadevice/gd32f3x0/gd32f350.dtsi>

/ {
	soc {
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
 */

#include <mem.h>
#include <gigadevice/gd32f3x0/gd32f3x0.dtsi>
#include <gigadevice/gd32f3x0/gd32f350.dtsi>

/ {
	soc {
+10 −0
Original line number Diff line number Diff line
@@ -118,6 +118,16 @@
			label = "USART_7";
		};

		dac: dac@40007400 {
			compatible = "gd,gd32-dac";
			reg = <0x40007400 0x400>;
			rcu-periph-clock = <0x101d>;
			num-channels = <2>;
			label = "DAC";
			status = "disabled";
			#io-channel-cells = <1>;
		};

		pinctrl: pin-controller@40020000 {
			compatible = "gd,gd32-pinctrl-af";
			reg = <0x40020000 0x2400>;
+34 −0
Original line number Diff line number Diff line
# Copyright (c) 2021 BrainCo Inc.
# SPDX-License-Identifier: Apache-2.0

description: GigaDevice GD32 series DAC module

compatible: "gd,gd32-dac"

include: [dac-controller.yaml, pinctrl-device.yaml]

properties:
    reg:
      required: true

    rcu-periph-clock:
      type: int
      description: Reset Control Unit Peripheral Clock ID
      required: true

    num-channels:
      type: int
      description: Number of DAC output channels
      required: true

    reset-val:
      type: int
      default: 0
      description: Reset value of DAC output. Defaults to 0, the SoC default.
      required: false

    "#io-channel-cells":
      const: 1

io-channel-cells:
    - output