Re: [PATCHv2 03/17] OMAP3: PM: Convert smartreflex driver into a platform driver using hwmods and omap-device layer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Gopinath, Thara had written, on 03/18/2010 04:15 AM, the following:
This patch converts the exisitng smartreflex library into a
platform driver with device , driver registrations using hardware mods.
As part of this Ntarget values are passed as platform data.

Signed-off-by: Thara Gopinath <thara@xxxxxx>
[...]

+/*
+ * Hard coded nvalues for testing purposes for OMAP3430,
+ * may cause device to hang!
+ */
+static void __init omap34xx_sr_set_testing_nvalues(
+                               struct omap_smartreflex_data *sr_data, int srid)
+{
+       if (srid == SR1) {
+               sr_data->no_opp = opp_get_opp_count(OPP_MPU);
+               sr_data->sr_nvalue = kzalloc(sizeof(sr_data->sr_nvalue) *
+                               sr_data->no_opp , GFP_KERNEL);
+               if (WARN_ON(!sr_data->sr_nvalue))
+                       return;
+
+               sr_data->senp_mod = 0x03;       /* SenN-M5 enabled */
+               sr_data->senn_mod = 0x03;
+               /* calculate nvalues for each opp */
+               sr_data->sr_nvalue[4] = 0x0;
+               sr_data->sr_nvalue[3] = 0x0;
+               sr_data->sr_nvalue[2] = 0x0;
+               sr_data->sr_nvalue[1] = 0x0;
+               sr_data->sr_nvalue[0] = 0x0;
+       } else if (srid == SR2) {
+               sr_data->no_opp = 3;
+               sr_data->sr_nvalue = kzalloc(sizeof(sr_data->sr_nvalue) *
+                                       sr_data->no_opp , GFP_KERNEL);
+               if (WARN_ON(!sr_data->sr_nvalue))
+                       return;
+
+               sr_data->senp_mod = 0x03;       /* SenN-M5 enabled */
+               sr_data->senn_mod = 0x03;
+               sr_data->sr_nvalue[2] = 0x0;
+               sr_data->sr_nvalue[1] = 0x0;
+               sr_data->sr_nvalue[0] = 0x0;
+       }
+}
NAK to opp IDs, and IMHO if we can remove SRIDs as well, it will be good.
Related discussion in http://marc.info/?t=126893797600009&r=1&w=2

--
Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux