1 // SPDX-License-Identifier: GPL-2.0+
4 * NVIDIA Corporation <www.nvidia.com>
10 #include <linux/printk.h>
11 #include <power/as3722.h>
12 #include <power/pmic.h>
14 #include <asm/arch/gpio.h>
15 #include <asm/arch/pinmux.h>
17 #include "pinmux-config-jetson-tk1.h"
20 * Routine: pinmux_init
21 * Description: Do individual peripheral pinmux configs
23 void pinmux_init(void)
25 pinmux_clear_tristate_input_clamping();
27 gpio_config_table(jetson_tk1_gpio_inits,
28 ARRAY_SIZE(jetson_tk1_gpio_inits));
30 pinmux_config_pingrp_table(jetson_tk1_pingrps,
31 ARRAY_SIZE(jetson_tk1_pingrps));
33 pinmux_config_drvgrp_table(jetson_tk1_drvgrps,
34 ARRAY_SIZE(jetson_tk1_drvgrps));
36 pinmux_config_mipipadctrlgrp_table(jetson_tk1_mipipadctrlgrps,
37 ARRAY_SIZE(jetson_tk1_mipipadctrlgrps));
40 #ifdef CONFIG_PCI_TEGRA
41 /* TODO: Convert to driver model */
42 static int as3722_sd_enable(struct udevice *pmic, unsigned int sd)
49 err = pmic_clrsetbits(pmic, AS3722_SD_CONTROL, 0, 1 << sd);
51 pr_err("failed to update SD control register: %d", err);
58 int tegra_pcie_board_init(void)
63 ret = uclass_get_device_by_driver(UCLASS_PMIC,
64 DM_DRIVER_GET(pmic_as3722), &dev);
66 debug("%s: Failed to find PMIC\n", __func__);
70 ret = as3722_sd_enable(dev, 4);
72 pr_err("failed to enable SD4: %d\n", ret);
76 ret = as3722_sd_set_voltage(dev, 4, 0x24);
78 pr_err("failed to set SD4 voltage: %d\n", ret);