Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4534073imm; Mon, 17 Sep 2018 16:02:01 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZpRhXogFbP9vMXqYSIxXcT8oDZ/HtEb96u3Qv5v1lPZp0KAlHrVbMdieQagMKHmL3t5QNh X-Received: by 2002:a63:d613:: with SMTP id q19-v6mr25457529pgg.327.1537225321782; Mon, 17 Sep 2018 16:02:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537225321; cv=none; d=google.com; s=arc-20160816; b=k6lAtB7sqBZUH5lc0HJhcqso+JIBpA8yQiFP8de7s2klz4iTD5+vUuUGpLS7nU5LFV V739gzl8/0EltoR0F0JgJYztp3WiB6b5Pq8g11oJPdbbZ3umTrM7fb8T17IblmoQhpyM rgpIKHnNNBRkqonM0gZyrnkjYnKNGjqJ04TXmChTK5Z+vfI39NhlH88X9tsgaUOwpdjG 4v00c3pbgjCco9b1OAS3NixNSpmjx2qKZ/KDzabTTY+HA+Yr067gI3kiavQFUnanImaG iV98JgH6WeT2o+EyVBxX6JSINFhcOErLxwfV8v3e4nunrVZt5YhtsaF1DqqjNk0y62Sm TKiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=AYCZC7qdNv/I2UD7nQmOdMu0ooMyXvwfJWpQeo2SEVA=; b=zq5q7weKneKmzzh4vpm6dryZlYZ3tUs3xn/W60vVMUJHMEZvIKjwNgIi2qQL3QoWut csR4vlf1MCuSwi1Ywo9aU7/wqrc1JYHuOnddraxeprxNcVC/WQyTJaf2YYcRhLWTToLn 4AUsMYZ8V4wMCT3uS766eC89UamEUGrp3lepvhkKAmrJP0iILoz70KqYVQxtYjEefMo2 vsJhj6JO0b7jlqEAG7QuUUzBlja05f0akgAihs8W6QeEBkj9FkKQphNIuGdrSVymNoau MvsmlzcaljjmxF3NDVypgrHXXBjed473pCsIHnh0iKki6jwmtVA5QvUrRyDd9/jOIc8Q fZlg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f9-v6si16413376pgi.12.2018.09.17.16.01.46; Mon, 17 Sep 2018 16:02:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730206AbeIREaz (ORCPT + 99 others); Tue, 18 Sep 2018 00:30:55 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48286 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727088AbeIREaz (ORCPT ); Tue, 18 Sep 2018 00:30:55 -0400 Received: from localhost (li1825-44.members.linode.com [172.104.248.44]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C44C0C77; Mon, 17 Sep 2018 23:01:26 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Todor Tomov , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.14 036/126] media: camss: csid: Configure data type and decode format properly Date: Tue, 18 Sep 2018 00:41:24 +0200 Message-Id: <20180917211707.140164724@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180917211703.481236999@linuxfoundation.org> References: <20180917211703.481236999@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Todor Tomov [ Upstream commit c628e78899ff8006b5f9d8206da54ed3bb994342 ] The CSID decodes the input data stream. When the input comes from the Test Generator the format of the stream is set on the source media pad. When the input comes from the CSIPHY the format is the one on the sink media pad. Use the proper format for each case. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/media/platform/qcom/camss-8x16/camss-csid.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) --- a/drivers/media/platform/qcom/camss-8x16/camss-csid.c +++ b/drivers/media/platform/qcom/camss-8x16/camss-csid.c @@ -392,9 +392,6 @@ static int csid_set_stream(struct v4l2_s !media_entity_remote_pad(&csid->pads[MSM_CSID_PAD_SINK])) return -ENOLINK; - dt = csid_get_fmt_entry(csid->fmt[MSM_CSID_PAD_SRC].code)-> - data_type; - if (tg->enabled) { /* Config Test Generator */ struct v4l2_mbus_framefmt *f = @@ -416,6 +413,9 @@ static int csid_set_stream(struct v4l2_s writel_relaxed(val, csid->base + CAMSS_CSID_TG_DT_n_CGG_0(0)); + dt = csid_get_fmt_entry( + csid->fmt[MSM_CSID_PAD_SRC].code)->data_type; + /* 5:0 data type */ val = dt; writel_relaxed(val, csid->base + @@ -425,6 +425,9 @@ static int csid_set_stream(struct v4l2_s val = tg->payload_mode; writel_relaxed(val, csid->base + CAMSS_CSID_TG_DT_n_CGG_2(0)); + + df = csid_get_fmt_entry( + csid->fmt[MSM_CSID_PAD_SRC].code)->decode_format; } else { struct csid_phy_config *phy = &csid->phy; @@ -439,13 +442,16 @@ static int csid_set_stream(struct v4l2_s writel_relaxed(val, csid->base + CAMSS_CSID_CORE_CTRL_1); + + dt = csid_get_fmt_entry( + csid->fmt[MSM_CSID_PAD_SINK].code)->data_type; + df = csid_get_fmt_entry( + csid->fmt[MSM_CSID_PAD_SINK].code)->decode_format; } /* Config LUT */ dt_shift = (cid % 4) * 8; - df = csid_get_fmt_entry(csid->fmt[MSM_CSID_PAD_SINK].code)-> - decode_format; val = readl_relaxed(csid->base + CAMSS_CSID_CID_LUT_VC_n(vc)); val &= ~(0xff << dt_shift);