diff for duplicates of <20110729134932.GA2258@foobar> diff --git a/a/1.txt b/N1/1.txt index 5e31bb0..c0c431a 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -7,9 +7,9 @@ On 08:31-20110728, Menon, Nishanth wrote: > >> --- a/arch/arm/mach-omap2/omap_hwmod.c > >> +++ b/arch/arm/mach-omap2/omap_hwmod.c > >> @@ -142,6 +142,7 @@ -> >> #include "powerdomain.h" -> >> #include<plat/clock.h> -> >> #include<plat/omap_hwmod.h> +> >> ?#include "powerdomain.h" +> >> ?#include<plat/clock.h> +> >> ?#include<plat/omap_hwmod.h> > >> +#include<plat/omap_device.h> > > > > I'd rather put that code inside the omap_device.c instead of here. @@ -46,139 +46,3 @@ On 08:31-20110728, Menon, Nishanth wrote: > replacing it to do that. following are a couple of reference patches how this could be done with omap_device -From f03490456e24f72ca5272303c95a6f0b212494d5 Mon Sep 17 00:00:00 2001 -From: Nishanth Menon <nm@ti.com> -Date: Wed, 27 Jul 2011 15:02:32 -0500 -Subject: [PATCH 1/2] OMAP: PM: omap_device: add omap_hwmod_name_get_odev - -An API which translates a standard hwmod name to corresponding -omap_device is useful for drivers when they need to look up the -device associated with a hwmod name to map back into the device -structure pointers. These ideally should be used by drivers in -mach directory. Using a generic hwmod name like "gpu" instead of -the actual device name which could change in the future, allows -us to: -a) Could in effect help replace apis such as omap2_get_mpuss_device, -omap2_get_iva_device, omap2_get_l3_device, omap4_get_dsp_device, -etc.. -b) Scale to more devices rather than be restricted to named functions -c) Simplify driver's platform_data from passing additional fields -all doing the same thing with different function pointer names -just for accessing a different device name. - -Change-Id: Ib42d22b4a929982c87a79866e3d7dc6e41073a6c -Signed-off-by: Nishanth Menon <nm@ti.com> ---- - arch/arm/plat-omap/include/plat/omap_device.h | 1 + - arch/arm/plat-omap/omap_device.c | 32 +++++++++++++++++++++++++ - 2 files changed, 33 insertions(+), 0 deletions(-) - -diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h -index 70d31d0..7a3c046 100644 ---- a/arch/arm/plat-omap/include/plat/omap_device.h -+++ b/arch/arm/plat-omap/include/plat/omap_device.h -@@ -102,6 +102,7 @@ int omap_device_register(struct omap_device *od); - int omap_early_device_register(struct omap_device *od); - - void __iomem *omap_device_get_rt_va(struct omap_device *od); -+struct omap_device *omap_hwmod_name_get_odev(const char *oh_name); - - /* OMAP PM interface */ - int omap_device_align_pm_lat(struct platform_device *pdev, -diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c -index 92b4496..21df532 100644 ---- a/arch/arm/plat-omap/omap_device.c -+++ b/arch/arm/plat-omap/omap_device.c -@@ -780,6 +780,38 @@ void __iomem *omap_device_get_rt_va(struct omap_device *od) - return omap_hwmod_get_mpu_rt_va(od->hwmods[0]); - } - -+/** -+ * omap_hwmod_name_get_odev() - convert a hwmod name to omap_device pointer -+ * @oh_name: name of the hwmod device -+ * -+ * returns back a struct omap_device * pointer associated with a hwmod -+ * device represented by a hwmod_name -+ */ -+struct omap_device *omap_hwmod_name_get_odev(const char *oh_name) -+{ -+ struct omap_hwmod *oh; -+ -+ if (!oh_name) { -+ WARN(1, "%s: no hwmod name!\n", __func__); -+ return ERR_PTR(-EINVAL); -+ } -+ -+ oh = omap_hwmod_lookup(oh_name); -+ if (IS_ERR_OR_NULL(oh)) { -+ WARN(1, "%s: no hwmod for %s\n", __func__, -+ oh_name); -+ return ERR_PTR(oh ? PTR_ERR(oh) : -ENODEV); -+ } -+ if (IS_ERR_OR_NULL(oh->od)) { -+ WARN(1, "%s: no omap_device for %s\n", __func__, -+ oh_name); -+ return ERR_PTR(oh->od ? PTR_ERR(oh->od) : -ENODEV); -+ } -+ -+ return oh->od; -+} -+EXPORT_SYMBOL(omap_hwmod_name_get_odev); -+ - /* - * Public functions intended for use in omap_device_pm_latency - * .activate_func and .deactivate_func function pointers --- -1.7.4.1 - -From 51e517c2cb620532a29ec466c32ce1c78663bf43 Mon Sep 17 00:00:00 2001 -From: Nishanth Menon <nm@ti.com> -Date: Thu, 28 Jul 2011 17:07:28 -0500 -Subject: [PATCH 2/2] OMAP: PM: omap_device: add few quick access functions - -Provide a quick set of access functions: -a) Convert omap_device to platform_device - This is the flip of - to_omap_device for equivalent usage -b) Convert omap_device to device pointer - This is useful for - most devices that need to go through standard linux functions that - take device pointer. -c) Convert hwmod to device pointer - This wrapper provides ability for - drivers to convert directly from hwmod name back to device pointer - without having to handle this on a driver by driver basis - -Change-Id: I0fe16eeb41c32d5b166d5cb3f78af4fda140d398 -Signed-off-by: Nishanth Menon <nm@ti.com> ---- - arch/arm/plat-omap/include/plat/omap_device.h | 13 +++++++++++++ - 1 files changed, 13 insertions(+), 0 deletions(-) - -diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h -index 7a3c046..11cb471 100644 ---- a/arch/arm/plat-omap/include/plat/omap_device.h -+++ b/arch/arm/plat-omap/include/plat/omap_device.h -@@ -150,5 +150,18 @@ struct omap_device_pm_latency { - - /* Get omap_device pointer from platform_device pointer */ - #define to_omap_device(x) container_of((x), struct omap_device, pdev) -+/* Convert omap_device to platform device pointer */ -+#define omap_device_get_pdev(x) (&(x)->pdev) -+/* Convert omap_device to device pointer */ -+#define omap_device_get_dev(x) (&omap_device_get_pdev(x)->dev) -+/* Convert omap_hwmod name to device pointer */ -+static inline struct device *omap_hwmod_name_get_dev(const char *oh_name) -+{ -+ struct omap_device *od; -+ od = omap_hwmod_name_get_dev(oh_name); -+ if (IS_ERR_OR_NULL(od)) -+ return ERR_PTR(od ? PTR_ERR(od) : -ENODEV); -+ return omap_device_get_dev(od); -+} - - #endif --- -1.7.4.1 - --- -To unsubscribe from this list: send the line "unsubscribe linux-omap" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/a/content_digest b/N1/content_digest index 9bf2e66..5675c90 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -4,22 +4,10 @@ "ref\020110728055346.GA11921@foobar\0" "ref\04E315C9F.1030801@ti.com\0" "ref\0CAOMWX4fYGD4aRomoHZjvy_F9CRb_U9UV4OOa0BgrzZhx81iQtQ@mail.gmail.com\0" - "From\0Nishanth Menon <nm@ti.com>\0" - "Subject\0Re: [RFC/PATCH 2/7] OMAP3: beagle: don't touch omap_device internals\0" + "From\0nm@ti.com (Nishanth Menon)\0" + "Subject\0[RFC/PATCH 2/7] OMAP3: beagle: don't touch omap_device internals\0" "Date\0Fri, 29 Jul 2011 08:49:34 -0500\0" - "To\0Cousson" - " Benoit <b-cousson@ti.com>\0" - "Cc\0Balbi" - Felipe <balbi@ti.com> - Hilman - Kevin <khilman@ti.com> - Paul Walmsley <paul@pwsan.com> - G - Manjunath Kondaiah <manjugk@ti.com> - devicetree-discuss@lists.ozlabs.org <devicetree-discuss@lists.ozlabs.org> - Grant Likely <grant.likely@secretlab.ca> - linux-omap@vger.kernel.org <linux-omap@vger.kernel.org> - " linux-arm-kernel@lists.infradead.org <linux-arm-kernel@lists.infradead.org>\0" + "To\0linux-arm-kernel@lists.infradead.org\0" "\00:1\0" "b\0" "On 08:31-20110728, Menon, Nishanth wrote:\n" @@ -31,9 +19,9 @@ "> >> --- a/arch/arm/mach-omap2/omap_hwmod.c\n" "> >> +++ b/arch/arm/mach-omap2/omap_hwmod.c\n" "> >> @@ -142,6 +142,7 @@\n" - "> >> \302\240#include \"powerdomain.h\"\n" - "> >> \302\240#include<plat/clock.h>\n" - "> >> \302\240#include<plat/omap_hwmod.h>\n" + "> >> ?#include \"powerdomain.h\"\n" + "> >> ?#include<plat/clock.h>\n" + "> >> ?#include<plat/omap_hwmod.h>\n" "> >> +#include<plat/omap_device.h>\n" "> >\n" "> > I'd rather put that code inside the omap_device.c instead of here.\n" @@ -69,142 +57,6 @@ "> silicon - I hoped we could consider the hwmod database/what ever\n" "> replacing it to do that.\n" "following are a couple of reference patches how this could be done\n" - "with omap_device\n" - "From f03490456e24f72ca5272303c95a6f0b212494d5 Mon Sep 17 00:00:00 2001\n" - "From: Nishanth Menon <nm@ti.com>\n" - "Date: Wed, 27 Jul 2011 15:02:32 -0500\n" - "Subject: [PATCH 1/2] OMAP: PM: omap_device: add omap_hwmod_name_get_odev\n" - "\n" - "An API which translates a standard hwmod name to corresponding\n" - "omap_device is useful for drivers when they need to look up the\n" - "device associated with a hwmod name to map back into the device\n" - "structure pointers. These ideally should be used by drivers in\n" - "mach directory. Using a generic hwmod name like \"gpu\" instead of\n" - "the actual device name which could change in the future, allows\n" - "us to:\n" - "a) Could in effect help replace apis such as omap2_get_mpuss_device,\n" - "omap2_get_iva_device, omap2_get_l3_device, omap4_get_dsp_device,\n" - "etc..\n" - "b) Scale to more devices rather than be restricted to named functions\n" - "c) Simplify driver's platform_data from passing additional fields\n" - "all doing the same thing with different function pointer names\n" - "just for accessing a different device name.\n" - "\n" - "Change-Id: Ib42d22b4a929982c87a79866e3d7dc6e41073a6c\n" - "Signed-off-by: Nishanth Menon <nm@ti.com>\n" - "---\n" - " arch/arm/plat-omap/include/plat/omap_device.h | 1 +\n" - " arch/arm/plat-omap/omap_device.c | 32 +++++++++++++++++++++++++\n" - " 2 files changed, 33 insertions(+), 0 deletions(-)\n" - "\n" - "diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h\n" - "index 70d31d0..7a3c046 100644\n" - "--- a/arch/arm/plat-omap/include/plat/omap_device.h\n" - "+++ b/arch/arm/plat-omap/include/plat/omap_device.h\n" - "@@ -102,6 +102,7 @@ int omap_device_register(struct omap_device *od);\n" - " int omap_early_device_register(struct omap_device *od);\n" - " \n" - " void __iomem *omap_device_get_rt_va(struct omap_device *od);\n" - "+struct omap_device *omap_hwmod_name_get_odev(const char *oh_name);\n" - " \n" - " /* OMAP PM interface */\n" - " int omap_device_align_pm_lat(struct platform_device *pdev,\n" - "diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c\n" - "index 92b4496..21df532 100644\n" - "--- a/arch/arm/plat-omap/omap_device.c\n" - "+++ b/arch/arm/plat-omap/omap_device.c\n" - "@@ -780,6 +780,38 @@ void __iomem *omap_device_get_rt_va(struct omap_device *od)\n" - " \treturn omap_hwmod_get_mpu_rt_va(od->hwmods[0]);\n" - " }\n" - " \n" - "+/**\n" - "+ * omap_hwmod_name_get_odev() - convert a hwmod name to omap_device pointer\n" - "+ * @oh_name: name of the hwmod device\n" - "+ *\n" - "+ * returns back a struct omap_device * pointer associated with a hwmod\n" - "+ * device represented by a hwmod_name\n" - "+ */\n" - "+struct omap_device *omap_hwmod_name_get_odev(const char *oh_name)\n" - "+{\n" - "+\tstruct omap_hwmod *oh;\n" - "+\n" - "+\tif (!oh_name) {\n" - "+\t\tWARN(1, \"%s: no hwmod name!\\n\", __func__);\n" - "+\t\treturn ERR_PTR(-EINVAL);\n" - "+\t}\n" - "+\n" - "+\toh = omap_hwmod_lookup(oh_name);\n" - "+\tif (IS_ERR_OR_NULL(oh)) {\n" - "+\t\tWARN(1, \"%s: no hwmod for %s\\n\", __func__,\n" - "+\t\t\toh_name);\n" - "+\t\treturn ERR_PTR(oh ? PTR_ERR(oh) : -ENODEV);\n" - "+\t}\n" - "+\tif (IS_ERR_OR_NULL(oh->od)) {\n" - "+\t\tWARN(1, \"%s: no omap_device for %s\\n\", __func__,\n" - "+\t\t\toh_name);\n" - "+\t\treturn ERR_PTR(oh->od ? PTR_ERR(oh->od) : -ENODEV);\n" - "+\t}\n" - "+\n" - "+\treturn oh->od;\n" - "+}\n" - "+EXPORT_SYMBOL(omap_hwmod_name_get_odev);\n" - "+\n" - " /*\n" - " * Public functions intended for use in omap_device_pm_latency\n" - " * .activate_func and .deactivate_func function pointers\n" - "-- \n" - "1.7.4.1\n" - "\n" - "From 51e517c2cb620532a29ec466c32ce1c78663bf43 Mon Sep 17 00:00:00 2001\n" - "From: Nishanth Menon <nm@ti.com>\n" - "Date: Thu, 28 Jul 2011 17:07:28 -0500\n" - "Subject: [PATCH 2/2] OMAP: PM: omap_device: add few quick access functions\n" - "\n" - "Provide a quick set of access functions:\n" - "a) Convert omap_device to platform_device - This is the flip of\n" - " to_omap_device for equivalent usage\n" - "b) Convert omap_device to device pointer - This is useful for\n" - " most devices that need to go through standard linux functions that\n" - " take device pointer.\n" - "c) Convert hwmod to device pointer - This wrapper provides ability for\n" - " drivers to convert directly from hwmod name back to device pointer\n" - " without having to handle this on a driver by driver basis\n" - "\n" - "Change-Id: I0fe16eeb41c32d5b166d5cb3f78af4fda140d398\n" - "Signed-off-by: Nishanth Menon <nm@ti.com>\n" - "---\n" - " arch/arm/plat-omap/include/plat/omap_device.h | 13 +++++++++++++\n" - " 1 files changed, 13 insertions(+), 0 deletions(-)\n" - "\n" - "diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h\n" - "index 7a3c046..11cb471 100644\n" - "--- a/arch/arm/plat-omap/include/plat/omap_device.h\n" - "+++ b/arch/arm/plat-omap/include/plat/omap_device.h\n" - "@@ -150,5 +150,18 @@ struct omap_device_pm_latency {\n" - " \n" - " /* Get omap_device pointer from platform_device pointer */\n" - " #define to_omap_device(x) container_of((x), struct omap_device, pdev)\n" - "+/* Convert omap_device to platform device pointer */\n" - "+#define omap_device_get_pdev(x) (&(x)->pdev)\n" - "+/* Convert omap_device to device pointer */\n" - "+#define omap_device_get_dev(x) (&omap_device_get_pdev(x)->dev)\n" - "+/* Convert omap_hwmod name to device pointer */\n" - "+static inline struct device *omap_hwmod_name_get_dev(const char *oh_name)\n" - "+{\n" - "+\tstruct omap_device *od;\n" - "+\tod = omap_hwmod_name_get_dev(oh_name);\n" - "+\tif (IS_ERR_OR_NULL(od))\n" - "+\t\treturn ERR_PTR(od ? PTR_ERR(od) : -ENODEV);\n" - "+\treturn omap_device_get_dev(od);\n" - "+}\n" - " \n" - " #endif\n" - "-- \n" - "1.7.4.1\n" - "\n" - "--\n" - "To unsubscribe from this list: send the line \"unsubscribe linux-omap\" in\n" - "the body of a message to majordomo@vger.kernel.org\n" - More majordomo info at http://vger.kernel.org/majordomo-info.html + with omap_device -5b1133109b6601d88953cff2a0cd838fd79a83a1129fa48b13fd97a6e7288061 +dfc3839f30eedf870a1f072bd2093e7ce93000904b781630e381fa5771dbb6a7
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.