mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 05:04:02 +02:00
pinctrl: airoha: try to find chip scu node by phandle first
The "airoha,en7581-chip-scu" is not a good compatible string in the en7523 case. Let's search chip scu regmap with "airoha,chip-scu" phangle first and fallback to SoC specific chip scu compatible string on failure. Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> Signed-off-by: Linus Walleij <linusw@kernel.org>
This commit is contained in:
parent
3b82470583
commit
18c510bafa
|
|
@ -130,6 +130,7 @@ struct airoha_pinctrl {
|
|||
};
|
||||
|
||||
struct airoha_pinctrl_match_data {
|
||||
const char *chip_scu_compatible;
|
||||
const char *pinctrl_name;
|
||||
struct module *pinctrl_owner;
|
||||
const struct pinctrl_pin_desc *pins;
|
||||
|
|
|
|||
|
|
@ -791,9 +791,12 @@ int airoha_pinctrl_probe(struct platform_device *pdev)
|
|||
if (IS_ERR(pinctrl->regmap))
|
||||
return PTR_ERR(pinctrl->regmap);
|
||||
|
||||
map = syscon_regmap_lookup_by_compatible("airoha,en7581-chip-scu");
|
||||
if (IS_ERR(map))
|
||||
return PTR_ERR(map);
|
||||
map = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "airoha,chip-scu");
|
||||
if (IS_ERR_OR_NULL(map)) {
|
||||
map = syscon_regmap_lookup_by_compatible(data->chip_scu_compatible);
|
||||
if (IS_ERR(map))
|
||||
return PTR_ERR(map);
|
||||
}
|
||||
|
||||
pinctrl->chip_scu = map;
|
||||
|
||||
|
|
|
|||
|
|
@ -1432,6 +1432,7 @@ static const struct airoha_pinctrl_conf pinctrl_pcie_rst_od_conf[] = {
|
|||
};
|
||||
|
||||
static const struct airoha_pinctrl_match_data pinctrl_match_data = {
|
||||
.chip_scu_compatible = "airoha,en7581-chip-scu",
|
||||
.pinctrl_name = KBUILD_MODNAME,
|
||||
.pinctrl_owner = THIS_MODULE,
|
||||
.pins = pinctrl_pins,
|
||||
|
|
|
|||
|
|
@ -1462,6 +1462,7 @@ static const struct airoha_pinctrl_conf pinctrl_pcie_rst_od_conf[] = {
|
|||
};
|
||||
|
||||
static const struct airoha_pinctrl_match_data pinctrl_match_data = {
|
||||
.chip_scu_compatible = "airoha,en7581-chip-scu",
|
||||
.pinctrl_name = KBUILD_MODNAME,
|
||||
.pinctrl_owner = THIS_MODULE,
|
||||
.pins = pinctrl_pins,
|
||||
|
|
|
|||
|
|
@ -1104,6 +1104,7 @@ static const struct airoha_pinctrl_conf pinctrl_drive_e4_conf[] = {
|
|||
};
|
||||
|
||||
static const struct airoha_pinctrl_match_data pinctrl_match_data = {
|
||||
.chip_scu_compatible = "airoha,en7523-chip-scu",
|
||||
.pinctrl_name = KBUILD_MODNAME,
|
||||
.pinctrl_owner = THIS_MODULE,
|
||||
.pins = pinctrl_pins,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user