Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a0be37c9 authored by Marvin Ramin's avatar Marvin Ramin Committed by Automerger Merge Worker
Browse files

Add TV CEC HAL v1.1 am: 6501ff3b

Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/13447826

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I42d4f8a5eac7934dc24899f6319a89571c482cc6
parents b5733ba4 6501ff3b
Loading
Loading
Loading
Loading

tv/cec/1.1/Android.bp

0 → 100644
+16 −0
Original line number Diff line number Diff line
// This file is autogenerated by hidl-gen -Landroidbp.

hidl_interface {
    name: "android.hardware.tv.cec@1.1",
    root: "android.hardware",
    srcs: [
        "types.hal",
        "IHdmiCec.hal",
        "IHdmiCecCallback.hal",
    ],
    interfaces: [
        "android.hardware.tv.cec@1.0",
        "android.hidl.base@1.0",
    ],
    gen_java: true,
}
+70 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.hardware.tv.cec@1.1;

import @1.0::IHdmiCec;
import @1.0::Result;
import @1.0::SendMessageResult;

import IHdmiCecCallback;

/**
 * HDMI-CEC HAL interface definition.
 */
interface IHdmiCec extends @1.0::IHdmiCec {
    /**
     * Passes the logical address that must be used in this system.
     *
     * HAL must use it to configure the hardware so that the CEC commands
     * addressed the given logical address can be filtered in. This method must
     * be able to be called as many times as necessary in order to support
     * multiple logical devices.
     *
     * @param addr Logical address that must be used in this system. It must be
     *        in the range of valid logical addresses for the call to succeed.
     * @return result Result status of the operation. SUCCESS if successful,
     *         FAILURE_INVALID_ARGS if the given logical address is invalid,
     *         FAILURE_BUSY if device or resource is busy
     */
    addLogicalAddress_1_1(CecLogicalAddress addr) generates (Result result);

    /**
     * Transmits HDMI-CEC message to other HDMI device.
     *
     * The method must be designed to return in a certain amount of time and not
     * hanging forever which may happen if CEC signal line is pulled low for
     * some reason.
     *
     * It must try retransmission at least once as specified in the section '7.1
     * Frame Re-transmissions' of the CEC Spec 1.4b.
     *
     * @param message CEC message to be sent to other HDMI device.
     * @return result Result status of the operation. SUCCESS if successful,
     *         NACK if the sent message is not acknowledged,
     *         BUSY if the CEC bus is busy.
     */
    sendMessage_1_1(CecMessage message) generates (SendMessageResult result);

    /**
     * Sets a callback that HDMI-CEC HAL must later use for incoming CEC
     * messages or internal HDMI events.
     *
     * @param callback Callback object to pass hdmi events to the system. The
     *        previously registered callback must be replaced with this one.
     */
    setCallback_1_1(IHdmiCecCallback callback);
};
+30 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.hardware.tv.cec@1.1;

import @1.0::IHdmiCecCallback;

/**
 * Callbacks from the HAL implementation to notify the system of new events.
 */
interface IHdmiCecCallback extends @1.0::IHdmiCecCallback {
    /**
     * The callback function that must be called by HAL implementation to notify
     * the system of new CEC message arrival.
     */
    oneway onCecMessage_1_1(CecMessage message);
};

tv/cec/1.1/types.hal

0 → 100644
+45 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.hardware.tv.cec@1.1;

import @1.0::CecLogicalAddress;
import @1.0::CecMessageType;

enum CecLogicalAddress : @1.0::CecLogicalAddress {
    BACKUP_1 = 12,
    BACKUP_2 = 13,
};

enum CecMessageType : @1.0::CecMessageType {
    GIVE_FEATURES = 0xA5,
    REPORT_FEATURES = 0xA6,
    REQUEST_CURRENT_LATENCY = 0xA7,
    REPORT_CURRENT_LATENCY = 0xA8,
};

struct CecMessage {
    /** logical address of the initiator */
    CecLogicalAddress initiator;

    /** logical address of destination */
    CecLogicalAddress destination;

    /**
     * The maximum size of body is 15 (MaxLength::MESSAGE_BODY) as specified in
     * the section 6 of the CEC Spec 1.4b. Overflowed data must be ignored. */
    vec<uint8_t> body;
};