From patchwork Tue Apr 8 12:19:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 27956 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8A44620553 for ; Tue, 8 Apr 2014 12:20:43 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id p10sf2424601pdj.11 for ; Tue, 08 Apr 2014 05:20:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:subject:date :message-id:in-reply-to:references:cc:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=RXZT9ie2zgaIAGg1RTRPHlBMQVjN7R9OOIxW3aTRYx0=; b=MibWM2rsmVrSrxNwBAmR2DIaMxcYEYXF20nVTlPTi+ORU2WFuuusWxPqyFFLmd7hPB VKB2a/77JR74pFjsnDhKXrzPWEmxTuEjCuylww0nkRDcDOilABOiU4gaoM3Kz3ijHS91 XgFVU6T8eNEIhNv/AF3DP6J4AyBzlYycRUEC52b+gq9pOKa8gGh0YyYjScLccA6zI9zY 5SmoTN+B9GPYqR9Q9UPeuWQoHOQZOBfQ0imb/LAPbneC481JvzHxSHxXfx9EZXJndBK9 WC1ApBXPvwfBIslZ4qCXWOa2OYcy+7tvbBHbe/Aymn1eEaAvWFGti5vSRm5fw16CEwqf UFiA== X-Gm-Message-State: ALoCoQm4kvu0FMpkcuuwJrWzppXdH41A0SCb4t2wGkt023GQl6VESUKjWCMPLYaaYep8GMLHZXgN X-Received: by 10.68.134.233 with SMTP id pn9mr1656259pbb.5.1396959642807; Tue, 08 Apr 2014 05:20:42 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.20.138 with SMTP id 10ls180429qgj.92.gmail; Tue, 08 Apr 2014 05:20:42 -0700 (PDT) X-Received: by 10.52.104.7 with SMTP id ga7mr1124749vdb.29.1396959642658; Tue, 08 Apr 2014 05:20:42 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id dx8si358279ved.90.2014.04.08.05.20.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Apr 2014 05:20:42 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id jw12so697761veb.13 for ; Tue, 08 Apr 2014 05:20:42 -0700 (PDT) X-Received: by 10.58.74.38 with SMTP id q6mr2869694vev.7.1396959642580; Tue, 08 Apr 2014 05:20:42 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.12.8 with SMTP id v8csp240699vcv; Tue, 8 Apr 2014 05:20:42 -0700 (PDT) X-Received: by 10.68.197.8 with SMTP id iq8mr4304672pbc.124.1396959641890; Tue, 08 Apr 2014 05:20:41 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id j4si975457pad.473.2014.04.08.05.20.36 for ; Tue, 08 Apr 2014 05:20:41 -0700 (PDT) Received-SPF: pass (google.com: domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 111CA6E9DF; Tue, 8 Apr 2014 05:20:36 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-we0-f180.google.com (mail-we0-f180.google.com [74.125.82.180]) by gabe.freedesktop.org (Postfix) with ESMTP id 08A716E9E0 for ; Tue, 8 Apr 2014 05:20:32 -0700 (PDT) Received: by mail-we0-f180.google.com with SMTP id p61so837740wes.25 for ; Tue, 08 Apr 2014 05:20:31 -0700 (PDT) X-Received: by 10.194.1.242 with SMTP id 18mr3678982wjp.22.1396959631940; Tue, 08 Apr 2014 05:20:31 -0700 (PDT) Received: from lmenx321.lme.st.com (LPuteaux-656-01-48-212.w82-127.abo.wanadoo.fr. [82.127.83.212]) by mx.google.com with ESMTPSA id v6sm2683904wif.0.2014.04.08.05.20.30 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Apr 2014 05:20:31 -0700 (PDT) From: Benjamin Gaignard To: dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org Subject: [PATCH v1 05/19] drm: sti: add I2C client driver for HDMI Date: Tue, 8 Apr 2014 14:19:12 +0200 Message-Id: <1396959566-2960-6-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1396959566-2960-1-git-send-email-benjamin.gaignard@linaro.org> References: <1396959566-2960-1-git-send-email-benjamin.gaignard@linaro.org> Cc: Fabien Dessenne , Benjamin Gaignard X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: benjamin.gaignard@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Add I2C client driver to retrieve EDID. Signed-off-by: Benjamin Gaignard Signed-off-by: Vincent Abriou Signed-off-by: Fabien Dessenne --- drivers/gpu/drm/sti/Makefile | 3 ++- drivers/gpu/drm/sti/sti_ddc.c | 56 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/sti/sti_ddc.c diff --git a/drivers/gpu/drm/sti/Makefile b/drivers/gpu/drm/sti/Makefile index 2bb3035..b6f596a 100644 --- a/drivers/gpu/drm/sti/Makefile +++ b/drivers/gpu/drm/sti/Makefile @@ -2,7 +2,8 @@ ccflags-y := -Iinclude/drm stidrm-y := sti_hdmi.o \ sti_hdmi_tx3g0c55phy.o \ - sti_hdmi_tx3g4c28phy.o + sti_hdmi_tx3g4c28phy.o \ + sti_ddc.o obj-$(CONFIG_DRM_STI) += stidrm.o obj-$(CONFIG_VTAC_STI) += sti_vtac_tx.o sti_vtac_rx.o diff --git a/drivers/gpu/drm/sti/sti_ddc.c b/drivers/gpu/drm/sti/sti_ddc.c new file mode 100644 index 0000000..147a704 --- /dev/null +++ b/drivers/gpu/drm/sti/sti_ddc.c @@ -0,0 +1,56 @@ +/* + * Copyright (C) STMicroelectronics SA 2013 + * Author: Benjamin Gaignard for STMicroelectronics. + * License terms: GNU General Public License (GPL), version 2 + */ +#include + +#include +#include +#include + +#include "sti_hdmi.h" + +static int sti_hdmi_ddc_probe(struct i2c_client *client, + const struct i2c_device_id *dev_id) +{ + sti_hdmi_attach_ddc_client(client); + + DRM_INFO("%s attached %s into i2c adapter successfully\n", + __func__, client->name); + + return 0; +} + +static int sti_hdmi_ddc_remove(struct i2c_client *client) +{ + DRM_INFO("%s detached %s from i2c adapter successfully\n", + __func__, client->name); + + return 0; +} + +static struct i2c_device_id sti_ddc_idtable[] = { + {"sti-hdmiddc", 0}, + {}, +}; + +static struct of_device_id hdmiddc_match_types[] = { + { + .compatible = "st,sti-hdmiddc", + }, { + /* end node */ + } +}; + +struct i2c_driver ddc_driver = { + .driver = { + .name = "sti-hdmiddc", + .owner = THIS_MODULE, + .of_match_table = of_match_ptr(hdmiddc_match_types), + }, + .id_table = sti_ddc_idtable, + .probe = sti_hdmi_ddc_probe, + .remove = sti_hdmi_ddc_remove, + .command = NULL, +};