ramips: ZyXEL Keenetic Viva: export gpio usb power
[lede.git] / target / linux / layerscape / patches-4.4 / 7167-staging-fsl-mc-update-dpmcp-binary-interface-to-v3.0.patch
1 From fa245614c92ffbdaec6a56552032432b5343b1dc Mon Sep 17 00:00:00 2001
2 From: Stuart Yoder <stuart.yoder@nxp.com>
3 Date: Mon, 11 Apr 2016 11:48:48 -0500
4 Subject: [PATCH 167/226] staging: fsl-mc: update dpmcp binary interface to
5  v3.0
6
7 Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
8 Acked-by: German Rivera <german.rivera@nxp.com>
9 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 ---
11  drivers/staging/fsl-mc/bus/dpmcp-cmd.h |    5 ++---
12  drivers/staging/fsl-mc/bus/dpmcp.c     |   35 ++------------------------------
13  drivers/staging/fsl-mc/bus/dpmcp.h     |   10 ++-------
14  3 files changed, 6 insertions(+), 44 deletions(-)
15
16 --- a/drivers/staging/fsl-mc/bus/dpmcp-cmd.h
17 +++ b/drivers/staging/fsl-mc/bus/dpmcp-cmd.h
18 @@ -33,8 +33,8 @@
19  #define _FSL_DPMCP_CMD_H
20  
21  /* DPMCP Version */
22 -#define DPMCP_VER_MAJOR                                2
23 -#define DPMCP_VER_MINOR                                1
24 +#define DPMCP_VER_MAJOR                                3
25 +#define DPMCP_VER_MINOR                                0
26  
27  /* Command IDs */
28  #define DPMCP_CMDID_CLOSE                              0x800
29 @@ -52,6 +52,5 @@
30  #define DPMCP_CMDID_SET_IRQ_MASK                       0x014
31  #define DPMCP_CMDID_GET_IRQ_MASK                       0x015
32  #define DPMCP_CMDID_GET_IRQ_STATUS                     0x016
33 -#define DPMCP_CMDID_CLEAR_IRQ_STATUS                   0x017
34  
35  #endif /* _FSL_DPMCP_CMD_H */
36 --- a/drivers/staging/fsl-mc/bus/dpmcp.c
37 +++ b/drivers/staging/fsl-mc/bus/dpmcp.c
38 @@ -213,7 +213,7 @@ int dpmcp_set_irq(struct fsl_mc_io *mc_i
39         cmd.params[0] |= mc_enc(0, 8, irq_index);
40         cmd.params[0] |= mc_enc(32, 32, irq_cfg->val);
41         cmd.params[1] |= mc_enc(0, 64, irq_cfg->paddr);
42 -       cmd.params[2] |= mc_enc(0, 32, irq_cfg->user_irq_id);
43 +       cmd.params[2] |= mc_enc(0, 32, irq_cfg->irq_num);
44  
45         /* send command to mc*/
46         return mc_send_command(mc_io, &cmd);
47 @@ -254,7 +254,7 @@ int dpmcp_get_irq(struct fsl_mc_io *mc_i
48         /* retrieve response parameters */
49         irq_cfg->val = (u32)mc_dec(cmd.params[0], 0, 32);
50         irq_cfg->paddr = (u64)mc_dec(cmd.params[1], 0, 64);
51 -       irq_cfg->user_irq_id = (int)mc_dec(cmd.params[2], 0, 32);
52 +       irq_cfg->irq_num = (int)mc_dec(cmd.params[2], 0, 32);
53         *type = (int)mc_dec(cmd.params[2], 32, 32);
54         return 0;
55  }
56 @@ -435,37 +435,6 @@ int dpmcp_get_irq_status(struct fsl_mc_i
57  }
58  
59  /**
60 - * dpmcp_clear_irq_status() - Clear a pending interrupt's status
61 - *
62 - * @mc_io:     Pointer to MC portal's I/O object
63 - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
64 - * @token:     Token of DPMCP object
65 - * @irq_index: The interrupt index to configure
66 - * @status:    Bits to clear (W1C) - one bit per cause:
67 - *                                     0 = don't change
68 - *                                     1 = clear status bit
69 - *
70 - * Return:     '0' on Success; Error code otherwise.
71 - */
72 -int dpmcp_clear_irq_status(struct fsl_mc_io *mc_io,
73 -                          u32 cmd_flags,
74 -                          u16 token,
75 -                          u8 irq_index,
76 -                          u32 status)
77 -{
78 -       struct mc_command cmd = { 0 };
79 -
80 -       /* prepare command */
81 -       cmd.header = mc_encode_cmd_header(DPMCP_CMDID_CLEAR_IRQ_STATUS,
82 -                                         cmd_flags, token);
83 -       cmd.params[0] |= mc_enc(0, 32, status);
84 -       cmd.params[0] |= mc_enc(32, 8, irq_index);
85 -
86 -       /* send command to mc*/
87 -       return mc_send_command(mc_io, &cmd);
88 -}
89 -
90 -/**
91   * dpmcp_get_attributes - Retrieve DPMCP attributes.
92   *
93   * @mc_io:     Pointer to MC portal's I/O object
94 --- a/drivers/staging/fsl-mc/bus/dpmcp.h
95 +++ b/drivers/staging/fsl-mc/bus/dpmcp.h
96 @@ -82,12 +82,12 @@ int dpmcp_reset(struct fsl_mc_io *mc_io,
97   * struct dpmcp_irq_cfg - IRQ configuration
98   * @paddr:     Address that must be written to signal a message-based interrupt
99   * @val:       Value to write into irq_addr address
100 - * @user_irq_id: A user defined number associated with this IRQ
101 + * @irq_num: A user defined number associated with this IRQ
102   */
103  struct dpmcp_irq_cfg {
104              uint64_t           paddr;
105              uint32_t           val;
106 -            int                user_irq_id;
107 +            int                irq_num;
108  };
109  
110  int dpmcp_set_irq(struct fsl_mc_io     *mc_io,
111 @@ -133,12 +133,6 @@ int dpmcp_get_irq_status(struct fsl_mc_i
112                         uint8_t                 irq_index,
113                         uint32_t                *status);
114  
115 -int dpmcp_clear_irq_status(struct fsl_mc_io    *mc_io,
116 -                          uint32_t             cmd_flags,
117 -                          uint16_t             token,
118 -                         uint8_t               irq_index,
119 -                         uint32_t              status);
120 -
121  /**
122   * struct dpmcp_attr - Structure representing DPMCP attributes
123   * @id:                DPMCP object ID