Lines Matching full:db
112 static bool tegra_hsp_doorbell_can_ring(struct tegra_hsp_doorbell *db) in tegra_hsp_doorbell_can_ring() argument
116 value = tegra_hsp_channel_readl(&db->channel, HSP_DB_ENABLE); in tegra_hsp_doorbell_can_ring()
136 struct tegra_hsp_doorbell *db; in tegra_hsp_doorbell_get() local
140 db = __tegra_hsp_doorbell_get(hsp, master); in tegra_hsp_doorbell_get()
143 return db; in tegra_hsp_doorbell_get()
149 struct tegra_hsp_doorbell *db; in tegra_hsp_doorbell_irq() local
152 db = tegra_hsp_doorbell_get(hsp, TEGRA_HSP_DB_MASTER_CCPLEX); in tegra_hsp_doorbell_irq()
153 if (!db) in tegra_hsp_doorbell_irq()
156 value = tegra_hsp_channel_readl(&db->channel, HSP_DB_PENDING); in tegra_hsp_doorbell_irq()
157 tegra_hsp_channel_writel(&db->channel, value, HSP_DB_PENDING); in tegra_hsp_doorbell_irq()
162 struct tegra_hsp_doorbell *db; in tegra_hsp_doorbell_irq() local
164 db = __tegra_hsp_doorbell_get(hsp, master); in tegra_hsp_doorbell_irq()
170 * In that case, db->channel.chan will still be NULL here and in tegra_hsp_doorbell_irq()
176 if (db && db->channel.chan) in tegra_hsp_doorbell_irq()
177 mbox_chan_received_data(db->channel.chan, NULL); in tegra_hsp_doorbell_irq()
189 struct tegra_hsp_doorbell *db; in tegra_hsp_doorbell_create() local
193 db = kzalloc(sizeof(*db), GFP_KERNEL); in tegra_hsp_doorbell_create()
194 if (!db) in tegra_hsp_doorbell_create()
200 db->channel.regs = hsp->regs + offset; in tegra_hsp_doorbell_create()
201 db->channel.hsp = hsp; in tegra_hsp_doorbell_create()
203 db->name = kstrdup_const(name, GFP_KERNEL); in tegra_hsp_doorbell_create()
204 db->master = master; in tegra_hsp_doorbell_create()
205 db->index = index; in tegra_hsp_doorbell_create()
208 list_add_tail(&db->list, &hsp->doorbells); in tegra_hsp_doorbell_create()
211 return &db->channel; in tegra_hsp_doorbell_create()
214 static void __tegra_hsp_doorbell_destroy(struct tegra_hsp_doorbell *db) in __tegra_hsp_doorbell_destroy() argument
216 list_del(&db->list); in __tegra_hsp_doorbell_destroy()
217 kfree_const(db->name); in __tegra_hsp_doorbell_destroy()
218 kfree(db); in __tegra_hsp_doorbell_destroy()
223 struct tegra_hsp_doorbell *db = chan->con_priv; in tegra_hsp_doorbell_send_data() local
225 tegra_hsp_channel_writel(&db->channel, 1, HSP_DB_TRIGGER); in tegra_hsp_doorbell_send_data()
232 struct tegra_hsp_doorbell *db = chan->con_priv; in tegra_hsp_doorbell_startup() local
233 struct tegra_hsp *hsp = db->channel.hsp; in tegra_hsp_doorbell_startup()
238 if (db->master >= hsp->mbox.num_chans) { in tegra_hsp_doorbell_startup()
241 db->master); in tegra_hsp_doorbell_startup()
249 if (!tegra_hsp_doorbell_can_ring(db)) in tegra_hsp_doorbell_startup()
255 value |= BIT(db->master); in tegra_hsp_doorbell_startup()
265 struct tegra_hsp_doorbell *db = chan->con_priv; in tegra_hsp_doorbell_shutdown() local
266 struct tegra_hsp *hsp = db->channel.hsp; in tegra_hsp_doorbell_shutdown()
278 value &= ~BIT(db->master); in tegra_hsp_doorbell_shutdown()
297 struct tegra_hsp_doorbell *db; in of_tegra_hsp_xlate() local
304 db = tegra_hsp_doorbell_get(hsp, master); in of_tegra_hsp_xlate()
305 if (db) in of_tegra_hsp_xlate()
306 channel = &db->channel; in of_tegra_hsp_xlate()
337 struct tegra_hsp_doorbell *db, *tmp; in tegra_hsp_remove_doorbells() local
342 list_for_each_entry_safe(db, tmp, &hsp->doorbells, list) in tegra_hsp_remove_doorbells()
343 __tegra_hsp_doorbell_destroy(db); in tegra_hsp_remove_doorbells()