From patchwork Fri Apr 5 14:14:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Anikiel?= X-Patchwork-Id: 786636 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 27AC216F91D for ; Fri, 5 Apr 2024 14:15:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712326524; cv=none; b=dzwwZQ0R/E6dJ4IuI8IifBEXlXBmGgnVlknBkOb5vBexLJVSl3u67NtucTjwXuc0Ya+OtqOmm2XgzpeF1xW9ulN10blEt68zl08fIEcbQ+4/vkWXDVuIXdXhn6fWDIHgXPNe/40h24hEf40/KFdJRRqyLDPMtwACpbkg6mo9BMs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712326524; c=relaxed/simple; bh=5xnfmi2lBhW03BQCHOlNVYiVElPi3SW0dm8sNuaFNl0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Adh0HrH7QlawJRv1nm8MF6zZ5reTQmoC9wbN/EbLUsfif1iyAVbfPah1r3xRtrzCl+yXU6EPHxNcnLCaJlKo58I5F5PMZ2IFp6vVBm8Vq0+MmoBnIafMtHNWp/CyY+ujJc92WYsQTH6yMcT6WvJ02kVG4QJTg7nITc132+autAQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--panikiel.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Se8eeWoI; arc=none smtp.client-ip=209.85.128.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--panikiel.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Se8eeWoI" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-4162ba19021so7695435e9.2 for ; Fri, 05 Apr 2024 07:15:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712326521; x=1712931321; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=lsbtTl/lsCYzP7KPwMVeecq4kI9jqfdKIXhI66el1Xk=; b=Se8eeWoI87xA6B53PvKAoBuk0DYolqT2e1Ct54thzg3XTtLGnTP4W2FwOgw3aEFvRk +nd96GDpkFmuWkZUfM8MnDtuOGHXUDuxR9vRaWo90ymQieOMRCxt2C9av8rMurmmbk77 PKKwGuDg1CUJbaNBDn318EUehdXAIuAhD82z+XO+REcaXwt3klGypAHKpgf5GHdVrYUy 260/EMVDCKqGFuNjRvSXM1wqWq5C2UtZ3RZbIAnHP57jsYtLD/djIfSk8gpjtY+tSTj4 s51Toj9fc0q4fNeqm1RAz7DNYEBwm2d431+wFrUpBZevBIxOU5LZ3FnM4xgi2rIwfcup KM2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712326521; x=1712931321; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=lsbtTl/lsCYzP7KPwMVeecq4kI9jqfdKIXhI66el1Xk=; b=iL/c3K6+sE2U7x5v/51aBNLHw2yDrVqlkAYUGZcje6BVQB0KCpehsJEVfGDUPvTpzV pxFiwBQ3LmS69RI4Wi+VwduU8Pddu3zFiGzCzOV2HUiZW7qiz1XYt11b39B0hVr/p7GG 48I/0Dn1VJZxYxLFkV5DTCv08Ohaz8vztrzqMXIhHIlUx5yb67a/NFKrkhh7g2i2Pzto sBEB/0ckkXWWDrCuLyXJsxLds02xvSKj/tr/46zQ+NCh9Vgv3X7ZTYD6edeakPgT65bB HxZNAbQbFa8V+XZnsZHgq8N1OXwxQdzDJj1cZESrRZRbOaysAT+En0ODQnaPC6rMsMq2 vV/w== X-Gm-Message-State: AOJu0YwMYD2HzjH79M0Nnd/uO/r8FD7Zem6HLca7N7U9IZUgBNaHWo9n wQYsmLgkTWy/EnKzwT+TnQOqeokjy+DTIH0ltaTDJ/zAe8MKF0vJzVZuFAs7yJmjJzjq9p8WjtO tfVH6je9WJA== X-Google-Smtp-Source: AGHT+IH7z/NIPYYuKTmisFXZIC5ABdbzSu5MmdtE9zAPHxlH0uA6LOlXz/68FujAlmVAv7FZ/1iKrTnqtbILTg== X-Received: from szatan.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:2d83]) (user=panikiel job=sendgmr) by 2002:a05:600c:3b08:b0:414:76ce:98fe with SMTP id m8-20020a05600c3b0800b0041476ce98femr4860wms.5.1712326521624; Fri, 05 Apr 2024 07:15:21 -0700 (PDT) Date: Fri, 5 Apr 2024 14:14:05 +0000 In-Reply-To: <20240405141411.1807189-1-panikiel@google.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240405141411.1807189-1-panikiel@google.com> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog Message-ID: <20240405141411.1807189-11-panikiel@google.com> Subject: [PATCH 10/16] media: i2c: tvp7002: Switch dv timing callbacks to pad ops From: " =?utf-8?q?Pawe=C5=82_Anikiel?= " To: kieran.bingham@ideasonboard.com, mchehab@kernel.org, hverkuil-cisco@xs4all.nl, tharvey@gateworks.com, niklas.soderlund@ragnatech.se, prabhakar.csengg@gmail.com, charles-antoine.couret@nexvision.fr, thierry.reding@gmail.com, jonathanh@nvidia.com, skomatineni@nvidia.com, luca.ceresoli@bootlin.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, chromeos-krk-upstreaming@google.com, " =?utf-8?q?Pawe=C5=82_Anikiel?= " Change all (s|g|query)_dv_timings subdev callbacks to include a pad argument. Signed-off-by: Paweł Anikiel --- drivers/media/i2c/tvp7002.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c index 6a04ffae5343..881b54f46d41 100644 --- a/drivers/media/i2c/tvp7002.c +++ b/drivers/media/i2c/tvp7002.c @@ -546,13 +546,16 @@ static int tvp7002_write_inittab(struct v4l2_subdev *sd, return error; } -static int tvp7002_s_dv_timings(struct v4l2_subdev *sd, +static int tvp7002_s_dv_timings(struct v4l2_subdev *sd, unsigned int pad, struct v4l2_dv_timings *dv_timings) { struct tvp7002 *device = to_tvp7002(sd); const struct v4l2_bt_timings *bt = &dv_timings->bt; int i; + if (pad != 0) + return -EINVAL; + if (dv_timings->type != V4L2_DV_BT_656_1120) return -EINVAL; for (i = 0; i < NUM_TIMINGS; i++) { @@ -566,11 +569,14 @@ static int tvp7002_s_dv_timings(struct v4l2_subdev *sd, return -EINVAL; } -static int tvp7002_g_dv_timings(struct v4l2_subdev *sd, +static int tvp7002_g_dv_timings(struct v4l2_subdev *sd, unsigned int pad, struct v4l2_dv_timings *dv_timings) { struct tvp7002 *device = to_tvp7002(sd); + if (pad != 0) + return -EINVAL; + *dv_timings = device->current_timings->timings; return 0; } @@ -659,12 +665,16 @@ static int tvp7002_query_dv(struct v4l2_subdev *sd, int *index) return 0; } -static int tvp7002_query_dv_timings(struct v4l2_subdev *sd, +static int tvp7002_query_dv_timings(struct v4l2_subdev *sd, unsigned int pad, struct v4l2_dv_timings *timings) { int index; - int err = tvp7002_query_dv(sd, &index); + int err; + + if (pad != 0) + return -EINVAL; + err = tvp7002_query_dv(sd, &index); if (err) return err; *timings = tvp7002_timings[index].timings; @@ -861,9 +871,6 @@ static const struct v4l2_subdev_core_ops tvp7002_core_ops = { /* Specific video subsystem operation handlers */ static const struct v4l2_subdev_video_ops tvp7002_video_ops = { - .g_dv_timings = tvp7002_g_dv_timings, - .s_dv_timings = tvp7002_s_dv_timings, - .query_dv_timings = tvp7002_query_dv_timings, .s_stream = tvp7002_s_stream, }; @@ -872,6 +879,9 @@ static const struct v4l2_subdev_pad_ops tvp7002_pad_ops = { .enum_mbus_code = tvp7002_enum_mbus_code, .get_fmt = tvp7002_get_pad_format, .set_fmt = tvp7002_set_pad_format, + .g_dv_timings = tvp7002_g_dv_timings, + .s_dv_timings = tvp7002_s_dv_timings, + .query_dv_timings = tvp7002_query_dv_timings, .enum_dv_timings = tvp7002_enum_dv_timings, }; @@ -1001,7 +1011,7 @@ static int tvp7002_probe(struct i2c_client *c) /* Set registers according to default video mode */ timings = device->current_timings->timings; - error = tvp7002_s_dv_timings(sd, &timings); + error = tvp7002_s_dv_timings(sd, 0, &timings); #if defined(CONFIG_MEDIA_CONTROLLER) device->pad.flags = MEDIA_PAD_FL_SOURCE;