-
Notifications
You must be signed in to change notification settings - Fork 19
/
sc0710-cards.c
100 lines (93 loc) · 3.18 KB
/
sc0710-cards.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
* Driver for the Elgato 4k60 Pro mk.2 HDMI capture card.
*
* Copyright (c) 2021-2022 Steven Toth <stoth@kernellabs.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "sc0710.h"
struct sc0710_board sc0710_boards[] = {
[SC0710_BOARD_UNKNOWN] = {
.name = "UNKNOWN/GENERIC",
/* Ensure safe default for unknown boards */
},
[SC0710_BOARD_ELGATEO_4KP60_MK2] = {
.name = "Elgato 4k60 Pro mk.2",
},
};
const unsigned int sc0710_bcount = ARRAY_SIZE(sc0710_boards);
struct sc0710_subid sc0710_subids[] = {
{
.subvendor = 0x1cfa,
.subdevice = 0x000e,
.card = SC0710_BOARD_ELGATEO_4KP60_MK2,
}
};
const unsigned int sc0710_idcount = ARRAY_SIZE(sc0710_subids);
void sc0710_card_list(struct sc0710_dev *dev)
{
int i;
if (0 == dev->pci->subsystem_vendor &&
0 == dev->pci->subsystem_device) {
printk(KERN_INFO
"%s: Board has no valid PCIe Subsystem ID and can't\n"
"%s: be autodetected. Pass card=<n> insmod option\n"
"%s: to workaround that. Redirect complaints to the\n"
"%s: vendor of the TV card. Best regards,\n"
"%s: -- tux\n",
dev->name, dev->name, dev->name, dev->name, dev->name);
} else {
printk(KERN_INFO
"%s: Your board isn't known (yet) to the driver.\n"
"%s: Try to pick one of the existing card configs via\n"
"%s: card=<n> insmod option. Updating to the latest\n"
"%s: version might help as well.\n",
dev->name, dev->name, dev->name, dev->name);
}
printk(KERN_INFO "%s: Here is a list of valid choices for the card=<n> insmod option:\n",
dev->name);
for (i = 0; i < sc0710_bcount; i++)
printk(KERN_INFO "%s: card=%d -> %s\n",
dev->name, i, sc0710_boards[i].name);
}
void sc0710_gpio_setup(struct sc0710_dev *dev)
{
switch (dev->board) {
case SC0710_BOARD_ELGATEO_4KP60_MK2:
break;
}
}
void sc0710_card_setup(struct sc0710_dev *dev)
{
switch (dev->board) {
case SC0710_BOARD_ELGATEO_4KP60_MK2:
sc_write(dev, 0, BAR0_00C4, 0x000f0000);
sc_write(dev, 1, BAR1_0094, 0x00fffe3e);
sc_write(dev, 1, BAR1_0008, 0x00fffe3e);
sc_write(dev, 1, BAR1_0194, 0x00fffe3e);
sc_write(dev, 1, BAR1_0108, 0x00fffe3e);
sc_write(dev, 1, BAR1_1094, 0x00fffe7e);
sc_write(dev, 1, BAR1_1008, 0x00fffe7e);
sc_write(dev, 1, BAR1_1194, 0x00fffe7e);
sc_write(dev, 1, BAR1_1108, 0x00fffe7e);
sc_write(dev, 1, BAR1_2080, 0);
sc_write(dev, 1, BAR1_2084, 0);
sc_write(dev, 1, BAR1_2088, 0);
sc_write(dev, 1, BAR1_208C, 0);
sc_write(dev, 1, BAR1_20A0, 0);
sc_write(dev, 1, BAR1_20A4, 0);
break;
}
}