I have made a small enhancement to the speedfreq initscript (/etc/init.d/speedfreq) and config file (/etc/conf.d/speedfreq) that determines the status of the AC adapter when speedfreq is started with the initscript. It will then call a user-created script, specified in /etc/conf.d/speedfreq, which is an ACPI ac_adapter event handler that can be used, for example, to set the speedfreq policy based on the status of the AC adapter. This is useful for me and I hope it seems useful to you.
Created attachment 37228 [details] Modified speedfreq initscript For speedfreq 0.7.2-r1
Created attachment 37229 [details] Modified speedfreq config file For speedfreq 0.7.2-r1
Created attachment 37230 [details] ACPI ac_adapter event handler script For acpid-1.0.2-r2
Bug #70163 contains similar, an acpid event will call the update funtion of the speedfreq init script which in turn adjusts the frequency to user defined values. Maybe you like to test it, I'd appreciate some test reports (to verify it doesn't only work on my system).
sys-power/speedfreq is deprecated in favor of sys-power/cpufreqd due to unresolved bugs and lack of upstream activity. If you would like to see this fixed, please contact upstream.