Lines Matching refs:ctrl

94 	u8			ctrl[DS1305_CONTROL_LEN];
146 buf[1] = ds1305->ctrl[0];
149 if (ds1305->ctrl[0] & DS1305_AEI0)
159 ds1305->ctrl[0] = buf[1];
264 * Context: caller holds rtc->ops_lock (to protect ds1305->ctrl)
281 ds1305->ctrl, sizeof(ds1305->ctrl));
285 alm->enabled = !!(ds1305->ctrl[0] & DS1305_AEI0);
286 alm->pending = !!(ds1305->ctrl[1] & DS1305_AEI0);
316 * Context: caller holds rtc->ops_lock (to protect ds1305->ctrl)
343 if (ds1305->ctrl[0] & DS1305_AEI0) {
344 ds1305->ctrl[0] &= ~DS1305_AEI0;
347 buf[1] = ds1305->ctrl[0];
370 ds1305->ctrl[0] |= DS1305_AEI0;
373 buf[1] = ds1305->ctrl[0];
388 /* ctrl[2] is treated as read-only; no locking needed */
389 if ((ds1305->ctrl[2] & 0xf0) == DS1305_TRICKLE_MAGIC) {
390 switch (ds1305->ctrl[2] & 0x0c) {
400 switch (ds1305->ctrl[2] & 0x03) {
442 /* lock to protect ds1305->ctrl */
449 ds1305->ctrl[0] &= ~(DS1305_AEI1 | DS1305_AEI0);
450 ds1305->ctrl[1] = 0;
453 buf[1] = ds1305->ctrl[0];
471 * mutex locking for ds1305->ctrl ... unlike I2C, we could issue async
578 ds1305->ctrl, sizeof(ds1305->ctrl));
585 dev_dbg(&spi->dev, "ctrl %s: %3ph\n", "read", ds1305->ctrl);
592 if ((ds1305->ctrl[0] & 0x38) != 0 || (ds1305->ctrl[1] & 0xfc) != 0) {
596 if (ds1305->ctrl[2] == 0)
602 if (ds1305->ctrl[0] & DS1305_WP) {
605 ds1305->ctrl[0] &= ~DS1305_WP;
608 buf[1] = ds1305->ctrl[0];
619 if (ds1305->ctrl[0] & DS1305_nEOSC) {
620 ds1305->ctrl[0] &= ~DS1305_nEOSC;
626 if (ds1305->ctrl[1]) {
627 ds1305->ctrl[1] = 0;
634 if (((ds1305->ctrl[2] & 0xf0) != DS1305_TRICKLE_MAGIC)) {
635 ds1305->ctrl[2] = DS1305_TRICKLE_MAGIC
643 if (!(ds1305->ctrl[0] & DS1306_1HZ)) {
644 ds1305->ctrl[0] |= DS1306_1HZ;
648 if (ds1305->ctrl[0] & DS1306_1HZ) {
649 ds1305->ctrl[0] &= ~DS1306_1HZ;
660 buf[1] = ds1305->ctrl[0];
661 buf[2] = ds1305->ctrl[1];
662 buf[3] = ds1305->ctrl[2];
670 dev_dbg(&spi->dev, "ctrl %s: %3ph\n", "write", ds1305->ctrl);
686 /* register RTC ... from here on, ds1305->ctrl needs locking */