From: Lars Op den Kamp <lars@opdenkamp.eu>
To: Hans Verkuil <hverkuil@xs4all.nl>,
Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCHv2 3/5] pulse8-cec: new driver for the Pulse-Eight USB-CEC Adapter
Date: Mon, 11 Jul 2016 12:17:15 +0200 [thread overview]
Message-ID: <5783722B.1080107@opdenkamp.eu> (raw)
In-Reply-To: <8e011716-5d38-3475-ff87-1737b331e26c@xs4all.nl>
Hi Hans,
On 11-07-16 12:02, Hans Verkuil wrote:
> Hi Lars,
>
> On 07/11/2016 11:41 AM, Lars Op den Kamp wrote:
>> Hi Hans,
>>
>> just did a quick scan of this patch.
>>
>> The code should work on any firmware >= v2 revision 8, though older
>> versions may return 0 when the build date is requested. I believe I
>> added that in v3. Might want to add a !=0 check before writing to the log.
>>
>> The CEC adapter has an "autonomous mode", used when it's not being
>> controlled by our userspace application or this kernel driver. It'll
>> respond to some basic CEC commands that allow the PC to be woken up by TV.
>> If the adapter doesn't receive a MSGCODE_PING for 30 seconds when it's
>> in "controlled mode", then it'll revert to autonomous mode and it'll
>> reset all states internally.
> Ah, that was rather obscure. Good to know.
>
> What I do now (and that seems to work) is that in the pulse8_setup I turn
> off the autonomous mode and then write that new setting to the EEPROM. After
> that it looks like the autonomous mode stays off. Is that correct?
Correct, that'll work too, but I suggest you don't do that and update
the eeprom values like we do in userspace. That'll allow the adapter to
wake up the PC when the kernel module isn't running. Disabling
autonomous mode will prevent that from working. You can only write to
the eeprom once every 10 seconds by the way.
>
> The autonomous mode really doesn't work well with the framework as it is
> today.
>
> CEC framework support for 'wakeup on CEC command' is something that is planned
> for the future.
The autonomous mode is only really meant for waking up the PC, from S3
with the USB version and all modes with the internal version for Intel
boards. It should be disabled as long as the userspace application or
kernel module is running, by sending MSGCODE_SET_CONTROLLED 1 and then
send a poll before the 30 second timeout times out. Then, when the
kernel module stops using the module, when the system powers off or goes
to standby, you send a MSGCODE_SET_CONTROLLED 0 and then close the
connection. The adapter will then take over, allowing the TV to wake up
the PC again.
thanks, Lars
next prev parent reply other threads:[~2016-07-11 10:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-11 8:54 [PATCHv2 3/5] pulse8-cec: new driver for the Pulse-Eight USB-CEC Adapter Hans Verkuil
2016-07-11 9:41 ` Lars Op den Kamp
2016-07-11 10:02 ` Hans Verkuil
2016-07-11 10:17 ` Lars Op den Kamp [this message]
2016-07-12 9:34 ` Hans Verkuil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5783722B.1080107@opdenkamp.eu \
--to=lars@opdenkamp.eu \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.