Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp835804rdh; Thu, 26 Oct 2023 18:15:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtISAR/7UmzLsaivpj2ODrPx/06em1+r0KXIgKf+sNB3V3XXghJ9IOVhp8gpgjFa5f64fs X-Received: by 2002:a25:b201:0:b0:d9a:45d7:4eae with SMTP id i1-20020a25b201000000b00d9a45d74eaemr1229195ybj.62.1698369334256; Thu, 26 Oct 2023 18:15:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698369334; cv=none; d=google.com; s=arc-20160816; b=Q9UYLZtHWIav6rs4snXRkf33rhCvlyrU+GTMsvgSuZph9XIugs9tqAKoRGvDpJQsJ7 Eg2mjGgFiFNZXfGNp10Dpu2IDUmBQcMPe0cg/9ufia8pM0Co2CJIK62+FHf+eMRHFdVt l448Yqitm6frDZ1CqOycVSBAK383y7gXaeKyodSIWgVLWhn24B10IFVlXuIeMNnJLTJ4 hgPCQ9YGLYPbqZDKrkLals2OCHZscyRvaAsmbTfK0eza3waEQ39xxXVF5YaF+HWrj3Py h72JCdOPA0Xq9fMQ5BpJow+UYZjiE/GTl4WnUaXAm/G+C5+PRRKsHlqztR5OoTGVxXQm 1fFA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=tOl+Dqwsun7Z8ePkH8+O4Gfz6CxY1wT8Is0HMMKZh80=; fh=2hk1mHshaKd3SX7C6WR7M1wBaAulQaHZm8Xy44VClmg=; b=vTYlMy+hj9pY3/OcgGvp/nHEmH2mCZYVURi1Dmp4/lkR2AOdLwkEhhDv519WC9Jn01 gHsFBCHUCNTmGvxPcIOCWxuP+MiHjOA/bxiqqCFz3XgN3Mf0weHlI4+b65qvytMJtnZQ cVaydWeh5Zi+U/9MZvUYWr24LM6p5ynLr6Hh8WJibaiB4MTkAAYhvyfDFa5SyDjRTGhV 2E817WZvF5B+D+V1PE1DO0i0CwkbfYh7CWpTcmst+eF3gYKMlvEBxXeqmbtfVP1gE+9Y 3uUZ5NFCf09CRyil671nxbfUrd7GFSr8HjN71/2bm0CWCCIGbA1lQELvSzhbanigqkGU fUfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q+3GG61v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id 78-20020a250551000000b00da0c88823basi967491ybf.151.2023.10.26.18.15.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 18:15:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q+3GG61v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 3960982990D9; Thu, 26 Oct 2023 18:14:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345081AbjJ0BOZ (ORCPT + 99 others); Thu, 26 Oct 2023 21:14:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjJ0BOY (ORCPT ); Thu, 26 Oct 2023 21:14:24 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D04371BC; Thu, 26 Oct 2023 18:14:21 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F40FAC433CA; Fri, 27 Oct 2023 01:14:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698369261; bh=jyK9XMtPWsaT4FQrOBuiO6PcqdC1YHVnaagZqHZXO2k=; h=From:To:Cc:Subject:Date:From; b=q+3GG61vCp+3gEbDSZ/PtoSW04hHLXz8BGqdVw9WBlxIINoxt+hTD5QuD8i2cLKTg NaUFonXvSB601rNQVlL2U0b62EszxG51y1KTXdKxxRrVKc/euenF3yHgJap6b2npGz fp4UlobLjNYJkmBkMIw/9e6F2g42tC4oyBe6Py1tYeIysz9wWmQELEJfNDiGGLLuzS tgK9wmApfmxnrW27zjfJGOcgsBjwiEGeq/gw/mNsJV5k5kp1tgYRiaYPSnw/9PJZyf 7W/5QEiwFjIO4Fu4RAryYHcuv1R9b4+JaoeA1xcOOQNz22WLgIxWYTc9sLJl+/YYYo 74KIfhMvSQypA== Received: by mercury (Postfix, from userid 1000) id 3F8E6106057B; Fri, 27 Oct 2023 03:14:18 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel , Sakari Ailus , Jacopo Mondi Cc: Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/4] GC0308 Camera Sensor Date: Fri, 27 Oct 2023 03:12:00 +0200 Message-ID: <20231027011417.2174658-1-sre@kernel.org> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 26 Oct 2023 18:14:57 -0700 (PDT) Hi, I did the following tests done by me on an i.MX6ULL based system [0]: * v4l2-compliance -u /dev/v4l-subdev1 - v4l2-compliance 1.24.1, 32 bits, 32-bit time_t (from Debian testing) - Total for device /dev/v4l-subdev1: 44, Succeeded: 44 * Using gstreamer + v4l2-ctl - Tried 640x480, 320x240, 160x120 YUYV8_2X8 formats - Tested effect of all exposed user controls * checkpatch does not report any driver issues * dt_binding_check does not report anything Note, that there is another patchset adding GC2145, which adds the same vendor prefix. I just included it for completeness, since it's needed to avoid checkpatch and dt_binding_check warnings. [0] https://embedded-recipes.org/2023/schedule/running-foss-thermal-camera/ Changes since PATCHv2: * https://lore.kernel.org/all/20231024010355.1877523-1-sre@kernel.org/ * Simplify Kconfig dependencies * Do not store code/resolution; which is available from subdev state * Store register values for mode settings to avoid second lookup in s_stream * Reduce power_on sleep times * remove debug dev_err() print, that I accidently added in v2 * add missing format check in gc0308_enum_frame_size() * do not PM resume in gc0308_s_ctrl() * enable and use runtime PM autosuspend * add .init_cfg() PAD op * use CCI helper instead of raw regmap * cluster both flip controls (that's not just a performance optimization, but fixes an issue, that register update is slow, so fast sequential setting of VFLIP/HFLIP override each other without this) * simplify gc0308_set_power_line_freq * free control handler on probe error * use first format by default * expose V4L2_CID_HBLANK, V4L2_CID_VBLANK, V4L2_CID_PIXEL_RATE * remove incorrect support for framerate and instead add a comment Changes since PATCHv1: * https://lore.kernel.org/all/20231023002547.1754190-1-sre@kernel.org/ * Update binding: i2c0 -> i2c * Update binding: make GC0309 use GC0308 as fallback compatible * Add regulator handling in power_on/power_off * Fix alignment of regmap_multi_reg_write arguments * Fix useless extra return * Do not check for pad in gc0308_enum_frame_size() * Drop get_mbus_config implementation * Use V4L2_CID_AUTO_EXPOSURE_BIAS instead of V4L2_CID_EXPOSURE * Drop gc0308_get_format in favour of v4l2_subdev_get_fmt * Replace open-coded v4l2_find_nearest_size() logic * check clock rate instead of setting it * use fwnode_graph_get_endpoint_by_id() * power off device when probe errors out after power on * replace mutex with sub-device state * add Galaxycore to generic camera sensors section in MAINTAINERS * add GC0308 entry in MAINTAINERS Greetings, -- Sebastian Sebastian Reichel (4): dt-bindings: vendor-prefixes: add GalaxyCore media: dt-bindings: gc0308: add binding media: MAINTAINERS: Add GalaxyCore in camera sensor section media: i2c: gc0308: new driver .../bindings/media/i2c/galaxycore,gc0308.yaml | 108 ++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + MAINTAINERS | 8 + drivers/media/i2c/Kconfig | 10 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/gc0308.c | 1437 +++++++++++++++++ 6 files changed, 1566 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/i2c/galaxycore,gc0308.yaml create mode 100644 drivers/media/i2c/gc0308.c -- 2.42.0