~ubuntu-branches/ubuntu/saucy/linux-ti-omap4/saucy-proposed

« back to all changes in this revision

Viewing changes to drivers/media/video/cx25840/cx25840-core.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati, Stefan Bader, Upstream Kernel Changes
  • Date: 2012-08-15 17:17:43 UTC
  • Revision ID: package-import@ubuntu.com-20120815171743-h5wnuf51xe7pvdid
Tags: 3.5.0-207.13
[ Paolo Pisati ]

* Start new release

[ Stefan Bader ]

* (config) Enable getabis to use local package copies

[ Upstream Kernel Changes ]

* fixup: gargabe collect iva_seq[0|1] init
* [Config] enable all SND_OMAP_SOC_*s
* fixup: cm2xxx_3xxx.o is needed for omap2_cm_read|write_reg
* fixup: add some snd_soc_dai* helper functions
* fixup: s/snd_soc_dpcm_params/snd_soc_dpcm/g
* fixup: typo, no_host_mode and useless SDP4430 init
* fixup: enable again aess hwmod

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
 
85
85
 
86
86
/* ----------------------------------------------------------------------- */
87
 
static void cx23885_std_setup(struct i2c_client *client);
 
87
static void cx23888_std_setup(struct i2c_client *client);
88
88
 
89
89
int cx25840_write(struct i2c_client *client, u16 addr, u8 value)
90
90
{
638
638
        finish_wait(&state->fw_wait, &wait);
639
639
        destroy_workqueue(q);
640
640
 
641
 
        /* Call the cx23885 specific std setup func, we no longer rely on
 
641
        /* Call the cx23888 specific std setup func, we no longer rely on
642
642
         * the generic cx24840 func.
643
643
         */
644
 
        cx23885_std_setup(client);
 
644
        if (is_cx23888(state))
 
645
                cx23888_std_setup(client);
 
646
        else
 
647
                cx25840_std_setup(client);
645
648
 
646
649
        /* (re)set input */
647
650
        set_input(client, state->vid_input, state->aud_input);
1103
1106
 
1104
1107
                        cx25840_write4(client, 0x410, 0xffff0dbf);
1105
1108
                        cx25840_write4(client, 0x414, 0x00137d03);
1106
 
                        cx25840_write4(client, 0x418, 0x01008080);
 
1109
 
 
1110
                        /* on the 887, 0x418 is HSCALE_CTRL, on the 888 it is 
 
1111
                           CHROMA_CTRL */
 
1112
                        if (is_cx23888(state))
 
1113
                                cx25840_write4(client, 0x418, 0x01008080);
 
1114
                        else
 
1115
                                cx25840_write4(client, 0x418, 0x01000000);
 
1116
 
1107
1117
                        cx25840_write4(client, 0x41c, 0x00000000);
1108
 
                        cx25840_write4(client, 0x420, 0x001c3e0f);
 
1118
 
 
1119
                        /* on the 887, 0x420 is CHROMA_CTRL, on the 888 it is 
 
1120
                           CRUSH_CTRL */
 
1121
                        if (is_cx23888(state))
 
1122
                                cx25840_write4(client, 0x420, 0x001c3e0f);
 
1123
                        else
 
1124
                                cx25840_write4(client, 0x420, 0x001c8282);
 
1125
 
1109
1126
                        cx25840_write4(client, 0x42c, 0x42600000);
1110
1127
                        cx25840_write4(client, 0x430, 0x0000039b);
1111
1128
                        cx25840_write4(client, 0x438, 0x00000000);
1233
1250
                cx25840_write4(client, 0x8d0, 0x1f063870);
1234
1251
        }
1235
1252
 
1236
 
        if (is_cx2388x(state)) {
 
1253
        if (is_cx23888(state)) {
1237
1254
                /* HVR1850 */
1238
1255
                /* AUD_IO_CTRL - I2S Input, Parallel1*/
1239
1256
                /*  - Channel 1 src - Parallel1 (Merlin out) */
1298
1315
        }
1299
1316
        cx25840_and_or(client, 0x400, ~0xf, fmt);
1300
1317
        cx25840_and_or(client, 0x403, ~0x3, pal_m);
1301
 
        if (is_cx2388x(state))
1302
 
                cx23885_std_setup(client);
 
1318
        if (is_cx23888(state))
 
1319
                cx23888_std_setup(client);
1303
1320
        else
1304
1321
                cx25840_std_setup(client);
1305
1322
        if (!is_cx2583x(state))
1312
1329
static int cx25840_s_ctrl(struct v4l2_ctrl *ctrl)
1313
1330
{
1314
1331
        struct v4l2_subdev *sd = to_sd(ctrl);
 
1332
        struct cx25840_state *state = to_state(sd);
1315
1333
        struct i2c_client *client = v4l2_get_subdevdata(sd);
1316
1334
 
1317
1335
        switch (ctrl->id) {
1324
1342
                break;
1325
1343
 
1326
1344
        case V4L2_CID_SATURATION:
1327
 
                cx25840_write(client, 0x420, ctrl->val << 1);
1328
 
                cx25840_write(client, 0x421, ctrl->val << 1);
 
1345
                if (is_cx23888(state)) {
 
1346
                        cx25840_write(client, 0x418, ctrl->val << 1);
 
1347
                        cx25840_write(client, 0x419, ctrl->val << 1);
 
1348
                } else {
 
1349
                        cx25840_write(client, 0x420, ctrl->val << 1);
 
1350
                        cx25840_write(client, 0x421, ctrl->val << 1);
 
1351
                }
1329
1352
                break;
1330
1353
 
1331
1354
        case V4L2_CID_HUE:
1332
 
                cx25840_write(client, 0x422, ctrl->val);
 
1355
                if (is_cx23888(state))
 
1356
                        cx25840_write(client, 0x41a, ctrl->val);
 
1357
                else
 
1358
                        cx25840_write(client, 0x422, ctrl->val);
1333
1359
                break;
1334
1360
 
1335
1361
        default:
1354
1380
        fmt->field = V4L2_FIELD_INTERLACED;
1355
1381
        fmt->colorspace = V4L2_COLORSPACE_SMPTE170M;
1356
1382
 
1357
 
        Vsrc = (cx25840_read(client, 0x476) & 0x3f) << 4;
1358
 
        Vsrc |= (cx25840_read(client, 0x475) & 0xf0) >> 4;
 
1383
        if (is_cx23888(state)) {
 
1384
                Vsrc = (cx25840_read(client, 0x42a) & 0x3f) << 4;
 
1385
                Vsrc |= (cx25840_read(client, 0x429) & 0xf0) >> 4;
 
1386
        } else {
 
1387
                Vsrc = (cx25840_read(client, 0x476) & 0x3f) << 4;
 
1388
                Vsrc |= (cx25840_read(client, 0x475) & 0xf0) >> 4;
 
1389
        }
1359
1390
 
1360
 
        Hsrc = (cx25840_read(client, 0x472) & 0x3f) << 4;
1361
 
        Hsrc |= (cx25840_read(client, 0x471) & 0xf0) >> 4;
 
1391
        if (is_cx23888(state)) {
 
1392
                Hsrc = (cx25840_read(client, 0x426) & 0x3f) << 4;
 
1393
                Hsrc |= (cx25840_read(client, 0x425) & 0xf0) >> 4;
 
1394
        } else {
 
1395
                Hsrc = (cx25840_read(client, 0x472) & 0x3f) << 4;
 
1396
                Hsrc |= (cx25840_read(client, 0x471) & 0xf0) >> 4;
 
1397
        }
1362
1398
 
1363
1399
        Vlines = fmt->height + (is_50Hz ? 4 : 7);
1364
1400
 
1782
1818
        struct cx25840_state *state = to_state(sd);
1783
1819
        struct i2c_client *client = v4l2_get_subdevdata(sd);
1784
1820
 
1785
 
        if (is_cx2388x(state))
1786
 
                cx23885_std_setup(client);
 
1821
        if (is_cx23888(state))
 
1822
                cx23888_std_setup(client);
1787
1823
 
1788
1824
        return set_input(client, input, state->aud_input);
1789
1825
}
1794
1830
        struct cx25840_state *state = to_state(sd);
1795
1831
        struct i2c_client *client = v4l2_get_subdevdata(sd);
1796
1832
 
1797
 
        if (is_cx2388x(state))
1798
 
                cx23885_std_setup(client);
 
1833
        if (is_cx23888(state))
 
1834
                cx23888_std_setup(client);
1799
1835
        return set_input(client, state->vid_input, input);
1800
1836
}
1801
1837
 
4939
4975
        }
4940
4976
}
4941
4977
 
4942
 
static void cx23885_std_setup(struct i2c_client *client)
 
4978
static void cx23888_std_setup(struct i2c_client *client)
4943
4979
{
4944
4980
        struct cx25840_state *state = to_state(i2c_get_clientdata(client));
4945
4981
        v4l2_std_id std = state->std;