From patchwork Tue May 20 13:56:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 30454 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CBF1B202FE for ; Tue, 20 May 2014 13:57:08 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id ey11sf1407175pad.4 for ; Tue, 20 May 2014 06:57:08 -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=iv+AgGBgERmfW3gjWROxzoI29eOKUGbId2kKOVmo71o=; b=LstwwPc2v1xdo0YPsL9pTaaa1m9fzWsQ8sCS6mCvkcw/MUfNl1EsTVIF3+2KnjenFX Ry7CiN1IMoCGewcX607+kX9VgbgCQ9JWexmRTS35wRPUd8oN0OjwjKdqcB88BQxuhBYU S4agiWUWsE7aUpRLR9Qp3hQJrGgNKjsHOUtmw5/KwAWfvjIRyTqk2XMkeu7ox/iVVxHM dK9aNlME6RWiFROO7j7hajf2vGxEaBznBzMKilOqG6vpLI5JKc5fi1Io8clXxtqVKw7N IOIB10fBx6wcZIwpWOJCzXElz/+Ekd5yHU9uE8UM5Re5Od4wZgYC1KkEDpkzR9JCPylO mQeg== X-Gm-Message-State: ALoCoQlVCOVrCItzGqOoRfu1k5dzXLBRS63FKzJBWum2fXIBHdLkktX6yRoI0ESEvRcaYxT7DZbo X-Received: by 10.68.230.193 with SMTP id ta1mr19813569pbc.6.1400594228157; Tue, 20 May 2014 06:57:08 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.32.203 with SMTP id h69ls257938qgh.56.gmail; Tue, 20 May 2014 06:57:08 -0700 (PDT) X-Received: by 10.220.69.4 with SMTP id x4mr594877vci.74.1400594227985; Tue, 20 May 2014 06:57:07 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id uc9si4986931vdc.30.2014.05.20.06.57.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 20 May 2014 06:57:07 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.171 as permitted sender) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id oz11so633603veb.2 for ; Tue, 20 May 2014 06:57:07 -0700 (PDT) X-Received: by 10.220.7.131 with SMTP id d3mr967196vcd.45.1400594227917; Tue, 20 May 2014 06:57:07 -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.221.72 with SMTP id ib8csp32745vcb; Tue, 20 May 2014 06:57:06 -0700 (PDT) X-Received: by 10.68.233.37 with SMTP id tt5mr51133720pbc.154.1400594226070; Tue, 20 May 2014 06:57:06 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id yh6si24757842pab.122.2014.05.20.06.57.05 for ; Tue, 20 May 2014 06:57:06 -0700 (PDT) Received-SPF: none (google.com: dri-devel-bounces@lists.freedesktop.org does not designate permitted sender hosts) client-ip=131.252.210.177; Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D94826E067; Tue, 20 May 2014 06:57:04 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com [74.125.83.49]) by gabe.freedesktop.org (Postfix) with ESMTP id D9A4C6E8E0 for ; Tue, 20 May 2014 06:57:01 -0700 (PDT) Received: by mail-ee0-f49.google.com with SMTP id e53so591704eek.8 for ; Tue, 20 May 2014 06:57:01 -0700 (PDT) X-Received: by 10.15.41.131 with SMTP id s3mr4471011eev.54.1400594221025; Tue, 20 May 2014 06:57:01 -0700 (PDT) Received: from lmenx321.lme.st.com ([80.10.159.130]) by mx.google.com with ESMTPSA id x45sm4061136eee.37.2014.05.20.06.56.59 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 20 May 2014 06:57:00 -0700 (PDT) From: Benjamin Gaignard To: dri-devel@lists.freedesktop.org, airlied@linux.ie, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 04/16] drm: sti: add I2C client driver for HDMI Date: Tue, 20 May 2014 15:56:14 +0200 Message-Id: <1400594186-8956-5-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1400594186-8956-1-git-send-email-benjamin.gaignard@linaro.org> References: <1400594186-8956-1-git-send-email-benjamin.gaignard@linaro.org> Cc: lee.jones@linaro.org, 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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.171 as permitted sender) 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 --- 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 5295fc7..6c474eb 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_VTAC_STI) += sti_vtac_tx.o sti_vtac_rx.o obj-$(CONFIG_VTG_STI) += sti_vtg.o sti_vtg_utils.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, +};