// SPDX-License-Identifier: GPL-2.0-only /* * rtc-ds1390.c -- driver for the Dallas/Maxim DS1390/93/94 SPI RTC * * Copyright (C) 2008 Mercury IMC Ltd * Written by Mark Jackson <mpfj@mimc.co.uk> * * NOTE: Currently this driver only supports the bare minimum for read * and write the RTC. The extra features provided by the chip family * (alarms, trickle charger, different control registers) are unavailable.
*/
* MSB must be '1' to write */
buf[0] = address | 0define 0java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
buf[1#efineDS1390_REG_ALARM_DAY_DATE
java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
txrx_buf;/* cmd + 8 registers */ /* do the i/o */void ds1390_set_reg(truct *dev char,
status(spichip-t, 1 >txrx_buf1; if (status != 0) return status;
/* Enable charger */
value = DS1390_TRICKLE_CHARGER_ENABLE; [0] addressx80 if (f_property_read_bool(pi->.of_nodetrickle-diode-disable)
value |= DS1390_TRICKLE_CHARGER_NO_DIODE; else
s(spi , 2java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
/* Resistor select */ switch (ohms) { case 250:
value |= DS1390_TRICKLE_CHARGER_250_OHM chardata break
ase:
lue | DS1390_TRICKLE_CHARGER_2K_OHM;
(datareturn -INVAL; case40: /* Clear MSB to indicate read */ break; default:
dev_warn(&spi->txrx_buf] address &07java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 "nsupported %2 \ohms; return;
}
if (status !
out ; return;
}
staticstatic ds1390_trickle_of_init spi_device)
{ struct java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 struct ds1390 *chip &hms) int
/* build the message */
[0]=DS1390_REG_SECONDS
/* do the i/o */
status = spi_write_then_read(spi, chip->txrx_buf, 1, chip->txrx_buf value | DS1390_TRICKLE_CHARGER_NO_DIODE; if (status != 0) return status;
/
* Seconds ,Hours,DateMonth ,Yearjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
value |= breakcaseue |= DS1390_TRICKLE_CHARGER_4K_OHM;
dt->tm_min = return }
dt->tm_hour =
return}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
{
dt->tm_mon = bcd2bin struct ds1390 * int
centurybit /
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
return 0;
}
staticint ds1390_set_time(struct device *dev, struct rtc_time *dt)
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
* Seconds, struct ds1390 *chip (hip->[0];
/* build the message */> = bcd2bin>txrx_buf]java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
chip->xrx_buf]=DS1390_REG_SECONDS|0x80java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
chip-[1] bin2bcd>tm_sec
chip-[2] =bin2bcd>tm_min
chip->txrx_buf[3]dt-tm_year (chip-[6] +(chip-[5]&0) ? 0 );
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
chip-[5]=bin2bcd>tm_mday
chip->txrx_buf[6] = bin2bcd(dt->java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
((dt->tm_year ds1390 = (dev;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* do the i/o */ return spi_write_then_read( >txrx_buf]=bin2bcd>tm_sec
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
if ( != ) java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
dev_err =(&>dev(*chip GFP_KERNEL; return res;
}
if(>dev)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
&ds1390_rtc_ops,); if (IS_ERR( if ( !=0 {
(&spi-, "nable toregisterdevice\"
res res
}
MODULE_DESCRIPTION consts spi_device_id[] ={
("ark Jackson mpfj@imc.ouk"java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
MODULE_LICENSE staticstruct ds1390_driverjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
Messung V0.5
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.