| .. | .. |
|---|
| 56 | 56 | //BANK2_MOTION |
|---|
| 57 | 57 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0xFF, 0x02); |
|---|
| 58 | 58 | |
|---|
| 59 | | - if(motion_set->fmtdef == TVI_3M_18P || motion_set->fmtdef == TVI_5M_12_5P || motion_set->fmtdef == TVI_5M_20P) |
|---|
| 60 | | - { |
|---|
| 59 | + if(motion_set->fmtdef == TVI_3M_18P || motion_set->fmtdef == TVI_5M_12_5P || |
|---|
| 60 | + motion_set->fmtdef == TVI_5M_20P) { |
|---|
| 61 | 61 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x00 + (0x07 * motion_set->ch), 0x0C); |
|---|
| 62 | 62 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x02 + (0x07 * motion_set->ch), 0x23); |
|---|
| 63 | 63 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x28 + (0x06 * motion_set->ch), 0x11); |
|---|
| 64 | 64 | |
|---|
| 65 | | - if(motion_set->fmtdef == TVI_3M_18P) |
|---|
| 66 | | - { |
|---|
| 65 | + if(motion_set->fmtdef == TVI_3M_18P) { |
|---|
| 67 | 66 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x29 + (0x06 * motion_set->ch), 0x78); |
|---|
| 68 | 67 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2A + (0x06 * motion_set->ch), 0x40); |
|---|
| 69 | 68 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2C + (0x06 * motion_set->ch), 0x72); |
|---|
| 70 | | - } |
|---|
| 71 | | - else if(motion_set->fmtdef == TVI_5M_12_5P) |
|---|
| 72 | | - { |
|---|
| 69 | + } else if(motion_set->fmtdef == TVI_5M_12_5P) { |
|---|
| 73 | 70 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x29 + (0x06 * motion_set->ch), 0xA2); |
|---|
| 74 | 71 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2A + (0x06 * motion_set->ch), 0x51); |
|---|
| 75 | 72 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2C + (0x06 * motion_set->ch), 0x9c); |
|---|
| 76 | | - } |
|---|
| 77 | | - else if(motion_set->fmtdef == TVI_5M_20P) |
|---|
| 78 | | - { |
|---|
| 73 | + } else if(motion_set->fmtdef == TVI_5M_20P) { |
|---|
| 79 | 74 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x29 + (0x06 * motion_set->ch), 0xA0); |
|---|
| 80 | 75 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2A + (0x06 * motion_set->ch), 0x51); |
|---|
| 81 | 76 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2C + (0x06 * motion_set->ch), 0x9a); |
|---|
| .. | .. |
|---|
| 84 | 79 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2B + (0x06 * motion_set->ch), 0x6); |
|---|
| 85 | 80 | |
|---|
| 86 | 81 | printk("[DRV_Motion_OnOff] ch(%d) fmtdef(%d)\n", motion_set->ch, motion_set->fmtdef); |
|---|
| 87 | | - } |
|---|
| 88 | | - else if( motion_set->fmtdef == AHD20_1080P_15P_EX || motion_set->fmtdef == AHD20_1080P_12_5P_EX ) |
|---|
| 89 | | - { |
|---|
| 82 | + } else if( motion_set->fmtdef == AHD20_1080P_15P_EX || motion_set->fmtdef == AHD20_1080P_12_5P_EX ) { |
|---|
| 90 | 83 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x00 + (0x07 * motion_set->ch), 0x0C); |
|---|
| 91 | 84 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x02 + (0x07 * motion_set->ch), 0x23); |
|---|
| 92 | 85 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x28 + (0x06 * motion_set->ch), 0x11); |
|---|
| .. | .. |
|---|
| 94 | 87 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2A + (0x06 * motion_set->ch), 0x2d); |
|---|
| 95 | 88 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2B + (0x06 * motion_set->ch), 0x06); |
|---|
| 96 | 89 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2C + (0x06 * motion_set->ch), 0xea); |
|---|
| 97 | | - } |
|---|
| 98 | | - else |
|---|
| 99 | | - { |
|---|
| 90 | + } else { |
|---|
| 100 | 91 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x28 + (0x06 * motion_set->ch), 0x00); |
|---|
| 101 | 92 | } |
|---|
| 102 | 93 | |
|---|
| 103 | | - if(motion_set->set_val<0 || motion_set->set_val>1) |
|---|
| 104 | | - { |
|---|
| 94 | + if(motion_set->set_val<0 || motion_set->set_val>1) { |
|---|
| 105 | 95 | printk("[DRV_Motion_OnOff]Error!! ch(%d) Setting Value Over:%x!! Only 0 or 1\n", motion_set->ch, motion_set->set_val); |
|---|
| 106 | 96 | return; |
|---|
| 107 | 97 | } |
|---|
| 108 | 98 | |
|---|
| 109 | | - switch(motion_set->set_val) |
|---|
| 110 | | - { |
|---|
| 99 | + switch(motion_set->set_val) { |
|---|
| 111 | 100 | case FUNC_OFF : gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], (0x00 + (0x07 * motion_set->ch)), 0x0D); |
|---|
| 112 | 101 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x28 + (0x06 * motion_set->ch), 0x00); |
|---|
| 113 | 102 | break; |
|---|
| .. | .. |
|---|
| 126 | 115 | //BANK2_MOTION |
|---|
| 127 | 116 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0xFF, 0x02); |
|---|
| 128 | 117 | |
|---|
| 129 | | - if(motion_set->fmtdef == TVI_3M_18P || motion_set->fmtdef == TVI_5M_12_5P || motion_set->fmtdef == TVI_5M_20P) |
|---|
| 130 | | - { |
|---|
| 118 | + if(motion_set->fmtdef == TVI_3M_18P || motion_set->fmtdef == TVI_5M_12_5P || |
|---|
| 119 | + motion_set->fmtdef == TVI_5M_20P) { |
|---|
| 131 | 120 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x00 + (0x07 * motion_set->ch), 0x0C); |
|---|
| 132 | 121 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x02 + (0x07 * motion_set->ch), 0x23); |
|---|
| 133 | 122 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x28 + (0x06 * motion_set->ch), 0x11); |
|---|
| 134 | 123 | |
|---|
| 135 | | - if(motion_set->fmtdef == TVI_3M_18P) |
|---|
| 136 | | - { |
|---|
| 124 | + if(motion_set->fmtdef == TVI_3M_18P) { |
|---|
| 137 | 125 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x29 + (0x06 * motion_set->ch), 0x78); |
|---|
| 138 | 126 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2A + (0x06 * motion_set->ch), 0x40); |
|---|
| 139 | 127 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2C + (0x06 * motion_set->ch), 0x72); |
|---|
| 140 | | - } |
|---|
| 141 | | - else if(motion_set->fmtdef == TVI_5M_12_5P) |
|---|
| 142 | | - { |
|---|
| 128 | + } else if(motion_set->fmtdef == TVI_5M_12_5P) { |
|---|
| 143 | 129 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x29 + (0x06 * motion_set->ch), 0xA2); |
|---|
| 144 | 130 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2A + (0x06 * motion_set->ch), 0x51); |
|---|
| 145 | 131 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2C + (0x06 * motion_set->ch), 0x9c); |
|---|
| 146 | | - } |
|---|
| 147 | | - else if(motion_set->fmtdef == TVI_5M_20P) |
|---|
| 148 | | - { |
|---|
| 132 | + } else if(motion_set->fmtdef == TVI_5M_20P) { |
|---|
| 149 | 133 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x29 + (0x06 * motion_set->ch), 0xA0); |
|---|
| 150 | 134 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2A + (0x06 * motion_set->ch), 0x51); |
|---|
| 151 | 135 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2C + (0x06 * motion_set->ch), 0x9a); |
|---|
| .. | .. |
|---|
| 153 | 137 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2B + (0x06 * motion_set->ch), 0x6); |
|---|
| 154 | 138 | |
|---|
| 155 | 139 | printk("[DRV_Motion_OnOff] ch(%d) fmtdef(%d)\n", motion_set->ch, motion_set->fmtdef); |
|---|
| 156 | | - } |
|---|
| 157 | | - else if( motion_set->fmtdef == AHD20_1080P_15P_EX || motion_set->fmtdef == AHD20_1080P_12_5P_EX ) |
|---|
| 158 | | - { |
|---|
| 140 | + } else if( motion_set->fmtdef == AHD20_1080P_15P_EX || motion_set->fmtdef == AHD20_1080P_12_5P_EX ) { |
|---|
| 159 | 141 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x00 + (0x07 * motion_set->ch), 0x0C); |
|---|
| 160 | 142 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x02 + (0x07 * motion_set->ch), 0x23); |
|---|
| 161 | 143 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x28 + (0x06 * motion_set->ch), 0x11); |
|---|
| .. | .. |
|---|
| 163 | 145 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2A + (0x06 * motion_set->ch), 0x2d); |
|---|
| 164 | 146 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2B + (0x06 * motion_set->ch), 0x06); |
|---|
| 165 | 147 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2C + (0x06 * motion_set->ch), 0xea); |
|---|
| 166 | | - } |
|---|
| 167 | | - else |
|---|
| 168 | | - { |
|---|
| 148 | + } else { |
|---|
| 169 | 149 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x28 + (0x06 * motion_set->ch), 0x00); |
|---|
| 170 | 150 | } |
|---|
| 171 | 151 | |
|---|
| 172 | | - for(ii=0; ii<24; ii++) |
|---|
| 173 | | - { |
|---|
| 152 | + for(ii=0; ii<24; ii++) { |
|---|
| 174 | 153 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], (0x40 +(0x18 *motion_set->ch)) + ii, motion_set->set_val); |
|---|
| 175 | 154 | addr = (0x40 +(0x18 *motion_set->ch)) + ii; |
|---|
| 176 | 155 | } |
|---|
| .. | .. |
|---|
| 191 | 170 | //BANK2_MOTION |
|---|
| 192 | 171 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0xFF, 0x02); |
|---|
| 193 | 172 | |
|---|
| 194 | | - if(motion_set->fmtdef == TVI_3M_18P || motion_set->fmtdef == TVI_5M_12_5P || motion_set->fmtdef == TVI_5M_20P) |
|---|
| 195 | | - { |
|---|
| 173 | + if(motion_set->fmtdef == TVI_3M_18P || motion_set->fmtdef == TVI_5M_12_5P || |
|---|
| 174 | + motion_set->fmtdef == TVI_5M_20P) { |
|---|
| 196 | 175 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x00 + (0x07 * motion_set->ch), 0x0C); |
|---|
| 197 | 176 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x02 + (0x07 * motion_set->ch), 0x23); |
|---|
| 198 | 177 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x28 + (0x06 * motion_set->ch), 0x11); |
|---|
| 199 | 178 | |
|---|
| 200 | | - if(motion_set->fmtdef == TVI_3M_18P) |
|---|
| 201 | | - { |
|---|
| 179 | + if(motion_set->fmtdef == TVI_3M_18P) { |
|---|
| 202 | 180 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x29 + (0x06 * motion_set->ch), 0x78); |
|---|
| 203 | 181 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2A + (0x06 * motion_set->ch), 0x40); |
|---|
| 204 | 182 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2C + (0x06 * motion_set->ch), 0x72); |
|---|
| 205 | | - } |
|---|
| 206 | | - else if(motion_set->fmtdef == TVI_4M_15P) |
|---|
| 207 | | - { |
|---|
| 183 | + } else if(motion_set->fmtdef == TVI_4M_15P) { |
|---|
| 208 | 184 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x29 + (0x06 * motion_set->ch), 0xA0); |
|---|
| 209 | 185 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2A + (0x06 * motion_set->ch), 0x3C); |
|---|
| 210 | 186 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2C + (0x06 * motion_set->ch), 0x9a); |
|---|
| 211 | | - } |
|---|
| 212 | | - else if(motion_set->fmtdef == TVI_5M_12_5P) |
|---|
| 213 | | - { |
|---|
| 187 | + } else if(motion_set->fmtdef == TVI_5M_12_5P) { |
|---|
| 214 | 188 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x29 + (0x06 * motion_set->ch), 0xA2); |
|---|
| 215 | 189 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2A + (0x06 * motion_set->ch), 0x51); |
|---|
| 216 | 190 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2C + (0x06 * motion_set->ch), 0x9c); |
|---|
| 217 | | - } |
|---|
| 218 | | - else if(motion_set->fmtdef == TVI_5M_20P) |
|---|
| 219 | | - { |
|---|
| 191 | + } else if(motion_set->fmtdef == TVI_5M_20P) { |
|---|
| 220 | 192 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x29 + (0x06 * motion_set->ch), 0xA0); |
|---|
| 221 | 193 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2A + (0x06 * motion_set->ch), 0x51); |
|---|
| 222 | 194 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2C + (0x06 * motion_set->ch), 0x9a); |
|---|
| .. | .. |
|---|
| 225 | 197 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2B + (0x06 * motion_set->ch), 0x6); |
|---|
| 226 | 198 | |
|---|
| 227 | 199 | printk("[DRV_Motion_OnOff] ch(%d) fmtdef(%d)\n", motion_set->ch, motion_set->fmtdef); |
|---|
| 228 | | - } |
|---|
| 229 | | - else if( motion_set->fmtdef == AHD20_1080P_15P_EX || motion_set->fmtdef == AHD20_1080P_12_5P_EX ) |
|---|
| 230 | | - { |
|---|
| 200 | + } else if( motion_set->fmtdef == AHD20_1080P_15P_EX || motion_set->fmtdef == AHD20_1080P_12_5P_EX ) { |
|---|
| 231 | 201 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x00 + (0x07 * motion_set->ch), 0x0C); |
|---|
| 232 | 202 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x02 + (0x07 * motion_set->ch), 0x23); |
|---|
| 233 | 203 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x28 + (0x06 * motion_set->ch), 0x11); |
|---|
| .. | .. |
|---|
| 235 | 205 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2A + (0x06 * motion_set->ch), 0x2d); |
|---|
| 236 | 206 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2B + (0x06 * motion_set->ch), 0x06); |
|---|
| 237 | 207 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x2C + (0x06 * motion_set->ch), 0xea); |
|---|
| 238 | | - } |
|---|
| 239 | | - else |
|---|
| 240 | | - { |
|---|
| 208 | + } else { |
|---|
| 241 | 209 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], 0x28 + (0x06 * motion_set->ch), 0x00); |
|---|
| 242 | 210 | } |
|---|
| 243 | 211 | |
|---|
| 244 | 212 | ReadVal = gpio_i2c_read(nvp6158_iic_addr[motion_set->devnum], (0x40 +(0x18 *ch)) + SetPix); |
|---|
| 245 | 213 | on = val&ReadVal; |
|---|
| 246 | | - if(on) |
|---|
| 247 | | - { |
|---|
| 214 | + if(on) { |
|---|
| 248 | 215 | val = ~val; |
|---|
| 249 | 216 | val = val&ReadVal; |
|---|
| 250 | | - } |
|---|
| 251 | | - else |
|---|
| 252 | | - { |
|---|
| 217 | + } else { |
|---|
| 253 | 218 | val = val|ReadVal; |
|---|
| 254 | 219 | } |
|---|
| 255 | 220 | gpio_i2c_write(nvp6158_iic_addr[motion_set->devnum], (0x40 +(0x18 *ch)) + SetPix, val); |
|---|
| .. | .. |
|---|
| 273 | 238 | |
|---|
| 274 | 239 | on = val&ReadVal; |
|---|
| 275 | 240 | |
|---|
| 276 | | - if(on) |
|---|
| 277 | | - { |
|---|
| 241 | + if(on) { |
|---|
| 278 | 242 | motion_set->set_val = 1; |
|---|
| 279 | | - } |
|---|
| 280 | | - else |
|---|
| 281 | | - { |
|---|
| 243 | + } else { |
|---|
| 282 | 244 | motion_set->set_val = 0; |
|---|
| 283 | 245 | } |
|---|
| 284 | 246 | } |
|---|