// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * (C) Copyright 2025 - Analog Devices, Inc.
 */

/dts-v1/;

#include "sc598-som.dtsi"

&i2c2 {
	status = "okay";

	som_gpio_expander: mcp23018@20 {
		compatible = "microchip,mcp23018";
		reg = <0x20>;
		gpio-controller;
		#gpio-cells = <2>;
		bootph-pre-ram;
		drive-pullups;

		led1 {
			gpio-hog;
			gpios = <0 GPIO_ACTIVE_HIGH>;
			output-low;
			line-name = "led1-en";
			bootph-pre-ram;
		};

		led2 {
			gpio-hog;
			gpios = <1 GPIO_ACTIVE_HIGH>;
			output-low;
			line-name = "led2-en";
			bootph-pre-ram;
		};

		led3 {
			gpio-hog;
			gpios = <2 GPIO_ACTIVE_HIGH>;
			output-low;
			line-name = "led3-en";
			bootph-pre-ram;
		};

		spi2d2-d3 {
			gpio-hog;
			gpios = <3 GPIO_ACTIVE_LOW>;
			output-high;
			line-name = "spi2d2-d3-en";
			bootph-pre-ram;
		};

		spi2flash-cs {
			gpio-hog;
			gpios = <4 GPIO_ACTIVE_LOW>;
			output-high;
			line-name = "spi2flash-cs";
			bootph-pre-ram;
		};

		uart0 {
			gpio-hog;
			gpios = <5 GPIO_ACTIVE_LOW>;
			output-high;
			line-name = "uart0-en";
			bootph-pre-ram;
		};

		uart0-flow-en {
			gpio-hog;
			gpios = <6 GPIO_ACTIVE_LOW>;
			output-low;
			line-name = "uart0-flow-en";
			bootph-pre-ram;
		};
	};
};

&spi2 {
	flash1: is25lp512@1 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "jedec,spi-nor", "is25lp512";
		reg = <1>;
		spi-tx-bus-width = <4>;
		spi-rx-bus-width = <4>;
		spi-max-frequency = <10000000>;
		bootph-pre-ram;
	};
};
