@@ -21,6 +21,7 @@
#include <linux/pinctrl/pinctrl.h>
#include <linux/pinctrl/pinmux.h>
+#include "pinctrl-scmi.h"
#include "pinctrl-utils.h"
#include "core.h"
#include "pinconf.h"
@@ -30,18 +31,6 @@
/* Define num configs, if not large than 4 use stack, else use kcalloc() */
#define SCMI_NUM_CONFIGS 4
-struct scmi_pinctrl {
- struct device *dev;
- struct scmi_protocol_handle *ph;
- struct pinctrl_dev *pctldev;
- struct pinctrl_desc pctl_desc;
- struct pinfunction *functions;
- unsigned int nr_functions;
- struct pinctrl_pin_desc *pins;
- unsigned int nr_pins;
- const struct scmi_pinctrl_proto_ops *ops;
-};
-
static int pinctrl_scmi_get_groups_count(struct pinctrl_dev *pctldev)
{
struct scmi_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev);
@@ -468,8 +457,7 @@ static const struct pinconf_ops pinctrl_scmi_pinconf_ops = {
.pin_config_config_dbg_show = pinconf_generic_dump_config,
};
-static int pinctrl_scmi_get_pins(struct scmi_pinctrl *pmx,
- struct pinctrl_desc *desc)
+int pinctrl_scmi_get_pins(struct scmi_pinctrl *pmx, struct pinctrl_desc *desc)
{
struct pinctrl_pin_desc *pins;
unsigned int npins;
@@ -502,6 +490,7 @@ static int pinctrl_scmi_get_pins(struct scmi_pinctrl *pmx,
return 0;
}
+EXPORT_SYMBOL(pinctrl_scmi_get_pins);
static int scmi_pinctrl_probe(struct scmi_device *sdev)
{
new file mode 100644
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright 2024 NXP
+ */
+
+#ifndef __DRIVERS_PINCTRL_SCMI_H
+#define __DRIVERS_PINCTRL_SCMI_H
+
+#include <linux/device.h>
+#include <linux/pinctrl/pinctrl.h>
+#include <linux/scmi_protocol.h>
+
+#include "core.h"
+
+struct scmi_pinctrl {
+ struct device *dev;
+ struct scmi_protocol_handle *ph;
+ struct pinctrl_dev *pctldev;
+ struct pinctrl_desc pctl_desc;
+ struct pinfunction *functions;
+ unsigned int nr_functions;
+ struct pinctrl_pin_desc *pins;
+ unsigned int nr_pins;
+ const struct scmi_pinctrl_proto_ops *ops;
+};
+
+int pinctrl_scmi_get_pins(struct scmi_pinctrl *pmx, struct pinctrl_desc *desc);
+
+#endif /* __DRIVERS_PINCTRL_SCMI_H */