Lines Matching refs:pad
27 nvkm_i2c_pad_mode_locked(struct nvkm_i2c_pad *pad, enum nvkm_i2c_pad_mode mode) in nvkm_i2c_pad_mode_locked() argument
29 PAD_TRACE(pad, "-> %s", (mode == NVKM_I2C_PAD_AUX) ? "aux" : in nvkm_i2c_pad_mode_locked()
31 if (pad->func->mode) in nvkm_i2c_pad_mode_locked()
32 pad->func->mode(pad, mode); in nvkm_i2c_pad_mode_locked()
36 nvkm_i2c_pad_mode(struct nvkm_i2c_pad *pad, enum nvkm_i2c_pad_mode mode) in nvkm_i2c_pad_mode() argument
38 PAD_TRACE(pad, "mode %d", mode); in nvkm_i2c_pad_mode()
39 mutex_lock(&pad->mutex); in nvkm_i2c_pad_mode()
40 nvkm_i2c_pad_mode_locked(pad, mode); in nvkm_i2c_pad_mode()
41 pad->mode = mode; in nvkm_i2c_pad_mode()
42 mutex_unlock(&pad->mutex); in nvkm_i2c_pad_mode()
46 nvkm_i2c_pad_release(struct nvkm_i2c_pad *pad) in nvkm_i2c_pad_release() argument
48 PAD_TRACE(pad, "release"); in nvkm_i2c_pad_release()
49 if (pad->mode == NVKM_I2C_PAD_OFF) in nvkm_i2c_pad_release()
50 nvkm_i2c_pad_mode_locked(pad, pad->mode); in nvkm_i2c_pad_release()
51 mutex_unlock(&pad->mutex); in nvkm_i2c_pad_release()
55 nvkm_i2c_pad_acquire(struct nvkm_i2c_pad *pad, enum nvkm_i2c_pad_mode mode) in nvkm_i2c_pad_acquire() argument
57 PAD_TRACE(pad, "acquire"); in nvkm_i2c_pad_acquire()
58 mutex_lock(&pad->mutex); in nvkm_i2c_pad_acquire()
59 if (pad->mode != mode) { in nvkm_i2c_pad_acquire()
60 if (pad->mode != NVKM_I2C_PAD_OFF) { in nvkm_i2c_pad_acquire()
61 mutex_unlock(&pad->mutex); in nvkm_i2c_pad_acquire()
64 nvkm_i2c_pad_mode_locked(pad, mode); in nvkm_i2c_pad_acquire()
70 nvkm_i2c_pad_fini(struct nvkm_i2c_pad *pad) in nvkm_i2c_pad_fini() argument
72 PAD_TRACE(pad, "fini"); in nvkm_i2c_pad_fini()
73 nvkm_i2c_pad_mode_locked(pad, NVKM_I2C_PAD_OFF); in nvkm_i2c_pad_fini()
77 nvkm_i2c_pad_init(struct nvkm_i2c_pad *pad) in nvkm_i2c_pad_init() argument
79 PAD_TRACE(pad, "init"); in nvkm_i2c_pad_init()
80 nvkm_i2c_pad_mode_locked(pad, pad->mode); in nvkm_i2c_pad_init()
86 struct nvkm_i2c_pad *pad = *ppad; in nvkm_i2c_pad_del() local
87 if (pad) { in nvkm_i2c_pad_del()
88 PAD_TRACE(pad, "dtor"); in nvkm_i2c_pad_del()
89 list_del(&pad->head); in nvkm_i2c_pad_del()
90 kfree(pad); in nvkm_i2c_pad_del()
91 pad = NULL; in nvkm_i2c_pad_del()
97 int id, struct nvkm_i2c_pad *pad) in nvkm_i2c_pad_ctor() argument
99 pad->func = func; in nvkm_i2c_pad_ctor()
100 pad->i2c = i2c; in nvkm_i2c_pad_ctor()
101 pad->id = id; in nvkm_i2c_pad_ctor()
102 pad->mode = NVKM_I2C_PAD_OFF; in nvkm_i2c_pad_ctor()
103 mutex_init(&pad->mutex); in nvkm_i2c_pad_ctor()
104 list_add_tail(&pad->head, &i2c->pad); in nvkm_i2c_pad_ctor()
105 PAD_TRACE(pad, "ctor"); in nvkm_i2c_pad_ctor()