1 // SPDX-License-Identifier: GPL-2.0+
4 * NVIDIA Corporation <www.nvidia.com>
10 #include <power/as3722.h>
11 #include <power/pmic.h>
13 #include <asm/arch/gpio.h>
14 #include <asm/arch/pinmux.h>
16 #include "pinmux-config-jetson-tk1.h"
19 * Routine: pinmux_init
20 * Description: Do individual peripheral pinmux configs
22 void pinmux_init(void)
24 pinmux_clear_tristate_input_clamping();
26 gpio_config_table(jetson_tk1_gpio_inits,
27 ARRAY_SIZE(jetson_tk1_gpio_inits));
29 pinmux_config_pingrp_table(jetson_tk1_pingrps,
30 ARRAY_SIZE(jetson_tk1_pingrps));
32 pinmux_config_drvgrp_table(jetson_tk1_drvgrps,
33 ARRAY_SIZE(jetson_tk1_drvgrps));
35 pinmux_config_mipipadctrlgrp_table(jetson_tk1_mipipadctrlgrps,
36 ARRAY_SIZE(jetson_tk1_mipipadctrlgrps));
39 #ifdef CONFIG_PCI_TEGRA
40 /* TODO: Convert to driver model */
41 static int as3722_sd_enable(struct udevice *pmic, unsigned int sd)
48 err = pmic_clrsetbits(pmic, AS3722_SD_CONTROL, 0, 1 << sd);
50 pr_err("failed to update SD control register: %d", err);
57 int tegra_pcie_board_init(void)
62 ret = uclass_get_device_by_driver(UCLASS_PMIC,
63 DM_DRIVER_GET(pmic_as3722), &dev);
65 debug("%s: Failed to find PMIC\n", __func__);
69 ret = as3722_sd_enable(dev, 4);
71 pr_err("failed to enable SD4: %d\n", ret);
75 ret = as3722_sd_set_voltage(dev, 4, 0x24);
77 pr_err("failed to set SD4 voltage: %d\n", ret);