1 /* $NetBSD: amdgpu_hw_factory_diag.c,v 1.2 2021/12/18 23:45:05 riastradh Exp $ */
2
3 /*
4 * Copyright 2013-16 Advanced Micro Devices, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 *
24 * Authors: AMD
25 *
26 */
27
28 /*
29 * Pre-requisites: headers required by header of this unit
30 */
31
32 #include <sys/cdefs.h>
33 __KERNEL_RCSID(0, "$NetBSD: amdgpu_hw_factory_diag.c,v 1.2 2021/12/18 23:45:05 riastradh Exp $");
34
35 #include "dm_services.h"
36 #include "include/gpio_types.h"
37 #include "../hw_factory.h"
38
39 /*
40 * Header of this unit
41 */
42
43 #include "../hw_gpio.h"
44 #include "../hw_ddc.h"
45 #include "../hw_hpd.h"
46 #include "../hw_generic.h"
47
48 /* function table */
49 static const struct hw_factory_funcs funcs = {
50 .init_ddc_data = NULL,
51 .init_generic = NULL,
52 .init_hpd = NULL,
53 };
54
dal_hw_factory_diag_fpga_init(struct hw_factory * factory)55 void dal_hw_factory_diag_fpga_init(struct hw_factory *factory)
56 {
57 factory->number_of_pins[GPIO_ID_DDC_DATA] = 8;
58 factory->number_of_pins[GPIO_ID_DDC_CLOCK] = 8;
59 factory->number_of_pins[GPIO_ID_GENERIC] = 7;
60 factory->number_of_pins[GPIO_ID_HPD] = 6;
61 factory->number_of_pins[GPIO_ID_GPIO_PAD] = 31;
62 factory->number_of_pins[GPIO_ID_VIP_PAD] = 0;
63 factory->number_of_pins[GPIO_ID_SYNC] = 2;
64 factory->number_of_pins[GPIO_ID_GSL] = 4;
65 factory->funcs = &funcs;
66 }
67