1b5510d1eSBen Skeggs /*
2b5510d1eSBen Skeggs  * Copyright 2021 Red Hat Inc.
3b5510d1eSBen Skeggs  *
4b5510d1eSBen Skeggs  * Permission is hereby granted, free of charge, to any person obtaining a
5b5510d1eSBen Skeggs  * copy of this software and associated documentation files (the "Software"),
6b5510d1eSBen Skeggs  * to deal in the Software without restriction, including without limitation
7b5510d1eSBen Skeggs  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8b5510d1eSBen Skeggs  * and/or sell copies of the Software, and to permit persons to whom the
9b5510d1eSBen Skeggs  * Software is furnished to do so, subject to the following conditions:
10b5510d1eSBen Skeggs  *
11b5510d1eSBen Skeggs  * The above copyright notice and this permission notice shall be included in
12b5510d1eSBen Skeggs  * all copies or substantial portions of the Software.
13b5510d1eSBen Skeggs  *
14b5510d1eSBen Skeggs  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15b5510d1eSBen Skeggs  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16b5510d1eSBen Skeggs  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17b5510d1eSBen Skeggs  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18b5510d1eSBen Skeggs  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19b5510d1eSBen Skeggs  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20b5510d1eSBen Skeggs  * OTHER DEALINGS IN THE SOFTWARE.
21b5510d1eSBen Skeggs  */
22b5510d1eSBen Skeggs #include "priv.h"
23b5510d1eSBen Skeggs #include "pad.h"
24b5510d1eSBen Skeggs 
258ad95edcSBen Skeggs static void
gk110_aux_autodpcd(struct nvkm_i2c * i2c,int aux,bool enable)268ad95edcSBen Skeggs gk110_aux_autodpcd(struct nvkm_i2c *i2c, int aux, bool enable)
278ad95edcSBen Skeggs {
288ad95edcSBen Skeggs 	nvkm_mask(i2c->subdev.device, 0x00e4f8 + (aux * 0x50), 0x00010000, enable << 16);
298ad95edcSBen Skeggs }
308ad95edcSBen Skeggs 
31b5510d1eSBen Skeggs static const struct nvkm_i2c_func
32b5510d1eSBen Skeggs gk110_i2c = {
33b5510d1eSBen Skeggs 	.pad_x_new = gf119_i2c_pad_x_new,
34b5510d1eSBen Skeggs 	.pad_s_new = gf119_i2c_pad_s_new,
35b5510d1eSBen Skeggs 	.aux = 4,
36b5510d1eSBen Skeggs 	.aux_stat = gk104_aux_stat,
37b5510d1eSBen Skeggs 	.aux_mask = gk104_aux_mask,
388ad95edcSBen Skeggs 	.aux_autodpcd = gk110_aux_autodpcd,
39b5510d1eSBen Skeggs };
40b5510d1eSBen Skeggs 
41b5510d1eSBen Skeggs int
gk110_i2c_new(struct nvkm_device * device,enum nvkm_subdev_type type,int inst,struct nvkm_i2c ** pi2c)42*c6ce0861SBen Skeggs gk110_i2c_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
43*c6ce0861SBen Skeggs 	      struct nvkm_i2c **pi2c)
44b5510d1eSBen Skeggs {
45*c6ce0861SBen Skeggs 	return nvkm_i2c_new_(&gk110_i2c, device, type, inst, pi2c);
46b5510d1eSBen Skeggs }
47