We are using 8 bit frames. The problem was that we needed to send 7 such frames. We are not attempting to send 7 bits, we are sending 7 bytes.
I fixed the problem after my colleague found some variables that can be set in the device tree to affect the operation of the driver. There are 3 variables, sck-pcs-delay, pcs-sck-delay, and transfer-delay.
pcs-sck-delay sets the number of ns from chip-select active to sck active at the beginning of the transfer.
sck-pcs-delay sets the number of ns from sck inactive to chip-select inactive at the end of the transfer.
transfer-delay sets the number of ns between frames during the transfer.
Since we were not using these variables at first we were getting 0 ns between frames during the transfer, which appeared as glitches on the scope. I set transfer delay to 1000 and it put 1 us between frames which made the glitches disappear, and now everything works fine.
Thank you for your interest and help.