path: root/LocomotorPrimitivesController.cpp
diff options
authorTobias Klauser <>2013-01-22 18:42:29 +0100
committerTobias Klauser <>2013-01-22 18:42:29 +0100
commitaf6b09829ca942ead8ea6757308d431a6d8ccde9 (patch)
tree1dbc4d98822c7dfecec33fabef5a9fb5952f7fc2 /LocomotorPrimitivesController.cpp
parenta1d0700c974aeacd4411213aff082f0e92018c3e (diff)
LocomotorPrimitives: Tinkering to make simulation faster
No success yet... :-(
Diffstat (limited to 'LocomotorPrimitivesController.cpp')
1 files changed, 8 insertions, 5 deletions
diff --git a/LocomotorPrimitivesController.cpp b/LocomotorPrimitivesController.cpp
index 14fa764..0c13336 100644
--- a/LocomotorPrimitivesController.cpp
+++ b/LocomotorPrimitivesController.cpp
@@ -4,6 +4,9 @@
#define VERBOSE 1
+// XXX
+extern clock_t ts_start;
static const double TIME_DAMP = 0.1;
static const unsigned int N_PRINT = 1000;
@@ -17,8 +20,10 @@ void LocomotorPrimitivesController::computeControls(const SimTK::State &s, SimTK
int act_set_siz = getActuatorSet().getSize();
int nc = _act.getSmallestNumberOfStates();
- // Get the first nc states at a specified time (_NOT_ the state at nc as
- // with getData()).
+ /*
+ * Get the first nc states at a specified time (_NOT_ the state at nc as
+ * with getData()).
+ */
_act.getDataAtTime(t, nc, _muscle_act);
for (int i = 0; i < act_set_siz; i++) {
@@ -28,7 +33,7 @@ void LocomotorPrimitivesController::computeControls(const SimTK::State &s, SimTK
if (indices.getSize() != 0) {
int idx = indices.get(0) - 1;
if (n % N_PRINT == 0)
- std::cout << t << " (" << idx << ") actuation data for '" << muscle->getName() << "' found: " << _muscle_act[idx] << std::endl;
+ std::cout << "[" << (1.e3 * clock() - ts_start) / CLOCKS_PER_SEC << "ms] " << t << " (" << idx << ") actuation data for '" << muscle->getName() << "' found: " << _muscle_act[idx] << std::endl;
if (_muscle_act[idx] > 1.0) {
std::cerr << "Error: muscle actuation larger than 1.0 (" << _muscle_act[idx] << "), truncating" << std::endl;
@@ -41,8 +46,6 @@ void LocomotorPrimitivesController::computeControls(const SimTK::State &s, SimTK
std::cerr << "Error: no actuation data for muscle '" << muscle->getName() << "' at time " << t << " found" << std::endl;
- //std::cout << " " << p.getName() << "(" << p.getIdx() << "/" << p.getCapacity() << ")" << std::endl;
ption in 'snd_soc_jack_add_zones' Signed-off-by: Masanari Iida <> Signed-off-by: Mark Brown <> 2014-10-23ASoC: jack: update calls to gpiod_get*()Alexandre Courbot1-6/+3 Add the new flags argument to calls of (devm_)gpiod_get*() and remove any direction setting code afterwards. Currently both forms (with or without the flags argument) are valid thanks to transitional macros in <linux/gpio/consumer.h>. These macros will be removed once all consumers are updated and the flags argument will become compulsary. Signed-off-by: Alexandre Courbot <> Signed-off-by: Mark Brown <> 2014-07-22ASoC: Move card field form platform/codec to componentLars-Peter Clausen1-2/+2 Both the snd_soc_codec and snd_soc_platform struct do have a pointer to the parent card and both handle this pointer in mostly the same way. This patch moves the card field to the component level which will allow further code consolidation between platforms and CODECS. Since there are only a handful of users of the snd_soc_codec struct's card field (and none of the snd_soc_platform's) these are update in this patch as well, which allows it to be removed from the snd_soc_codec struct. Signed-off-by: Lars-Peter Clausen <> Signed-off-by: Mark Brown <> 2014-05-26ASoC: jack: Add support for GPIO descriptor defined jack pinsJarkko Nikula1-16/+57 Allow jack GPIO pins be defined also using GPIO descriptor-based interface in addition to legacy GPIO numbers. This is done by adding two new fields to struct snd_soc_jack_gpio: idx and gpiod_dev. Legacy GPIO numbers are used only when GPIO consumer device gpiod_dev is NULL and otherwise idx is the descriptor index within the GPIO consumer device. New function snd_soc_jack_add_gpiods() is added for typical cases where all GPIO descriptor jack pins belong to same GPIO consumer device. For other cases the caller must set the gpiod_dev in struct snd_soc_jack_gpio before calling snd_soc_jack_add_gpios(). Signed-off-by: Jarkko Nikula <> Signed-off-by: Mark Brown <> 2014-05-26ASoC: jack: Basic GPIO descriptor conversionJarkko Nikula1-8/+11 This patch does basic GPIO descriptor conversion to soc-jack. Even the GPIOs are still passed and requested using legacy GPIO numbers the driver internals are converted to use GPIO descriptor API. Motivation for this is to prepare soc-jack so that it will allow registering jack GPIO pins using both GPIO descriptors and legacy GPIO numbers. Signed-off-by: Jarkko Nikula <> Signed-off-by: Mark Brown <> 2014-02-24ASoC: delay the initial jack detect by debounce_timexiangxiao1-1/+2 so the hardware could get time to initialize and debounce Signed-off-by: xiangxiao <> Signed-off-by: Mark Brown <> 2014-02-24ASoC: add data field into snd_soc_jack_gpioxiangxiao1-1/+1 so callback could get the context data as needed Signed-off-by: xiangxiao <> Signed-off-by: Mark Brown <> 2013-10-22ASoC: dont call dapm_sync while reporting jack alwaysVinod Koul1-1/+6 While reporting the jack status snd_soc_jack_report() invokes snd_soc_dapm_sync() always. This should be required when we have pins associated with jack and reporting enables or disables these. So add a check for this case Signed-off-by: Vinod Koul <> Signed-off-by: Mark Brown <> 2013-08-27ASoC: jack: Remove unnecessary call to snd_soc_dapm_new_widgets()Lars-Peter Clausen1-2/+0 snd_soc_jack_add_pins() does not create any new DAPM widgets, so there is no need to call snd_soc_dapm_new_widgets(). Signed-off-by: Lars-Peter Clausen <> Signed-off-by: Mark Brown <> 2013-07-19ASoC: jack: Use power efficient workqueueMark Brown1-1/+1 The accessory detect debounce work is not performance sensitive so let the scheduler run it wherever is most efficient rather than in a per CPU workqueue by using the system power efficient workqueue. Signed-off-by: Mark Brown <> Acked-by: Viresh Kumar <> 2012-12-02Merge remote-tracking branch 'asoc/topic/log' into asoc-nextMark Brown1-6/+7 2012-11-21ASoC: Jack: Standardise ASoC Jack messagesLiam Girdwood1-6/+7 Currently ASoC has a mixture of message prefixes e.g. "ASoC", "asoc" or none and message types e.g. pr_debug or dev_dbg. Make sure all ASoC core messages use the same "ASoC" prefix and convert any component device specific messages to use dev_dbg instead of pr_debug. Signed-off-by: Liam Girdwood <> Signed-off-by: Mark Brown <> 2012-10-22ASoC: jack: remove unused variable in snd_soc_jack_report()Wei Yongjun1-3/+0 The variable oldstatus is initialized but never used otherwise, so remove the unused variable. dpatch engine is used to auto generate this patch. ( Signed-off-by: Wei Yongjun <> Signed-off-by: Mark Brown <> 2012-10-09ASoC: fix documentation in soc-jackPeter Meerwald1-3/+4 Signed-off-by: Peter Meerwald <> Signed-off-by: Mark Brown <> 2012-09-05Merge branch 'asoc-omap' into for-3.7Mark Brown1-1/+1 2012-08-13ASoC: jack: Always notify full jack statusMark Brown1-1/+1 Don't just notify for the bits we've updated, notify the full state of the jack otherwise users might get confused by misleading reports. Signed-off-by: Mark Brown <> 2012-08-03ASoC: jack: Always update jack state even for noop changesMark Brown1-6/+0 Now that DAPM is very cheap for most updates we've no need to avoid trying to run it so always notify even if we don't think there are any changes. This avoids potential issues with bootstrapping state like the pin state or other notifiers when there's nothing in the jack. Signed-off-by: Mark Brown <> Acked-by: Liam Girdwood <> 2012-04-01ASoC: jack: Push locking for jacks down to the jackMark Brown1-2/+3 Currently operations on jack reporting take the CODEC mutex both to protect the current jack status and also to protect the DAPM run which is triggered on status updates. Since the addition of a DAPM-specific lock we no longer need to worry about locking DAPM as it has its own finer grained lock so create a per jack lock to take care of the jack status. This is both cleaner where the jack isn't specifically associated with a CODEC and clearer as it's much more obvious what the lock is protecting. Signed-off-by: Mark Brown <> 2011-12-21ASoC: Remove ifdefs for GPIO_SYSFSMark Brown1-4/+0 It is part of the GPIO API so should be stubbed appropriately. Signed-off-by: Mark Brown <> 2011-10-31sound: Add export.h for THIS_MODULE/EXPORT_SYMBOL where neededPaul Gortmaker1-0/+1 These aren't modules, but they do make use of these macros, so they will need export.h to get that definition. Previously, they got it via the implicit module.h inclusion. Signed-off-by: Paul Gortmaker <> 2011-10-06ASoC: Ensure DAPM widgets are set up before we sync jacksMark Brown1-0/+2 We synchronise jack state on startup - when we do that make sure that we have set up all the DAPM widgets first in case we end up touching any of the partially set up widgets when syncing the jack pins. Signed-off-by: Mark Brown <> Tested-by: Peter Ujfalusi <> 2011-09-05ASoC: Fix reporting of partial jack updatesMark Brown1-1/+1 We need to report the entire jack state to the core jack code, not just the bits that were being updated by the caller, otherwise the status reported by other detection methods will be omitted from the state seen by userspace. Signed-off-by: Mark Brown <> Acked-by: Liam Girdwood <> Cc: 2011-08-15ASoC: soc-jack: Fix checking return value of request_any_context_irqAxel Lin1-1/+1 request_any_context_irq() returns a negative value on failure. On success, it returns either IRQC_IS_HARDIRQ or IRQC_IS_NESTED. Signed-off-by: Axel Lin <> Signed-off-by: Mark Brown <> Cc: stable@kernel.orG 2011-04-18ASoC: Merge branch 'for-2.6.39' into for-2.6.40Mark Brown1-1/+1 Fix trivial conflict caused by silly spelling fix patch. Conflicts: sound/soc/codecs/wm8994.c 2011-04-03ASoC: Name jack GPIOs based on jack not codecStephen Warren1-1/+1 snd_soc_jack_gpio has a name field. Use that name when registering the IRQ, since this is far more informative than the codec driver name. This shows up in /proc/interrupts. Signed-off-by: Stephen Warren <> Signed-off-by: Mark Brown <> 2011-03-30sound: Fixup the last user of the old irq functionsThomas Gleixner1-1/+1 I had seen that before, but now that I removed set_irq_wake it broke. Signed-off-by: Thomas Gleixner <> 2011-02-24ASoC: Pass the jack to jack notifiersMark Brown1-1/+1 We're currently not passing anything and this will make the card and so on more discoverable. Signed-off-by: Mark Brown <> Acked-by: Liam Girdwood <> 2011-02-18ASoC: Allow GPIO jack detection to be configured as a wake sourceMark Brown1-0/+8 Some systems wish to use jacks as wake sources. Provide a wake flag in the GPIO configuration which causes the driver to enable the IRQ as a wake source. Signed-off-by: Mark Brown <> Acked-by: Liam Girdwood <> 2011-02-11ASoC: Allow use sleeping gpio in soc-jackJarkko Nikula1-1/+1 It is safe to use sleeping gpio in snd_soc_jack_gpio_detect as it is not called from interrupt context. This avoids WARN_ON from __gpio_get_value if sleeping gpio is registered for jack. Signed-off-by: Jarkko Nikula <> Acked-by: Liam Girdwood <> Signed-off-by: Mark Brown <> 2011-02-09ASoC: add support for multiple jack typesVinod Koul1-0/+46 This patch adds soc-jack support for adding voltage zones and for detecting jack type Signed-off-by: Vinod Koul <> Signed-off-by: Harsha Priya <> Signed-off-by: Mark Brown <> 2010-12-06ASoC: Add trace events for jack detectionMark Brown1-0/+7 As jack detection can trigger DAPM and the latency in debouncing can create confusing windows in operation provide some trace events which will hopefully help in diagnostics. The soc-jack core traces all reports that it gets and the resulting notifications to upper layers. An event for jack IRQs is also provided for instrumentation of debounce, and used in the GPIO jack code. Signed-off-by: Mark Brown <> Acked-by: Liam Girdwood <> 2010-11-22ASoC: Do not include soc-dapm.hJarkko Nikula1-1/+0 There is no need to include soc-dapm.h since soc.h includes it. Signed-off-by: Jarkko Nikula <> Acked-by: Liam Girdwood <> Signed-off-by: Mark Brown <> 2010-11-15ASoC: Prevent system suspend while debouncing wakeup capable GPIO jacksMark Brown1-0/+4 If the device associated with a GPIO jack is wakeup capable then disable suspend while we're debouncing the jack so that we skip suspends that race with the jack. Note that currently the GPIO based jack has a CODEC associated with it which we're using right now. These jacks should be reparented against the card itself and this code adjusted. Signed-off-by: Mark Brown <> Acked-by: Liam Girdwood <> 2010-11-06ASoC: Decouple DAPM from CODECsLiam Girdwood1-3/+5 Decoupling Dynamic Audio Power Management (DAPM) from codec devices is required when developing ASoC further. Such as for other ASoC components to have DAPM widgets or when extending DAPM to handle cross-device paths. This patch decouples DAPM related variables from struct snd_soc_codec and moves them to new struct snd_soc_dapm_context that is used to encapsulate DAPM context of a device. ASoC core and API of DAPM functions are modified to use DAPM context instead of codec. This patch does not change current functionality and a large part of changes come because of structure and internal API changes. Core implementation is from Liam Girdwood <> with some minor core changes, codecs and machine driver conversions from Jarkko Nikula <>. Signed-off-by: Liam Girdwood <> Signed-off-by: Jarkko Nikula <> Cc: Nicolas Ferre <> Cc: Manuel Lauss <> Cc: Mike Frysinger <> Cc: Cliff Cai <> Cc: Kevin Hilman <> Cc: Ryan Mallon <> Cc: Timur Tabi <> Cc: Sascha Hauer <> Cc: Lars-Peter Clausen <> Cc: Arnaud Patard (Rtp) <> Cc: Wan ZongShun <> Cc: Eric Miao <> Cc: Jassi Brar <> Cc: Daniel Gloeckner <> Cc: Kuninori Morimoto <> Signed-off-by: Mark Brown <> 2010-11-03ASoC: Convert soc-jack code to use request_any_context_irq()Mark Brown1-5/+6 Allow the standard soc-jack GPIO based jack handling to handle the use of GPIOs which may sleep (such as those on GPIO expanders) by converting the code to use request_any_context_irq(). Signed-off-by: Mark Brown <> Acked-by: Liam Girdwood <> 2010-10-07ASoC: Use delayed work for debounce of GPIO based jacksMark Brown1-6/+5 Rather than block the workqueue by sleeping to do the debounce use delayed work to implement the debounce time. This should also means that we extend the debounce time on each new bounce, potentially allowing shorter debounce times for clean insertions. Signed-off-by: Mark Brown <> Acked-by: Jarkko Nikula <> Acked-by: Liam Girdwood <> 2010-08-12ASoC: multi-component - ASoC Multi-Component SupportLiam Girdwood1-5/+5 This patch extends the ASoC API to allow sound cards to have more than one CODEC and more than one platform DMA controller. This is achieved by dividing some current ASoC structures that contain both driver data and device data into structures that only either contain device data or driver data. i.e. struct snd_soc_codec ---> struct snd_soc_codec (device data) +-> struct snd_soc_codec_driver (driver data) struct snd_soc_platform ---> struct snd_soc_platform (device data) +-> struct snd_soc_platform_driver (driver data) struct snd_soc_dai ---> struct snd_soc_dai (device data) +-> struct snd_soc_dai_driver (driver data) struct snd_soc_device ---> deleted This now allows ASoC to be more tightly aligned with the Linux driver model and also means that every ASoC codec, platform and (platform) DAI is a kernel device. ASoC component private data is now stored as device private data. The ASoC sound card struct snd_soc_card has also been updated to store lists of it's components rather than a pointer to a codec and platform. The PCM runtime struct soc_pcm_runtime now has pointers to all its components. This patch adds DAPM support for ASoC multi-component and removes struct snd_soc_socdev from DAPM core. All DAPM calls are now made on a card, codec or runtime PCM level basis rather than using snd_soc_socdev. Other notable multi-component changes:- * Stream operations now de-reference less structures. * close_delayed work() now runs on a DAI basis rather than looping all DAIs in a card. * PM suspend()/resume() operations can now handle N CODECs and Platforms per sound card. * Added soc_bind_dai_link() to bind the component devices to the sound card. * Added soc_dai_link_probe() and soc_dai_link_remove() to probe and remove DAI link components. * sysfs entries can now be registered per component per card. * snd_soc_new_pcms() functionailty rolled into dai_link_probe(). * snd_soc_register_codec() now does all the codec list and mutex init. This patch changes the probe() and remove() of the CODEC drivers as follows:- o Make CODEC driver a platform driver o Moved all struct snd_soc_codec list, mutex, etc initialiasation to core. o Removed all static codec pointers (drivers now support > 1 codec dev) o snd_soc_register_pcms() now done by core. o snd_soc_register_dai() folded into snd_soc_register_codec(). CS4270 portions: Acked-by: Timur Tabi <> Some TLV320aic23 and Cirrus platform fixes. Signed-off-by: Ryan Mallon <> TI CODEC and OMAP fixes Signed-off-by: Peter Ujfalusi <> Signed-off-by: Janusz Krzysztofik <> Signed-off-by: Jarkko Nikula <> Samsung platform and misc fixes :- Signed-off-by: Chanwoo Choi <> Signed-off-by: Joonyoung Shim <> Signed-off-by: Kyungmin Park <> Reviewed-by: Jassi Brar <> Signed-off-by: Seungwhan Youn <> MPC8610 and PPC fixes. Signed-off-by: Timur Tabi <> i.MX fixes and some core fixes. Signed-off-by: Sascha Hauer <> J4740 platform fixes:- Signed-off-by: Lars-Peter Clausen <> CC: Tony Lindgren <> CC: Nicolas Ferre <> CC: Kevin Hilman <> CC: Sascha Hauer <> CC: Atsushi Nemoto <> CC: Kuninori Morimoto <> CC: Daniel Gloeckner <> CC: Manuel Lauss <> CC: Mike Frysinger <> CC: Arnaud Patard <> CC: Wan ZongShun <> Acked-by: Mark Brown <> Signed-off-by: Liam Girdwood <> 2010-04-23ASoC: Allow reporting of NULL jacksMark Brown1-3/+2 Follow the core jack implementation and allow reporting on the status of NULL jacks, avoiding the need to check in detection implementations. Signed-off-by: Mark Brown <> Acked-by: Liam Girdwood <> 2010-03-22ASoC: Add a notifier for jack status changesMark Brown1-0/+38 Some systems provide both mechanical and electrical detection of jack status changes. On such systems power savings can be achieved by only enabling the electrical detection methods when physical insertion has been detected. Begin supporting such systems by providing a notifier for jack status changes which can be used to trigger any reconfiguration. Signed-off-by: Mark Brown <> Acked-by: Liam Girdwood <> de'>-rw-r--r--sound/soc/pxa/mioa701_wm9713.c1
125 files changed, 0 insertions, 125 deletions
diff --git a/sound/soc/atmel/playpaq_wm8510.c b/sound/soc/atmel/playpaq_wm8510.c