Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers: tty: goldfish: Add device tree bindings

Enable support for registering this device using the device tree.
Device tree node example for registering Goldfish TTY device :

goldfish_tty@1f004000 {
interrupts = <0xc>;
reg = <0x1f004000 0x1000>;
compatible = "google,goldfish-tty";
};

Signed-off-by: Miodrag Dinic <miodrag.dinic@imgtec.com>
Signed-off-by: Jin Qian <jinqian@android.com>
Signed-off-by: Alan <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Miodrag Dinic and committed by
Greg Kroah-Hartman
9b883eea 106020cc

+26 -1
+17
Documentation/devicetree/bindings/goldfish/tty.txt
··· 1 + Android Goldfish TTY 2 + 3 + Android goldfish tty device generated by android emulator. 4 + 5 + Required properties: 6 + 7 + - compatible : should contain "google,goldfish-tty" to match emulator 8 + - reg : <registers mapping> 9 + - interrupts : <interrupt mapping> 10 + 11 + Example: 12 + 13 + goldfish_tty@1f004000 { 14 + compatible = "google,goldfish-tty"; 15 + reg = <0x1f004000 0x1000>; 16 + interrupts = <0xc>; 17 + };
+9 -1
drivers/tty/goldfish.c
··· 324 324 return 0; 325 325 } 326 326 327 + static const struct of_device_id goldfish_tty_of_match[] = { 328 + { .compatible = "google,goldfish-tty", }, 329 + {}, 330 + }; 331 + 332 + MODULE_DEVICE_TABLE(of, goldfish_tty_of_match); 333 + 327 334 static struct platform_driver goldfish_tty_platform_driver = { 328 335 .probe = goldfish_tty_probe, 329 336 .remove = goldfish_tty_remove, 330 337 .driver = { 331 - .name = "goldfish_tty" 338 + .name = "goldfish_tty", 339 + .of_match_table = goldfish_tty_of_match, 332 340 } 333 341 }; 334 342