Revert "acpi: typec: ucsi: Introduce a ->poll_cci method"
This reverts commit 012b98cdb5 which is
commit 976e7e9bdc7719a023a4ecccd2e3daec9ab20a40 upstream.
It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.
Bug: 161946584
Change-Id: I0443eda56cd99bd498b4026ebd12ff6c5936df27
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
committed by
Treehugger Robot
parent
575c996c3b
commit
888f3eb260
@@ -1330,7 +1330,7 @@ static int ucsi_reset_ppm(struct ucsi *ucsi)
|
||||
|
||||
mutex_lock(&ucsi->ppm_lock);
|
||||
|
||||
ret = ucsi->ops->poll_cci(ucsi, &cci);
|
||||
ret = ucsi->ops->read_cci(ucsi, &cci);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
|
||||
@@ -1348,7 +1348,7 @@ static int ucsi_reset_ppm(struct ucsi *ucsi)
|
||||
|
||||
tmo = jiffies + msecs_to_jiffies(UCSI_TIMEOUT_MS);
|
||||
do {
|
||||
ret = ucsi->ops->poll_cci(ucsi, &cci);
|
||||
ret = ucsi->ops->read_cci(ucsi, &cci);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
if (cci & UCSI_CCI_COMMAND_COMPLETE)
|
||||
@@ -1377,7 +1377,7 @@ static int ucsi_reset_ppm(struct ucsi *ucsi)
|
||||
/* Give the PPM time to process a reset before reading CCI */
|
||||
msleep(20);
|
||||
|
||||
ret = ucsi->ops->poll_cci(ucsi, &cci);
|
||||
ret = ucsi->ops->read_cci(ucsi, &cci);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
@@ -1913,8 +1913,8 @@ struct ucsi *ucsi_create(struct device *dev, const struct ucsi_operations *ops)
|
||||
struct ucsi *ucsi;
|
||||
|
||||
if (!ops ||
|
||||
!ops->read_version || !ops->read_cci || !ops->poll_cci ||
|
||||
!ops->read_message_in || !ops->sync_control || !ops->async_control)
|
||||
!ops->read_version || !ops->read_cci || !ops->read_message_in ||
|
||||
!ops->sync_control || !ops->async_control)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
ucsi = kzalloc(sizeof(*ucsi), GFP_KERNEL);
|
||||
|
||||
@@ -60,7 +60,6 @@ struct dentry;
|
||||
* struct ucsi_operations - UCSI I/O operations
|
||||
* @read_version: Read implemented UCSI version
|
||||
* @read_cci: Read CCI register
|
||||
* @poll_cci: Read CCI register while polling with notifications disabled
|
||||
* @read_message_in: Read message data from UCSI
|
||||
* @sync_control: Blocking control operation
|
||||
* @async_control: Non-blocking control operation
|
||||
@@ -75,7 +74,6 @@ struct dentry;
|
||||
struct ucsi_operations {
|
||||
int (*read_version)(struct ucsi *ucsi, u16 *version);
|
||||
int (*read_cci)(struct ucsi *ucsi, u32 *cci);
|
||||
int (*poll_cci)(struct ucsi *ucsi, u32 *cci);
|
||||
int (*read_message_in)(struct ucsi *ucsi, void *val, size_t val_len);
|
||||
int (*sync_control)(struct ucsi *ucsi, u64 command);
|
||||
int (*async_control)(struct ucsi *ucsi, u64 command);
|
||||
|
||||
@@ -59,24 +59,19 @@ static int ucsi_acpi_read_version(struct ucsi *ucsi, u16 *version)
|
||||
static int ucsi_acpi_read_cci(struct ucsi *ucsi, u32 *cci)
|
||||
{
|
||||
struct ucsi_acpi *ua = ucsi_get_drvdata(ucsi);
|
||||
int ret;
|
||||
|
||||
if (UCSI_COMMAND(ua->cmd) == UCSI_PPM_RESET) {
|
||||
ret = ucsi_acpi_dsm(ua, UCSI_DSM_FUNC_READ);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
memcpy(cci, ua->base + UCSI_CCI, sizeof(*cci));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ucsi_acpi_poll_cci(struct ucsi *ucsi, u32 *cci)
|
||||
{
|
||||
struct ucsi_acpi *ua = ucsi_get_drvdata(ucsi);
|
||||
int ret;
|
||||
|
||||
ret = ucsi_acpi_dsm(ua, UCSI_DSM_FUNC_READ);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return ucsi_acpi_read_cci(ucsi, cci);
|
||||
}
|
||||
|
||||
static int ucsi_acpi_read_message_in(struct ucsi *ucsi, void *val, size_t val_len)
|
||||
{
|
||||
struct ucsi_acpi *ua = ucsi_get_drvdata(ucsi);
|
||||
@@ -99,7 +94,6 @@ static int ucsi_acpi_async_control(struct ucsi *ucsi, u64 command)
|
||||
static const struct ucsi_operations ucsi_acpi_ops = {
|
||||
.read_version = ucsi_acpi_read_version,
|
||||
.read_cci = ucsi_acpi_read_cci,
|
||||
.poll_cci = ucsi_acpi_poll_cci,
|
||||
.read_message_in = ucsi_acpi_read_message_in,
|
||||
.sync_control = ucsi_sync_control_common,
|
||||
.async_control = ucsi_acpi_async_control
|
||||
@@ -151,7 +145,6 @@ static int ucsi_gram_sync_control(struct ucsi *ucsi, u64 command)
|
||||
static const struct ucsi_operations ucsi_gram_ops = {
|
||||
.read_version = ucsi_acpi_read_version,
|
||||
.read_cci = ucsi_acpi_read_cci,
|
||||
.poll_cci = ucsi_acpi_poll_cci,
|
||||
.read_message_in = ucsi_gram_read_message_in,
|
||||
.sync_control = ucsi_gram_sync_control,
|
||||
.async_control = ucsi_acpi_async_control
|
||||
|
||||
@@ -664,7 +664,6 @@ err_put:
|
||||
static const struct ucsi_operations ucsi_ccg_ops = {
|
||||
.read_version = ucsi_ccg_read_version,
|
||||
.read_cci = ucsi_ccg_read_cci,
|
||||
.poll_cci = ucsi_ccg_read_cci,
|
||||
.read_message_in = ucsi_ccg_read_message_in,
|
||||
.sync_control = ucsi_ccg_sync_control,
|
||||
.async_control = ucsi_ccg_async_control,
|
||||
|
||||
@@ -201,7 +201,6 @@ static void pmic_glink_ucsi_connector_status(struct ucsi_connector *con)
|
||||
static const struct ucsi_operations pmic_glink_ucsi_ops = {
|
||||
.read_version = pmic_glink_ucsi_read_version,
|
||||
.read_cci = pmic_glink_ucsi_read_cci,
|
||||
.poll_cci = pmic_glink_ucsi_read_cci,
|
||||
.read_message_in = pmic_glink_ucsi_read_message_in,
|
||||
.sync_control = ucsi_sync_control_common,
|
||||
.async_control = pmic_glink_ucsi_async_control,
|
||||
|
||||
@@ -424,7 +424,6 @@ static irqreturn_t ucsi_stm32g0_irq_handler(int irq, void *data)
|
||||
static const struct ucsi_operations ucsi_stm32g0_ops = {
|
||||
.read_version = ucsi_stm32g0_read_version,
|
||||
.read_cci = ucsi_stm32g0_read_cci,
|
||||
.poll_cci = ucsi_stm32g0_read_cci,
|
||||
.read_message_in = ucsi_stm32g0_read_message_in,
|
||||
.sync_control = ucsi_sync_control_common,
|
||||
.async_control = ucsi_stm32g0_async_control,
|
||||
|
||||
@@ -74,7 +74,6 @@ static int yoga_c630_ucsi_async_control(struct ucsi *ucsi, u64 command)
|
||||
const struct ucsi_operations yoga_c630_ucsi_ops = {
|
||||
.read_version = yoga_c630_ucsi_read_version,
|
||||
.read_cci = yoga_c630_ucsi_read_cci,
|
||||
.poll_cci = yoga_c630_ucsi_read_cci,
|
||||
.read_message_in = yoga_c630_ucsi_read_message_in,
|
||||
.sync_control = ucsi_sync_control_common,
|
||||
.async_control = yoga_c630_ucsi_async_control,
|
||||
|
||||
Reference in New Issue
Block a user