Skip to contentSkip to conversation

goldfish: bring the framebuffer in sync with upstream

PATCH In review Alan 3 participants 5 messages Feb 26, 2016 – Mar 7, 2016 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

Alan

author
#0 lore raw

cover goldfish: bring the framebuffer in sync with upstream

The Android tree has changes to support Goldfish (Android virtual platform emulator) improvements. Pull those into upstream as part of the goal of making upstream run out of the box on Goldfish.

---

Christoffer Dall (1):
Subject: goldfish_fb: Set pixclock = 0

Greg Hackmann (1):
Subject: video: goldfishfb: add devicetree bindings

Nicolas Capens (1):
Subject: goldfishfb: simplify framebuffer format selection.

Yu Ning (1):
Subject: goldfish: Enable ACPI-based enumeration for goldfish framebuffer

bohu (1):
Subject: goldfish: 32 bit framebuffer support

 .../devicetree/bindings/goldfish/audio.txt         |   17 +++
 .../devicetree/bindings/goldfish/battery.txt       |   17 +++
 .../devicetree/bindings/goldfish/events.txt        |   17 +++
 Documentation/devicetree/bindings/goldfish/fb.txt  |   17 +++
 Documentation/devicetree/bindings/goldfish/tty.txt |   17 +++
 drivers/input/keyboard/goldfish_events.c           |   15 +++
 drivers/power/goldfish_battery.c                   |   17 +++
 drivers/staging/goldfish/goldfish_audio.c          |   10 ++
 drivers/tty/goldfish.c                             |   10 ++
 drivers/video/fbdev/goldfishfb.c                   |  107 +++++++++++++++++---
 10 files changed, 223 insertions(+), 21 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/goldfish/audio.txt
 create mode 100644 Documentation/devicetree/bindings/goldfish/battery.txt
 create mode 100644 Documentation/devicetree/bindings/goldfish/events.txt
 create mode 100644 Documentation/devicetree/bindings/goldfish/fb.txt
 create mode 100644 Documentation/devicetree/bindings/goldfish/tty.txt

--
#include <witty.h>

author
#1 lore raw

PATCH 1/5 Subject: video: goldfishfb: add devicetree bindings

From: Greg Hackmann <[email protected]>

Add device tree bindings to the Goldfish frame buffer interface.

---
 Documentation/devicetree/bindings/goldfish/fb.txt |   17 +++++++++++++++++
 drivers/video/fbdev/goldfishfb.c                  |    9 ++++++++-
 2 files changed, 25 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/goldfish/fb.txt
Documentation/devicetree/bindings/goldfish/fb.txt new file +17 -0
new file mode 100644
index 0000000..c7d2d46
@@ -0,0 +1,17 @@
+Android Goldfish Framebuffer
+
+Andorid goldfish framebuffer device generated by android emulator.
+
+Required properties:
+
+- compatible : should contain "google,goldfish-fb" to match emulator
+- reg        : <registers mapping>
+- interrupts : <interrupt mapping>
+
+Example:
+
+	goldfish_fb@9010000 {
+		compatible = "google,goldfish-fb";
+		reg = <0x9010000 0x100>;
+		interrupts = <0x2>;
+	};
drivers/video/fbdev/goldfishfb.c +8 -1
index 7f6c9e6..f0e651b 100644
@@ -304,12 +304,19 @@ static int goldfish_fb_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id goldfish_fb_of_match[] = {
+	{ .compatible = "google,goldfish-fb", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, goldfish_fb_of_match);
 
 static struct platform_driver goldfish_fb_driver = {
 	.probe		= goldfish_fb_probe,
 	.remove		= goldfish_fb_remove,
 	.driver = {
-		.name = "goldfish_fb"
+		.name = "goldfish_fb",
+		.owner = THIS_MODULE,
+		.of_match_table = goldfish_fb_of_match,
 	}
 };
 

A message that is not in the archive (sent off-list or not yet received): 20160226184146.2731.41848.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected]

#3 lore raw

Re: [PATCH 1/5] Subject: video: goldfishfb: add devicetree bindings

Quoted 4 lines · Alan

From: Greg Hackmann <[email protected]>

Add device tree bindings to the Goldfish frame buffer interface.

Quoted 8 lines
---
 Documentation/devicetree/bindings/goldfish/fb.txt |   17 +++++++++++++++++
 drivers/video/fbdev/goldfishfb.c                  |    9 ++++++++-
 2 files changed, 25 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/goldfish/fb.txt

Device tree bindings should also be sent to the devicetree mailing list.

Documentation/devicetree/bindings/goldfish/fb.txt line 3

Quoted 9 lines
Documentation/devicetree/bindings/goldfish/fb.txt new file +3 -0
new file mode 100644
index 0000000..c7d2d46
@@ -0,0 +1,17 @@
+Android Goldfish Framebuffer
+
+Andorid goldfish framebuffer device generated by android emulator.

Typo there in Android.

Quoted 40 lines
Documentation/devicetree/bindings/goldfish/fb.txt new file +14 -0
+
+Required properties:
+
+- compatible : should contain "google,goldfish-fb" to match emulator
+- reg        : <registers mapping>
+- interrupts : <interrupt mapping>
+
+Example:
+
+	goldfish_fb@9010000 {
+		compatible = "google,goldfish-fb";
+		reg = <0x9010000 0x100>;
+		interrupts = <0x2>;
+	};
drivers/video/fbdev/goldfishfb.c +8 -1
index 7f6c9e6..f0e651b 100644
@@ -304,12 +304,19 @@ static int goldfish_fb_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id goldfish_fb_of_match[] = {
+	{ .compatible = "google,goldfish-fb", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, goldfish_fb_of_match);
 
 static struct platform_driver goldfish_fb_driver = {
 	.probe		= goldfish_fb_probe,
 	.remove		= goldfish_fb_remove,
 	.driver = {
-		.name = "goldfish_fb"
+		.name = "goldfish_fb",
+		.owner = THIS_MODULE,
+		.of_match_table = goldfish_fb_of_match,
 	}
 };
 
author
#4 lore raw

PATCH 2/5 Subject: goldfish: Enable ACPI-based enumeration for goldfish framebuffer

From: Yu Ning <[email protected]>

Enable ACPI bindings for the Goldfish framebuffer device.

---
 drivers/video/fbdev/goldfishfb.c |    8 ++++++++
 1 file changed, 8 insertions(+)
drivers/video/fbdev/goldfishfb.c +8 -0
index f0e651b..58b33e4 100644
@@ -26,6 +26,7 @@
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/platform_device.h>
+#include <linux/acpi.h>
 
 enum {
 	FB_GET_WIDTH        = 0x00,
@@ -310,6 +311,12 @@ static const struct of_device_id goldfish_fb_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, goldfish_fb_of_match);
 
+static const struct acpi_device_id goldfish_fb_acpi_match[] = {
+	{ "GFSH0004", 0 },
+	{ },
+};
+MODULE_DEVICE_TABLE(acpi, goldfish_fb_acpi_match);
+
 static struct platform_driver goldfish_fb_driver = {
 	.probe		= goldfish_fb_probe,
 	.remove		= goldfish_fb_remove,
@@ -317,6 +324,7 @@ static struct platform_driver goldfish_fb_driver = {
 		.name = "goldfish_fb",
 		.owner = THIS_MODULE,
 		.of_match_table = goldfish_fb_of_match,
+		.acpi_match_table = ACPI_PTR(goldfish_fb_acpi_match),
 	}
 };
 
#5 lore raw

Re: [PATCH 2/5] Subject: goldfish: Enable ACPI-based enumeration for goldfish framebuffer

Quoted 24 lines · Alan

From: Yu Ning <[email protected]>

Enable ACPI bindings for the Goldfish framebuffer device.

---
 drivers/video/fbdev/goldfishfb.c |    8 ++++++++
 1 file changed, 8 insertions(+)
drivers/video/fbdev/goldfishfb.c +1 -0
index f0e651b..58b33e4 100644
@@ -26,6 +26,7 @@
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/platform_device.h>
+#include <linux/acpi.h>
 
 enum {
 	FB_GET_WIDTH        = 0x00,

drivers/video/fbdev/goldfishfb.c static const struct of_device_id goldfish_fb_of_match[] = { · line 315

Quoted 5 lines
drivers/video/fbdev/goldfishfb.c +2 -0
@@ -310,6 +311,12 @@ static const struct of_device_id goldfish_fb_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, goldfish_fb_of_match);
 
+static const struct acpi_device_id goldfish_fb_acpi_match[] = {
+	{ "GFSH0004", 0 },

I'm not familiar with ACPI, so I need to ask... Where does the ID come from? Is it safe to use that one, and there's no chance for a clash with some other device in the future?

drivers/video/fbdev/goldfishfb.c static struct platform_driver goldfish_fb_driver = { · line 327

Quoted 12 lines
drivers/video/fbdev/goldfishfb.c +5 -0
+	{ },
+};
+MODULE_DEVICE_TABLE(acpi, goldfish_fb_acpi_match);
+
 static struct platform_driver goldfish_fb_driver = {
 	.probe		= goldfish_fb_probe,
 	.remove		= goldfish_fb_remove,
@@ -317,6 +324,7 @@ static struct platform_driver goldfish_fb_driver = {
 		.name = "goldfish_fb",
 		.owner = THIS_MODULE,
 		.of_match_table = goldfish_fb_of_match,
+		.acpi_match_table = ACPI_PTR(goldfish_fb_acpi_match),

So does the emulator sometimes use devicetree and sometimes ACPI to match the device?

Tomi