27 Jun, 2019

2 commits

  • In order to support multiple CEC devices for an HDMI connector,
    and to support cec_connector_info, drivers should use either a
    cec_notifier_conn_(un)register pair of functions (HDMI drivers)
    or a cec_notifier_cec_adap_(un)register pair (CEC adapter drivers).

    This replaces cec_notifier_get_conn/cec_notifier_put.

    For CEC adapters it is also no longer needed to call cec_notifier_register,
    cec_register_cec_notifier and cec_notifier_unregister. This is now
    all handled internally by the new functions.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • Define struct cec_connector_info in media/cec.h and define
    CEC_CAP_CONNECTOR_INFO. In a later patch this will be moved to
    uapi/linux/cec.h.

    The CEC_CAP_CONNECTOR_INFO capability can be set by drivers, but
    cec_allocate_adapter() will remove it again until the public API
    for this can be enabled once all drm drivers wire this up correctly.

    Also add the cec_fill_conn_info_from_drm and cec_s_conn_info functions,
    which are needed by drm drivers to fill in the cec_connector info
    based on a drm_connector.

    The cec_notifier_(un)register and cec_register_cec_notifier
    prototypes were moved from cec-notifier.h to cec.h since cec.h no longer
    includes cec-notifier.h. These headers included each other before,
    which caused various problems.

    Due to these changes the seco-cec driver was changed as well: it
    should include cec-notifier.h, not cec.h.

    Signed-off-by: Dariusz Marcinkiewicz
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Dariusz Marcinkiewicz
     

23 Apr, 2019

1 commit

  • Add helper function to parse the DT for the hdmi-phandle property
    and return the corresponding struct device pointer.

    It takes care to avoid increasing the device refcount since all
    we need is the device pointer. This pointer is used in the
    notifier list as a key, but it is never accessed by the CEC driver.

    Signed-off-by: Hans Verkuil
    Reported-by: Wen Yang
    Acked-by: Wen Yang
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

13 Jul, 2018

1 commit

  • In non device-tree world, we can need to get the notifier by the driver
    name directly and eventually defer probe if not yet created.

    This patch adds a variant of the get function by using the device name
    instead and will not create a notifier if not yet created.

    But the i915 driver exposes at least 2 HDMI connectors, this patch also
    adds the possibility to add a connector name tied to the notifier device
    to form a tuple and associate different CEC controllers for each HDMI
    connectors.

    Signed-off-by: Neil Armstrong
    Reviewed-by: Hans Verkuil
    Signed-off-by: Lee Jones

    Neil Armstrong
     

15 Feb, 2018

1 commit


08 Aug, 2017

1 commit

  • Linux 4.13-rc4

    * tag 'v4.13-rc4': (863 commits)
    Linux 4.13-rc4
    Fix compat_sys_sigpending breakage
    ext4: fix copy paste error in ext4_swap_extents()
    ext4: fix overflow caused by missing cast in ext4_resize_fs()
    ext4, project: expand inode extra size if possible
    ext4: cleanup ext4_expand_extra_isize_ea()
    ext4: restructure ext4_expand_extra_isize
    ext4: fix forgetten xattr lock protection in ext4_expand_extra_isize
    ext4: make xattr inode reads faster
    ext4: inplace xattr block update fails to deduplicate blocks
    ext4: remove unused mode parameter
    ext4: fix warning about stack corruption
    ext4: fix dir_nlink behaviour
    ext4: silence array overflow warning
    ext4: fix SEEK_HOLE/SEEK_DATA for blocksize < pagesize
    platform/x86: intel-vbtn: match power button on press rather than release
    ext4: release discard bio after sending discard commands
    sparc64: Fix exception handling in UltraSPARC-III memcpy.
    arm64: avoid overflow in VA_START and PAGE_OFFSET
    arm64: Fix potential race with hardware DBM in ptep_set_access_flags()
    ...

    Mauro Carvalho Chehab
     

26 Jul, 2017

1 commit

  • Allow calling cec_notifier_set_phys_addr and
    cec_notifier_set_phys_addr_from_edid with a NULL notifier, in which
    case these functions do nothing.

    Add a cec_notifier_phys_addr_invalidate helper function (the notifier
    equivalent of cec_phys_addr_invalidate).

    These changes simplify drm CEC driver support.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

19 Jul, 2017

1 commit

  • The cec_register_cec_notifier function was in media/cec.h, but it
    has to be in cec-notifier.h.

    While we are at it, also document it and add a stub function for when
    the notifier is disabled or the CEC core code is unreachable.

    Based on an earlier patch from Jose Abreu .

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

07 Jun, 2017

1 commit

  • media fixes for v4.12-rc4

    * tag 'media/v4.12-2': (598 commits)
    [media] rc-core: race condition during ir_raw_event_register()
    [media] cec: drop MEDIA_CEC_DEBUG
    [media] cec: rename MEDIA_CEC_NOTIFIER to CEC_NOTIFIER
    [media] cec: select CEC_CORE instead of depend on it
    [media] rainshadow-cec: ensure exit_loop is intialized
    [media] atomisp: don't treat warnings as errors
    Linux 4.12-rc3
    x86/ftrace: Make sure that ftrace trampolines are not RWX
    x86/mm/ftrace: Do not bug in early boot on irqs_disabled in cpu_flush_range()
    selftests/ftrace: Add a testcase for many kprobe events
    kprobes/x86: Fix to set RWX bits correctly before releasing trampoline
    ftrace: Fix memory leak in ftrace_graph_release()
    ipv4: add reference counting to metrics
    net: ethernet: ax88796: don't call free_irq without request_irq first
    ip6_tunnel, ip6_gre: fix setting of DSCP on encapsulated packets
    sctp: fix ICMP processing if skb is non-linear
    net: llc: add lock_sock in llc_ui_bind to avoid a race condition
    PCI/msi: fix the pci_alloc_irq_vectors_affinity stub
    blk-mq: Only register debugfs attributes for blk-mq queues
    x86/timers: Move simple_udelay_calibration past init_hypervisor_platform
    ...

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

05 Jun, 2017

1 commit


18 May, 2017

1 commit

  • Fix a link error in this specific combination of config options:

    CONFIG_MEDIA_CEC_SUPPORT=y
    CONFIG_CEC_CORE=m
    CONFIG_MEDIA_CEC_NOTIFIER=y
    CONFIG_VIDEO_STI_HDMI_CEC=m
    CONFIG_DRM_STI=y

    drivers/gpu/drm/sti/sti_hdmi.o: In function `sti_hdmi_remove':
    sti_hdmi.c:(.text.sti_hdmi_remove+0x10): undefined reference to
    `cec_notifier_set_phys_addr'
    sti_hdmi.c:(.text.sti_hdmi_remove+0x34): undefined reference to
    `cec_notifier_put'
    drivers/gpu/drm/sti/sti_hdmi.o: In function `sti_hdmi_connector_get_modes':
    sti_hdmi.c:(.text.sti_hdmi_connector_get_modes+0x4a): undefined
    reference to `cec_notifier_set_phys_addr_from_edid'
    drivers/gpu/drm/sti/sti_hdmi.o: In function `sti_hdmi_probe':
    sti_hdmi.c:(.text.sti_hdmi_probe+0x204): undefined reference to
    `cec_notifier_get'
    drivers/gpu/drm/sti/sti_hdmi.o: In function `sti_hdmi_connector_detect':
    sti_hdmi.c:(.text.sti_hdmi_connector_detect+0x36): undefined reference
    to `cec_notifier_set_phys_addr'
    drivers/gpu/drm/sti/sti_hdmi.o: In function `sti_hdmi_disable':
    sti_hdmi.c:(.text.sti_hdmi_disable+0xc0): undefined reference to
    `cec_notifier_set_phys_addr'

    The version below seems to work, though I don't particularly
    like the IS_REACHABLE() addition since that can be confusing
    to users.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Arnd Bergmann
     

19 Apr, 2017

1 commit


10 Apr, 2017

1 commit

  • Add support for CEC notifiers, which is used to convey CEC physical address
    information from video drivers to their CEC counterpart driver(s).

    Based on an earlier version from Russell King:

    https://patchwork.kernel.org/patch/9277043/

    The cec_notifier is a reference counted object containing the CEC physical address
    state of a video device.

    When a new notifier is registered the current state will be reported to
    that notifier at registration time.

    Signed-off-by: Hans Verkuil
    Tested-by: Marek Szyprowski
    Tested-by: Benjamin Gaignard
    Acked-by: Daniel Vetter
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil