Lines Matching refs:vdi
45 static inline u32 ipu_vdi_read(struct ipu_vdi *vdi, unsigned int offset)
47 return readl(vdi->base + offset);
50 static inline void ipu_vdi_write(struct ipu_vdi *vdi, u32 value,
53 writel(value, vdi->base + offset);
56 void ipu_vdi_set_field_order(struct ipu_vdi *vdi, v4l2_std_id std, u32 field)
78 spin_lock_irqsave(&vdi->lock, flags);
80 reg = ipu_vdi_read(vdi, VDI_C);
85 ipu_vdi_write(vdi, reg, VDI_C);
87 spin_unlock_irqrestore(&vdi->lock, flags);
91 void ipu_vdi_set_motion(struct ipu_vdi *vdi, enum ipu_motion_sel motion_sel)
96 spin_lock_irqsave(&vdi->lock, flags);
98 reg = ipu_vdi_read(vdi, VDI_C);
114 ipu_vdi_write(vdi, reg, VDI_C);
116 spin_unlock_irqrestore(&vdi->lock, flags);
120 void ipu_vdi_setup(struct ipu_vdi *vdi, u32 code, int xres, int yres)
125 spin_lock_irqsave(&vdi->lock, flags);
128 ipu_vdi_write(vdi, reg, VDI_FSIZE);
142 reg = ipu_vdi_read(vdi, VDI_C);
147 ipu_vdi_write(vdi, reg, VDI_C);
149 spin_unlock_irqrestore(&vdi->lock, flags);
153 int ipu_vdi_enable(struct ipu_vdi *vdi)
157 spin_lock_irqsave(&vdi->lock, flags);
159 if (!vdi->use_count)
160 ipu_module_enable(vdi->ipu, vdi->module);
162 vdi->use_count++;
164 spin_unlock_irqrestore(&vdi->lock, flags);
170 int ipu_vdi_disable(struct ipu_vdi *vdi)
174 spin_lock_irqsave(&vdi->lock, flags);
176 if (vdi->use_count) {
177 if (!--vdi->use_count)
178 ipu_module_disable(vdi->ipu, vdi->module);
181 spin_unlock_irqrestore(&vdi->lock, flags);
193 void ipu_vdi_put(struct ipu_vdi *vdi)
201 struct ipu_vdi *vdi;
203 vdi = devm_kzalloc(dev, sizeof(*vdi), GFP_KERNEL);
204 if (!vdi)
207 ipu->vdi_priv = vdi;
209 spin_lock_init(&vdi->lock);
210 vdi->module = module;
211 vdi->base = devm_ioremap(dev, base, PAGE_SIZE);
212 if (!vdi->base)
215 dev_dbg(dev, "VDI base: 0x%08lx remapped to %p\n", base, vdi->base);
216 vdi->ipu = ipu;