From patchwork Sun Sep 23 16:34:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10611813 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7F7B2161F for ; Sun, 23 Sep 2018 16:35:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69A8E2925E for ; Sun, 23 Sep 2018 16:35:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5BC9D292CB; Sun, 23 Sep 2018 16:35:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDA9D2925E for ; Sun, 23 Sep 2018 16:35:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726321AbeIWWdM (ORCPT ); Sun, 23 Sep 2018 18:33:12 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:37000 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726230AbeIWWdM (ORCPT ); Sun, 23 Sep 2018 18:33:12 -0400 Received: by mail-pl1-f196.google.com with SMTP id q1-v6so2581700plr.4 for ; Sun, 23 Sep 2018 09:35:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=OvMeTe5AAjnABGP6eOUccB9/ymkjSGUv78UKMLALGjA=; b=MznPUeS2BO429Wbav+oDy49BRVQy9YyO1tC8x5S4+h2wVD1w/MKDh0AI/cv+l8Di6l 9OcdpLzZCaTqQ+I+V7TotMmhFW5vK27R92blu9BCXhzhNuYJGvomt/bmPyKSNrNX6SCe n8zK/MKgnfeLe49DmGDu1nzoI6ppojHJOZClg0p+BdJFkU0XYAeMbVcABUpftMYKwam3 8Xj9trQDpZ8ERJxhrAo9dlXuQQNrOtH1iVnv/Bn8HVG6vqsusx1bvdp7ri723rczbwqz ayIqrt6ddX/W2Oc4fmCL6PCXwA1aaWvuaQ7wGSAthds0H8GswgN/NoN+DIglrL6OEFNe 6waw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=OvMeTe5AAjnABGP6eOUccB9/ymkjSGUv78UKMLALGjA=; b=Ga90teWGqbD2HW9B8OhMicf6AfKD2yX2SYKnzhx1tEsDynBtYM9ksWQt+kZMyf/tIQ 4mTbktSsarMRYRwO7FrvIudwyKG4025yCF/FNFpBCLmwNKQv/wbrHUMSAzfaUihAwdLu 9qKfpPUTz+Pk/WSwQhLDEGdYlHUwSNfpricxm0w64zR83am+/UIQLKfit/1RApXEwgzu GTJrRknPZ/Y4Tu/bnbIpInibKStMfPhvr+pA87Z/rZM36onfBXiD1XwKO6viV2VaWFRj Lds8+pXnWVPywhQASaCTcjD4ZLr+j1QjF4oNX7YQEb094bLiaD0C8aSj7sfSmemXPpxH pntA== X-Gm-Message-State: ABuFfoinO9hhk7DFckeEx8tZxokpOFHNbofDlt2n+tnqjcWALDabA3ke Y7b3zOhfpFskq7aL0nT5VzmsyM08 X-Google-Smtp-Source: ACcGV637kNlGvEYuEe/KoGbItMUJcoEAmH93i+pfyhlSDBwrsCAgFTiwtxWuDxbniMtH2eqZQFrp5g== X-Received: by 2002:a17:902:ab87:: with SMTP id f7-v6mr7324914plr.268.1537720510031; Sun, 23 Sep 2018 09:35:10 -0700 (PDT) Received: from mita-MS-7A45.lan ([240f:34:212d:1:9f:aa8:eeac:60f7]) by smtp.gmail.com with ESMTPSA id d129-v6sm18286250pga.69.2018.09.23.09.35.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Sep 2018 09:35:09 -0700 (PDT) From: Akinobu Mita To: linux-media@vger.kernel.org Cc: Akinobu Mita , Matt Ranostay , Sakari Ailus , Hans Verkuil , Mauro Carvalho Chehab Subject: [PATCH v2 0/6] media: video-i2c: support changing frame interval and runtime PM Date: Mon, 24 Sep 2018 01:34:46 +0900 Message-Id: <1537720492-31201-1-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patchset adds support for changing frame interval and runtime PM for video-i2c driver. This also adds an helper macro to v4l2 common internal API that is used to to find a suitable frame interval. There are a couple of unrelated changes that are included for simplifying driver initialization code and register accesses. * v2 - Add Acked-by and Reviewed-by tags - Update commit log to clarify the use after free - Add thermistor and termperature register address definisions - Stop adding v4l2_find_closest_fract() in v4l2 common internal API - Add V4L2_FRACT_COMPARE() macro in v4l2 common internal API - Use V4L2_FRACT_COMPARE() to find suitable frame interval instead of v4l2_find_closest_fract() - Add comment for register address definisions Akinobu Mita (6): media: video-i2c: avoid accessing released memory area when removing driver media: video-i2c: use i2c regmap media: v4l2-common: add V4L2_FRACT_COMPARE media: vivid: use V4L2_FRACT_COMPARE media: video-i2c: support changing frame interval media: video-i2c: support runtime PM drivers/media/i2c/video-i2c.c | 286 ++++++++++++++++++++++----- drivers/media/platform/vivid/vivid-vid-cap.c | 9 +- include/media/v4l2-common.h | 5 + 3 files changed, 247 insertions(+), 53 deletions(-) Cc: Matt Ranostay Cc: Sakari Ailus Cc: Hans Verkuil Cc: Mauro Carvalho Chehab Acked-by: Sakari Ailus