Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Peter Chubb | 441f238 | 2016-08-30 22:54:46 +0000 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2014 |
| 4 | * NVIDIA Corporation <www.nvidia.com> |
Peter Chubb | 441f238 | 2016-08-30 22:54:46 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
Tom Rini | 4afe487 | 2024-04-30 20:41:23 -0600 | [diff] [blame] | 7 | #include <linux/kernel.h> |
Peter Chubb | 441f238 | 2016-08-30 22:54:46 +0000 | [diff] [blame] | 8 | #include <power/as3722.h> |
| 9 | |
| 10 | #include <asm/arch/gpio.h> |
| 11 | #include <asm/arch/pinmux.h> |
| 12 | |
| 13 | #include "pinmux-config-cei-tk1-som.h" |
| 14 | |
Peter Chubb | 441f238 | 2016-08-30 22:54:46 +0000 | [diff] [blame] | 15 | /* |
| 16 | * Routine: pinmux_init |
| 17 | * Description: Do individual peripheral pinmux configs |
| 18 | */ |
| 19 | void pinmux_init(void) |
| 20 | { |
| 21 | pinmux_clear_tristate_input_clamping(); |
| 22 | |
| 23 | gpio_config_table(cei_tk1_som_gpio_inits, |
| 24 | ARRAY_SIZE(cei_tk1_som_gpio_inits)); |
| 25 | |
| 26 | pinmux_config_pingrp_table(cei_tk1_som_pingrps, |
| 27 | ARRAY_SIZE(cei_tk1_som_pingrps)); |
| 28 | |
| 29 | pinmux_config_drvgrp_table(cei_tk1_som_drvgrps, |
| 30 | ARRAY_SIZE(cei_tk1_som_drvgrps)); |
| 31 | |
| 32 | pinmux_config_mipipadctrlgrp_table(cei_tk1_som_mipipadctrlgrps, |
| 33 | ARRAY_SIZE(cei_tk1_som_mipipadctrlgrps)); |
| 34 | } |
| 35 | |
| 36 | #ifdef CONFIG_PCI_TEGRA |
| 37 | int tegra_pcie_board_init(void) |
| 38 | { |
Simon Glass | b3d2ed3 | 2017-07-25 08:30:12 -0600 | [diff] [blame] | 39 | /* TODO: Convert to driver model |
Peter Chubb | 441f238 | 2016-08-30 22:54:46 +0000 | [diff] [blame] | 40 | struct udevice *pmic; |
| 41 | int err; |
| 42 | |
| 43 | err = as3722_init(&pmic); |
| 44 | if (err) { |
| 45 | error("failed to initialize AS3722 PMIC: %d\n", err); |
| 46 | return err; |
| 47 | } |
| 48 | |
| 49 | err = as3722_sd_enable(pmic, 4); |
| 50 | if (err < 0) { |
| 51 | error("failed to enable SD4: %d\n", err); |
| 52 | return err; |
| 53 | } |
| 54 | |
| 55 | err = as3722_sd_set_voltage(pmic, 4, 0x24); |
| 56 | if (err < 0) { |
| 57 | error("failed to set SD4 voltage: %d\n", err); |
| 58 | return err; |
| 59 | } |
Simon Glass | b3d2ed3 | 2017-07-25 08:30:12 -0600 | [diff] [blame] | 60 | */ |
Peter Chubb | 441f238 | 2016-08-30 22:54:46 +0000 | [diff] [blame] | 61 | |
| 62 | return 0; |
| 63 | } |
| 64 | #endif /* PCI */ |