Lines Matching defs:tvpll
1 /* $NetBSD: tvpll.c,v 1.8 2019/12/23 15:25:08 thorpej Exp $ */
30 __KERNEL_RCSID(0, "$NetBSD: tvpll.c,v 1.8 2019/12/23 15:25:08 thorpej Exp $");
43 struct tvpll {
51 static uint32_t tvpll_algo(struct tvpll *, uint8_t *,
54 struct tvpll *
57 struct tvpll *tvpll;
59 tvpll = kmem_alloc(sizeof(struct tvpll), KM_SLEEP);
60 tvpll->tag = t;
61 tvpll->addr = a;
63 tvpll->pll = p;
65 if (tvpll->pll->initdata) {
66 iic_acquire_bus(tvpll->tag, 0);
67 (void)iic_exec(tvpll->tag, I2C_OP_WRITE_WITH_STOP, tvpll->addr,
68 &tvpll->pll->initdata[1], tvpll->pll->initdata[0],
70 iic_release_bus(tvpll->tag, 0);
73 device_printf(parent, "tvpll: %s\n", tvpll->pll->name);
75 return tvpll;
79 tvpll_close(struct tvpll *tvpll)
81 kmem_free(tvpll, sizeof(*tvpll));
85 tvpll_algo(struct tvpll *tvpll, uint8_t *b,
92 pll = tvpll->pll;
123 tvpll_tune_dtv(struct tvpll *tvpll,
132 if((rv = tvpll_algo(tvpll, b, params, &fr)) != 0)
135 iic_acquire_bus(tvpll->tag, 0);
140 rv = iic_exec(tvpll->tag, I2C_OP_WRITE_WITH_STOP, tvpll->addr, ab, 2, NULL, 0, 0);
142 rv = iic_exec(tvpll->tag, I2C_OP_WRITE_WITH_STOP, tvpll->addr, b, 4, NULL, 0, 0);
143 iic_release_bus(tvpll->tag, 0);
148 tvpll->frequency = fr;
153 MODULE(MODULE_CLASS_DRIVER, tvpll, "i2cexec");