From patchwork Tue Nov 15 22:11:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 20611 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2968161wru; Tue, 15 Nov 2022 14:20:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf7InxTT4I3CCnhfok6DUSxrKm+SN5/VPUZtHrcCTMI4++Ovf9+OrCSY4adLVDrhl3SmN3h1 X-Received: by 2002:a17:90a:19cb:b0:205:fa0b:798c with SMTP id 11-20020a17090a19cb00b00205fa0b798cmr448721pjj.179.1668550801529; Tue, 15 Nov 2022 14:20:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668550801; cv=none; d=google.com; s=arc-20160816; b=M2OamFvltwt3aFY0UssxF4BHZiz6cid3UKE4kd8Zc4D9sPV+FnVxaivNRMeU2yMc3O Gepg69erF7YEUyCVGExegaGOMjMRRQX3mr4mJK7nlhlwwkA3KggAi7kvYGQPUDByD/HP +auiKkylIu6o088d6VJAasAMdYCyyiaq2Sc3PcpAMNqZpXWzOrOxzqaIxBR4fdmOtghU Qk7Pd+YFcGsYytGkwZaNCnvSdVUo8jru3W7UH9HBQRtS1/YgP1rkr1jCsL3DWgNNrcuB mrWTvB4vppkFRNmGuEH31rytuP2MPy/oEqHuZoL7S5k/Q99O/vS0+VK/DpEt/eSrl/DZ fI5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WMGCOoya80Yh9qZLv453WUxet4tv4AcyXFF/KHbcD0s=; b=vqFooagoV68DxaFCq9SILGO9/OWOBXPE/y7mFjGBForOUV8vFSBKviBloZ0kS83tqV NQu0Ht+y80zMal890R93CbFNgxxpXQjW8SiubifOBSfQbfoFxxzjiEDMCf5xvlcVT3aS GQL7M5OY4dL+YdwJ+beTz5j6Wkz4D0pODL67E+zdpXvVE67nrihq+fZuREq8FMvTvtP2 6XIS2YoydeXJaqDmDmebH84cXPtS/opB+ZLEyncfX1zCdkQVxipMykgC4F0Py/lsrFpx h/42ZlTf7KrWiBXD6JOF7toW21hlh/rvYGPQ/84XbsDHV10UCuXMqTvgXeUhV1n25rJF 7Jxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VrAItYOO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k7-20020a056a00134700b0056301324a24si14874965pfu.133.2022.11.15.14.19.48; Tue, 15 Nov 2022 14:20:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VrAItYOO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232040AbiKOWMF (ORCPT + 99 others); Tue, 15 Nov 2022 17:12:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231585AbiKOWLz (ORCPT ); Tue, 15 Nov 2022 17:11:55 -0500 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3AB1303F8; Tue, 15 Nov 2022 14:11:54 -0800 (PST) Received: by mail-pj1-x102e.google.com with SMTP id gw22so14757890pjb.3; Tue, 15 Nov 2022 14:11:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WMGCOoya80Yh9qZLv453WUxet4tv4AcyXFF/KHbcD0s=; b=VrAItYOOcUcnfIpE0RT5T8tL0J0dqo2B7Lv2zbYjRBB9Lp2rIr1gBiM1pvxGJXfr7m uZGO9agr4dNhf0wDT+REyzcNKZvxa7QHCmQ7AVM4yjedgQyes7LhCuAb6d9n9893Iqh9 oxgDnepdLbqaNUapW38UiqBxUxPVRv71V/YhvlI1i14PrEEPeWvpG6ng2czmvzcz+XmQ BuiU0h/wrrhqP8j0yLICy+5MdAEIJw6i4NcVUZ7vpJSEUUAoMBZDN1FuqAHFLuCPxbRi XmsFnQNHlrgruk9BBr0mW0L6ORbqkJBbREYdjTub/TGApQ6N617zuGoge5LzKh7oi0kO PyPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WMGCOoya80Yh9qZLv453WUxet4tv4AcyXFF/KHbcD0s=; b=waL4AohePqMYDmJRySDsHJWHHT9Zs0/9trK8qXsu8wi6Eigyx/2sKv/GGvjKHdV0v5 79bonWTIgSrW5/nUultdpsws47bw1R30jSPGK2nnZXJNPARGj+CX1NZSBYK8TO3VqW3W SrbPtSIhdH3TLAjN2kzyv1rN9hQCWbq336h38qMw54H94s8Y4tjuRbdlToeQkp/oZkxh s9HnbRIAhOGEpSeFqsZV9bEyLdr5zo3CbfeJk0vW9TvRF4iL2dnPkFSbXatrQVoiJ1/1 ZzoJDOpE+Od6PX5hF+hAGJi9GXO+1rHeKkqGdd7bTXWe0a43h/Owt/AJTMRbvZ9u3EH7 wz4Q== X-Gm-Message-State: ANoB5pl0ORYz6UefZGHyhfO83MW+bu5FMpHvY5TbJzA9LwXflQVrpvZs gaUEpIqIWJ8AGgvVm+UV43ThTq/98jk= X-Received: by 2002:a17:902:e741:b0:188:572c:b9c3 with SMTP id p1-20020a170902e74100b00188572cb9c3mr6162956plf.53.1668550314211; Tue, 15 Nov 2022 14:11:54 -0800 (PST) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:2d36:e9a0:170b:669f]) by smtp.gmail.com with ESMTPSA id y1-20020a17090264c100b00178b6ccc8a0sm10400038pli.51.2022.11.15.14.11.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 14:11:53 -0800 (PST) From: Dmitry Torokhov To: Mauro Carvalho Chehab Cc: Sylwester Nawrocki , Andrzej Hajda , Linus Walleij , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 3/4] media: i2c: s5c73m3: remove support for platform data Date: Tue, 15 Nov 2022 14:11:44 -0800 Message-Id: <20221115221145.2550572-3-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog In-Reply-To: <20221115221145.2550572-1-dmitry.torokhov@gmail.com> References: <20221115221145.2550572-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749602325413431550?= X-GMAIL-MSGID: =?utf-8?q?1749602325413431550?= There are no existing users of s5c73m3_platform_data in the tree, and new users shoudl either be using device tree, ACPI, or static device properties, so let's remove it from the driver. Reviewed-by: Linus Walleij Signed-off-by: Dmitry Torokhov Reviewed-by: Tommaso Merciai --- drivers/media/i2c/s5c73m3/s5c73m3-core.c | 19 ++------ drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c | 2 - drivers/media/i2c/s5c73m3/s5c73m3.h | 6 ++- include/media/i2c/s5c73m3.h | 56 ----------------------- 4 files changed, 9 insertions(+), 74 deletions(-) delete mode 100644 include/media/i2c/s5c73m3.h diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-core.c b/drivers/media/i2c/s5c73m3/s5c73m3-core.c index d96ba58ce1e5..561c1a1583ac 100644 --- a/drivers/media/i2c/s5c73m3/s5c73m3-core.c +++ b/drivers/media/i2c/s5c73m3/s5c73m3-core.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include "s5c73m3.h" @@ -1592,26 +1591,16 @@ static int s5c73m3_parse_gpios(struct s5c73m3 *state) return 0; } -static int s5c73m3_get_platform_data(struct s5c73m3 *state) +static int s5c73m3_get_dt_data(struct s5c73m3 *state) { struct device *dev = &state->i2c_client->dev; - const struct s5c73m3_platform_data *pdata = dev->platform_data; struct device_node *node = dev->of_node; struct device_node *node_ep; struct v4l2_fwnode_endpoint ep = { .bus_type = 0 }; int ret; - if (!node) { - if (!pdata) { - dev_err(dev, "Platform data not specified\n"); - return -EINVAL; - } - - state->mclk_frequency = pdata->mclk_frequency; - state->gpio[STBY] = pdata->gpio_stby; - state->gpio[RSET] = pdata->gpio_reset; - return 0; - } + if (!node) + return -EINVAL; state->clock = devm_clk_get(dev, S5C73M3_CLK_NAME); if (IS_ERR(state->clock)) @@ -1666,7 +1655,7 @@ static int s5c73m3_probe(struct i2c_client *client) return -ENOMEM; state->i2c_client = client; - ret = s5c73m3_get_platform_data(state); + ret = s5c73m3_get_dt_data(state); if (ret < 0) return ret; diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c b/drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c index 141ad0ba7f5a..1c8103670fa2 100644 --- a/drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c +++ b/drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -24,7 +23,6 @@ #include #include #include -#include #include "s5c73m3.h" diff --git a/drivers/media/i2c/s5c73m3/s5c73m3.h b/drivers/media/i2c/s5c73m3/s5c73m3.h index c3fcfdd3ea66..d68528898249 100644 --- a/drivers/media/i2c/s5c73m3/s5c73m3.h +++ b/drivers/media/i2c/s5c73m3/s5c73m3.h @@ -15,7 +15,6 @@ #include #include #include -#include #define DRIVER_NAME "S5C73M3" @@ -357,6 +356,11 @@ enum s5c73m3_gpio_id { GPIO_NUM, }; +struct s5c73m3_gpio { + int gpio; + int level; +}; + enum s5c73m3_resolution_types { RES_ISP, RES_JPEG, diff --git a/include/media/i2c/s5c73m3.h b/include/media/i2c/s5c73m3.h deleted file mode 100644 index a51f1025ba1c..000000000000 --- a/include/media/i2c/s5c73m3.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Samsung LSI S5C73M3 8M pixel camera driver - * - * Copyright (C) 2012, Samsung Electronics, Co., Ltd. - * Sylwester Nawrocki - * Andrzej Hajda - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - */ -#ifndef MEDIA_S5C73M3__ -#define MEDIA_S5C73M3__ - -#include -#include - -/** - * struct s5c73m3_gpio - data structure describing a GPIO - * @gpio: GPIO number - * @level: indicates active state of the @gpio - */ -struct s5c73m3_gpio { - int gpio; - int level; -}; - -/** - * struct s5c73m3_platform_data - s5c73m3 driver platform data - * @mclk_frequency: sensor's master clock frequency in Hz - * @gpio_reset: GPIO driving RESET pin - * @gpio_stby: GPIO driving STBY pin - * @bus_type: bus type - * @nlanes: maximum number of MIPI-CSI lanes used - * @horiz_flip: default horizontal image flip value, non zero to enable - * @vert_flip: default vertical image flip value, non zero to enable - */ - -struct s5c73m3_platform_data { - unsigned long mclk_frequency; - - struct s5c73m3_gpio gpio_reset; - struct s5c73m3_gpio gpio_stby; - - enum v4l2_mbus_type bus_type; - u8 nlanes; - u8 horiz_flip; - u8 vert_flip; -}; - -#endif /* MEDIA_S5C73M3__ */