// SPDX-License-Identifier: GPL-2.0+
/*
 * Qualcomm sm8550 pinctrl
 *
 * (C) Copyright 2024 Linaro Ltd.
 *
 */

#include <common.h>
#include <dm.h>

#include "pinctrl-qcom.h"

#define MAX_PIN_NAME_LEN 32
static char pin_name[MAX_PIN_NAME_LEN] __section(".data");

static const struct pinctrl_function msm_pinctrl_functions[] = {
	{"qup1_se7", 1},
	{"gpio", 0},
};

static const char *sm8550_get_function_name(struct udevice *dev,
						 unsigned int selector)
{
	return msm_pinctrl_functions[selector].name;
}

static const char *sm8550_get_pin_name(struct udevice *dev,
					unsigned int selector)
{
	static const char *special_pins_names[] = {
		"ufs_reset",
		"sdc2_clk",
		"sdc2_cmd",
		"sdc2_data",
	};

	if (selector >= 210 && selector <= 213)
		snprintf(pin_name, MAX_PIN_NAME_LEN, special_pins_names[selector - 210]);
	else
		snprintf(pin_name, MAX_PIN_NAME_LEN, "gpio%u", selector);

	return pin_name;
}

static unsigned int sm8550_get_function_mux(__maybe_unused unsigned int pin,
					    unsigned int selector)
{
	return msm_pinctrl_functions[selector].val;
}

static struct msm_pinctrl_data sm8550_data = {
	.pin_data = {
		.pin_count = 214,
		.special_pins_start = 210,
	},
	.functions_count = ARRAY_SIZE(msm_pinctrl_functions),
	.get_function_name = sm8550_get_function_name,
	.get_function_mux = sm8550_get_function_mux,
	.get_pin_name = sm8550_get_pin_name,
};

static const struct udevice_id msm_pinctrl_ids[] = {
	{ .compatible = "qcom,sm8550-tlmm", .data = (ulong)&sm8550_data },
	{ /* Sentinel */ }
};

U_BOOT_DRIVER(pinctrl_sm8550) = {
	.name		= "pinctrl_sm8550",
	.id		= UCLASS_NOP,
	.of_match	= msm_pinctrl_ids,
	.ops		= &msm_pinctrl_ops,
	.bind		= msm_pinctrl_bind,
};

