Lines Matching refs:db

134 static bool tegra_hsp_doorbell_can_ring(struct tegra_hsp_doorbell *db)  in tegra_hsp_doorbell_can_ring()  argument
138 value = tegra_hsp_channel_readl(&db->channel, HSP_DB_ENABLE); in tegra_hsp_doorbell_can_ring()
158 struct tegra_hsp_doorbell *db; in tegra_hsp_doorbell_get() local
162 db = __tegra_hsp_doorbell_get(hsp, master); in tegra_hsp_doorbell_get()
165 return db; in tegra_hsp_doorbell_get()
171 struct tegra_hsp_doorbell *db; in tegra_hsp_doorbell_irq() local
174 db = tegra_hsp_doorbell_get(hsp, TEGRA_HSP_DB_MASTER_CCPLEX); in tegra_hsp_doorbell_irq()
175 if (!db) in tegra_hsp_doorbell_irq()
178 value = tegra_hsp_channel_readl(&db->channel, HSP_DB_PENDING); in tegra_hsp_doorbell_irq()
179 tegra_hsp_channel_writel(&db->channel, value, HSP_DB_PENDING); in tegra_hsp_doorbell_irq()
184 struct tegra_hsp_doorbell *db; in tegra_hsp_doorbell_irq() local
186 db = __tegra_hsp_doorbell_get(hsp, master); in tegra_hsp_doorbell_irq()
198 if (db && db->channel.chan) in tegra_hsp_doorbell_irq()
199 mbox_chan_received_data(db->channel.chan, NULL); in tegra_hsp_doorbell_irq()
276 struct tegra_hsp_doorbell *db; in tegra_hsp_doorbell_create() local
280 db = devm_kzalloc(hsp->dev, sizeof(*db), GFP_KERNEL); in tegra_hsp_doorbell_create()
281 if (!db) in tegra_hsp_doorbell_create()
287 db->channel.regs = hsp->regs + offset; in tegra_hsp_doorbell_create()
288 db->channel.hsp = hsp; in tegra_hsp_doorbell_create()
290 db->name = devm_kstrdup_const(hsp->dev, name, GFP_KERNEL); in tegra_hsp_doorbell_create()
291 db->master = master; in tegra_hsp_doorbell_create()
292 db->index = index; in tegra_hsp_doorbell_create()
295 list_add_tail(&db->list, &hsp->doorbells); in tegra_hsp_doorbell_create()
298 return &db->channel; in tegra_hsp_doorbell_create()
303 struct tegra_hsp_doorbell *db = chan->con_priv; in tegra_hsp_doorbell_send_data() local
305 tegra_hsp_channel_writel(&db->channel, 1, HSP_DB_TRIGGER); in tegra_hsp_doorbell_send_data()
312 struct tegra_hsp_doorbell *db = chan->con_priv; in tegra_hsp_doorbell_startup() local
313 struct tegra_hsp *hsp = db->channel.hsp; in tegra_hsp_doorbell_startup()
318 if (db->master >= chan->mbox->num_chans) { in tegra_hsp_doorbell_startup()
321 db->master); in tegra_hsp_doorbell_startup()
334 if (tegra_is_silicon() && !tegra_hsp_doorbell_can_ring(db)) in tegra_hsp_doorbell_startup()
340 value |= BIT(db->master); in tegra_hsp_doorbell_startup()
350 struct tegra_hsp_doorbell *db = chan->con_priv; in tegra_hsp_doorbell_shutdown() local
351 struct tegra_hsp *hsp = db->channel.hsp; in tegra_hsp_doorbell_shutdown()
363 value &= ~BIT(db->master); in tegra_hsp_doorbell_shutdown()
508 struct tegra_hsp_doorbell *db; in tegra_hsp_db_xlate() local
516 db = tegra_hsp_doorbell_get(hsp, master); in tegra_hsp_db_xlate()
517 if (db) in tegra_hsp_db_xlate()
518 channel = &db->channel; in tegra_hsp_db_xlate()
529 chan->con_priv = db; in tegra_hsp_db_xlate()
799 struct tegra_hsp_doorbell *db; in tegra_hsp_resume() local
801 list_for_each_entry(db, &hsp->doorbells, list) { in tegra_hsp_resume()
802 if (db && db->channel.chan) in tegra_hsp_resume()
803 tegra_hsp_doorbell_startup(db->channel.chan); in tegra_hsp_resume()