From patchwork Tue Apr 7 02:06:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 46801 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6E261214BA for ; Tue, 7 Apr 2015 02:06:19 +0000 (UTC) Received: by lamp14 with SMTP id p14sf9650884lam.3 for ; Mon, 06 Apr 2015 19:06:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=9PdD3wkPZlnCZk/CDPeHF00PMBjjZ3HpDQEnc9/HaRo=; b=EBXKvAyLR+giyi+tZoV5riINjx8QMcbC/hjJpYtuIpvy/xMX2ZpLJS/ctxcv35NHit jBmIA4HTVR9qkFU01anf2tfUlDfTtM1St1wXm1+2OBuczq26lxkVhnsIvLJ3GabOsI3n qy1tMvgm7GzfjQ/EvHuiBgYMmbh5jj31xX/5xVuoc7lFjdz7JMGsL9RMpPR4A7OiBSGP wXxobc1QWbxQDi7EW0/53Ldx1wRRf/VEKM6ZM6j9BL9PxqLs+hiJKNd+ZsmLHDsAhIy1 ZJl+Xu3pMmUsYOmSI61KQ2yaUzMfRYTgHUh7jAc22cLpRR+ff2fE2TZUANDj/5LratFA aE4A== X-Gm-Message-State: ALoCoQnadzI2XvMMRY7CFUDVN7RwFb1e6YH/j34UHBcWcon/EH3dXhjM+19KwLCzu0lrBCQXw3Bw X-Received: by 10.112.166.137 with SMTP id zg9mr750414lbb.11.1428372378384; Mon, 06 Apr 2015 19:06:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.234.236 with SMTP id uh12ls627702lac.54.gmail; Mon, 06 Apr 2015 19:06:18 -0700 (PDT) X-Received: by 10.152.116.11 with SMTP id js11mr15990875lab.106.1428372378082; Mon, 06 Apr 2015 19:06:18 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id kz8si4781945lac.108.2015.04.06.19.06.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Apr 2015 19:06:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by laat2 with SMTP id t2so24738858laa.1 for ; Mon, 06 Apr 2015 19:06:17 -0700 (PDT) X-Received: by 10.112.160.227 with SMTP id xn3mr15642801lbb.112.1428372377584; Mon, 06 Apr 2015 19:06:17 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.67.65 with SMTP id l1csp147259lbt; Mon, 6 Apr 2015 19:06:16 -0700 (PDT) X-Received: by 10.70.94.101 with SMTP id db5mr32174836pdb.62.1428372375637; Mon, 06 Apr 2015 19:06:15 -0700 (PDT) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com. [209.85.220.54]) by mx.google.com with ESMTPS id gl1si9010200pbd.2.2015.04.06.19.06.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Apr 2015 19:06:15 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.54 as permitted sender) client-ip=209.85.220.54; Received: by patj18 with SMTP id j18so62309367pat.2 for ; Mon, 06 Apr 2015 19:06:14 -0700 (PDT) X-Received: by 10.66.146.231 with SMTP id tf7mr32145060pab.130.1428372374639; Mon, 06 Apr 2015 19:06:14 -0700 (PDT) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id z6sm6068447pdp.77.2015.04.06.19.06.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 Apr 2015 19:06:13 -0700 (PDT) From: John Stultz To: projectara-software-dev Cc: Alex Elder , Greg Kroah-Hartman , John Stultz Subject: [PATCH 1/3] gbsim: gpio: Convert to using greybus gpio.h header Date: Mon, 6 Apr 2015 19:06:09 -0700 Message-Id: <1428372371-9927-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@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.215.45 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Instead of duplicating the definitions, reuse the definitions in the newly split out greybus gpio.h header. Cc: Alex Elder Cc: Greg Kroah-Hartman Signed-off-by: John Stultz --- gbsim.h | 109 ++++++++++----------------------------------------------------- gpio.c | 6 ++-- 2 files changed, 20 insertions(+), 95 deletions(-) diff --git a/gbsim.h b/gbsim.h index d3a519a..032f003 100644 --- a/gbsim.h +++ b/gbsim.h @@ -14,6 +14,7 @@ #include +#include "gpio.h" #include "i2s.h" extern int bbb_backend; @@ -72,82 +73,6 @@ struct protocol_version_rsp { __u8 version_minor; }; -/* GPIO */ -struct gpio_line_count_rsp { - __u8 count; -}; - -struct gpio_activate_req { - __u8 which; -}; - -struct gpio_deactivate_req { - __u8 which; -}; - -struct gpio_get_direction_req { - __u8 which; -}; - -struct gpio_get_direction_rsp { - __u8 direction; -}; - -struct gpio_direction_input_req { - __u8 which; -}; - -struct gpio_direction_output_req { - __u8 which; - __u8 value; -}; - -struct gpio_get_value_req { - __u8 which; -}; - -struct gpio_get_value_rsp { - __u8 value; -}; - -struct gpio_set_value_req { - __u8 which; - __u8 value; -}; - -struct gpio_set_debounce_req { - __u8 which; - __le16 usec __attribute__((__packed__)); -}; - -struct gpio_irq_type_request { - __u8 which; - __u8 type; -}; -/* irq type response has no payload */ - -struct gpio_irq_mask_request { - __u8 which; -}; -/* irq mask response has no payload */ - -struct gpio_irq_unmask_request { - __u8 which; -}; -/* irq unmask response has no payload */ - -struct gpio_irq_ack_request { - __u8 which; -}; -/* irq ack response has no payload */ - -/* irq event requests originate on another module and are handled on the AP */ -struct gpio_irq_event_request { - __u8 which; -}; -/* irq event response has no payload */ - - /* I2C */ struct i2c_functionality_rsp { __le32 functionality; @@ -205,22 +130,22 @@ struct op_msg { struct op_header header; union { struct protocol_version_rsp pv_rsp; - struct gpio_line_count_rsp gpio_lc_rsp; - struct gpio_activate_req gpio_act_req; - struct gpio_deactivate_req gpio_deact_req; - struct gpio_get_direction_req gpio_get_dir_req; - struct gpio_get_direction_rsp gpio_get_dir_rsp; - struct gpio_direction_input_req gpio_dir_input_req; - struct gpio_direction_output_req gpio_dir_output_req; - struct gpio_get_value_req gpio_get_val_req; - struct gpio_get_value_rsp gpio_get_val_rsp; - struct gpio_set_value_req gpio_set_val_req; - struct gpio_set_debounce_req gpio_set_db_req; - struct gpio_irq_type_request gpio_irq_type_req; - struct gpio_irq_mask_request gpio_irq_mask_req; - struct gpio_irq_unmask_request gpio_irq_unmask_req; - struct gpio_irq_ack_request gpio_irq_ack_req; - struct gpio_irq_event_request gpio_irq_event_req; + struct gb_gpio_line_count_response gpio_lc_rsp; + struct gb_gpio_activate_request gpio_act_req; + struct gb_gpio_deactivate_request gpio_deact_req; + struct gb_gpio_get_direction_request gpio_get_dir_req; + struct gb_gpio_get_direction_response gpio_get_dir_rsp; + struct gb_gpio_direction_in_request gpio_dir_input_req; + struct gb_gpio_direction_out_request gpio_dir_output_req; + struct gb_gpio_get_value_request gpio_get_val_req; + struct gb_gpio_get_value_response gpio_get_val_rsp; + struct gb_gpio_set_value_request gpio_set_val_req; + struct gb_gpio_set_debounce_request gpio_set_db_req; + struct gb_gpio_irq_type_request gpio_irq_type_req; + struct gb_gpio_irq_mask_request gpio_irq_mask_req; + struct gb_gpio_irq_unmask_request gpio_irq_unmask_req; + struct gb_gpio_irq_ack_request gpio_irq_ack_req; + struct gb_gpio_irq_event_request gpio_irq_event_req; struct i2c_functionality_rsp i2c_fcn_rsp; struct i2c_transfer_req i2c_xfer_req; struct i2c_transfer_rsp i2c_xfer_rsp; diff --git a/gpio.c b/gpio.c index ca413c8..3d9acf0 100644 --- a/gpio.c +++ b/gpio.c @@ -76,7 +76,7 @@ void gpio_handler(__u8 *rbuf, size_t size) break; case GB_GPIO_TYPE_LINE_COUNT: op_rsp->header.size = sizeof(struct op_header) + - sizeof(struct gpio_line_count_rsp); + sizeof(struct gb_gpio_line_count_response); op_rsp->header.id = oph->id; op_rsp->header.type = OP_RESPONSE | GB_GPIO_TYPE_LINE_COUNT; op_rsp->header.result = PROTOCOL_STATUS_SUCCESS; @@ -111,7 +111,7 @@ void gpio_handler(__u8 *rbuf, size_t size) break; case GB_GPIO_TYPE_GET_DIRECTION: op_rsp->header.size = sizeof(struct op_header) + - sizeof(struct gpio_get_direction_rsp); + sizeof(struct gb_gpio_get_direction_response); op_rsp->header.id = oph->id; op_rsp->header.type = OP_RESPONSE | GB_GPIO_TYPE_GET_DIRECTION; op_rsp->header.result = PROTOCOL_STATUS_SUCCESS; @@ -157,7 +157,7 @@ void gpio_handler(__u8 *rbuf, size_t size) break; case GB_GPIO_TYPE_GET_VALUE: op_rsp->header.size = sizeof(struct op_header) + - sizeof(struct gpio_get_value_rsp); + sizeof(struct gb_gpio_get_value_response); op_rsp->header.id = oph->id; op_rsp->header.type = OP_RESPONSE | GB_GPIO_TYPE_GET_VALUE; op_rsp->header.result = PROTOCOL_STATUS_SUCCESS;