Lines Matching defs:tcu

51 static void tegra_tcu_write_one(struct tegra_tcu *tcu, u32 value,
58 mbox_send_message(tcu->tx, msg);
59 mbox_flush(tcu->tx, 1000);
62 static void tegra_tcu_write(struct tegra_tcu *tcu, const char *s,
82 tegra_tcu_write_one(tcu, value, 3);
88 tegra_tcu_write_one(tcu, value, written);
93 struct tegra_tcu *tcu = port->private_data;
102 tegra_tcu_write(tcu, &xmit->buf[xmit->tail], count);
149 struct tegra_tcu *tcu = container_of(cons, struct tegra_tcu, console);
151 tegra_tcu_write(tcu, s, count);
162 struct tegra_tcu *tcu = container_of(cl, struct tegra_tcu, rx_client);
163 struct tty_port *port = &tcu->port.state->port;
179 struct tegra_tcu *tcu;
182 tcu = devm_kzalloc(&pdev->dev, sizeof(*tcu), GFP_KERNEL);
183 if (!tcu)
186 tcu->tx_client.dev = &pdev->dev;
187 tcu->rx_client.dev = &pdev->dev;
188 tcu->rx_client.rx_callback = tegra_tcu_receive;
190 tcu->tx = mbox_request_channel_byname(&tcu->tx_client, "tx");
191 if (IS_ERR(tcu->tx)) {
192 err = PTR_ERR(tcu->tx);
199 strcpy(tcu->console.name, "ttyTCU");
200 tcu->console.device = uart_console_device;
201 tcu->console.flags = CON_PRINTBUFFER | CON_ANYTIME;
202 tcu->console.index = -1;
203 tcu->console.write = tegra_tcu_console_write;
204 tcu->console.setup = tegra_tcu_console_setup;
205 tcu->console.data = &tcu->driver;
209 tcu->driver.owner = THIS_MODULE;
210 tcu->driver.driver_name = "tegra-tcu";
211 tcu->driver.dev_name = "ttyTCU";
213 tcu->driver.cons = &tcu->console;
215 tcu->driver.nr = 1;
217 err = uart_register_driver(&tcu->driver);
225 port = &tcu->port;
233 port->private_data = tcu;
235 err = uart_add_one_port(&tcu->driver, port);
242 * Request RX channel after creating port to ensure tcu->port
245 tcu->rx = mbox_request_channel_byname(&tcu->rx_client, "rx");
246 if (IS_ERR(tcu->rx)) {
247 err = PTR_ERR(tcu->rx);
252 platform_set_drvdata(pdev, tcu);
254 register_console(&tcu->console);
260 uart_remove_one_port(&tcu->driver, &tcu->port);
262 uart_unregister_driver(&tcu->driver);
264 mbox_free_channel(tcu->tx);
271 struct tegra_tcu *tcu = platform_get_drvdata(pdev);
274 unregister_console(&tcu->console);
276 mbox_free_channel(tcu->rx);
277 uart_remove_one_port(&tcu->driver, &tcu->port);
278 uart_unregister_driver(&tcu->driver);
279 mbox_free_channel(tcu->tx);
283 { .compatible = "nvidia,tegra194-tcu" },
290 .name = "tegra-tcu",